Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-20-2004, 05:36 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default don't know what to do with this script, help me

PHP Code:
<html>
<head>
<title>Images Upload</title>
<meta http-equiv=Content-Type content=text/html; charset=utf-8>
<style type="text/css">
A:link {
    COLOR: #333333; FONT-FAMILY: Tahoma, Arial, Verdana; TEXT-DECORATION: underline
}
A:visited {
    FONT-SIZE: 11px; COLOR: #333333; FONT-FAMILY: Tahoma, Arial, Verdana; TEXT-DECORATION: underline
}
A:hover {
    COLOR: #777777; FONT-FAMILY: Tahoma, Arial, Verdana; TEXT-DECORATION: none
}
A:active {
    COLOR: #777777; FONT-FAMILY: Tahoma, Arial, Verdana; TEXT-DECORATION: underline
}
BODY {
    SCROLLBAR-FACE-COLOR: #f2f2f2; FONT-SIZE: 11px; MARGIN: 0px; SCROLLBAR-HIGHLIGHT-COLOR: #f2f2f2; SCROLLBAR-SHADOW-COLOR: #f2f2f2; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #626262; SCROLLBAR-TRACK-COLOR: #fdfdfd; FONT-FAMILY: Tahoma, Arial, Verdana; SCROLLBAR-DARKSHADOW-COLOR: #c6c5c5; BACKGROUND-COLOR: #ffffff
}
TABLE {
    FONT-SIZE: 11px; COLOR: #333333; FONT-FAMILY: Tahoma, Arial, Verdana
}
.main-form {
    BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #999999 1px solid; COLOR: #333333; BORDER-BOTTOM: #999999 1px solid; FONT-FAMILY: Tahoma, Arial, Verdana; BACKGROUND-COLOR: #fdfdfd
}
.main-table {
    PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px; PADDING-RIGHT: 4px
}
</style>
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td width="100%" height="100%">

<? 
include("path.php"); 
if ($upload && $_GET["upload"]=="ok" && $file) 
    { 
        if ($file_type!="image/gif" && $file_type!="image/pjpeg" && $file_type!="image/png") 
            { 
                echo " 
                    <table width=414 border=0 cellpadding=0 cellspacing=0 align=center>
                       <tr>
                        <td width=414 height=13 align=center valign=top class=main-table><strong>IMAGES UPLOAD </strong></td>
                      </tr>
                      <tr>
                        <td height=100% bgcolor=#333333></td>
                      </tr>
                      <tr>
                        <td height=22 align=center valign=top class=main-table>
                        Error ! This extension is not support. Please chose another file
                        </td>
                      </tr>
                        <tr>
                        <td height=100% bgcolor=#333333></td>
                      </tr>
                
                    </table>
                    "; 
            } 
        else 
            { 
                $dir="store"; 
                $link="http://".$root.$dir;                 
                $uf=$dir."/".$file_name; 
                $upload=@copy($file,$uf); 
                if (!$upload) 
                    { 
                            echo " 
                            <table width=414 border=0 cellpadding=0 cellspacing=0 align=center>
                               <tr>
                                <td width=414 height=13 align=center valign=top class=main-table><strong>IMAGES UPLOAD </strong></td>
                              </tr>
                              <tr>
                                <td height=100% bgcolor=#333333></td>
                              </tr>
                              <tr>
                                <td height=22 align=center valign=top class=main-table>
                                Error ! Can not upload, please try again or check your path.
                                </td>
                              </tr>
                                <tr>
                                <td height=100% bgcolor=#333333></td>
                              </tr>
                              <tr>
                                <td height=12></td>
                              </tr>
                              
                            </table>
                            "; 
                    } 
                else 
                    {             

                        echo "<table width=414 border=0 cellpadding=0 cellspacing=0 align=center> 
                           <tr>
                            <td width=414 height=13 align=center valign=top class=main-table><strong>File upload sucessfully </strong></td>
                          </tr>
                          <tr>
                            <td height=100% bgcolor=#333333></td>
                          </tr>
                          <tr>
                            <td height=22 align=center valign=top class=main-table>
                            Preview <br>
                            <img src=$link/$file_name border=0>
                            </td>
                          </tr>
                           <tr>
                            <td height=100% bgcolor=#333333></td>
                          </tr>
                          <tr>
                            <td height=13 align=center valign=middle class=main-table>Your images url<br> 
                            <textarea name=textarea cols=50 class=main-form rows=4>$link/$file_name</textarea> </td>
                          </tr>
                           <tr>
                            <td height=100% bgcolor=#333333></td>
                          </tr>
                          <tr>
                            <td height=13 align=center valign=middle class=main-table>Affiliate link | Copy and put this link where u wanna add this button <br> 
                            <textarea name=textarea cols=50 class=main-form rows=4><a href=$link/$file_name target=blank><img src=$link/$file_name border=0 width=88 height=31></a></textarea> </td>
                          </tr>
                           <tr>
                            <td height=100% bgcolor=#333333></td>
                          </tr>
                          <tr>
                            <td height=13 align=center valign=top class=main-table>    [ <a href=?>Upload another</a> ] <br>      </td>
  </tr>
</table>"; 
                    } 
                } 
    }             
else 
    { 
echo " 
<table width=414 border=0 cellpadding=0 cellspacing=0 align=center>
 <form method=post action=index.php?upload=ok enctype=multipart/form-data>
  <tr>
    <td width=414 height=13 align=center valign=top class=main-table><strong>IMAGE HOSTING</strong></td>
  </tr>
 
  <tr>
    <td height=100% bgcolor=#333333></td>
  </tr>
  <tr>
    <td height=22 align=center valign=top class=main-table><input name=file type=file class=main-form size=50>    </td>
  </tr>
  <tr>
    <td height=13 align=center valign=middle class=main-table><input name=upload type=submit class=main-form id=upload value=upload></td>
  </tr>
   <tr>
    <td height=100% bgcolor=#333333></td>
  </tr>
  <tr>
    <td height=13 align=center valign=top class=main-table>Note : These files with extension name <strong>GIF</strong> | <strong>PNG</strong> | <strong>JPG</strong> are accepted</td>
  </tr>
  <tr>
    <td height=13 align=center valign=top class=main-table>All Images are copyright to their respective owners.</td>
  </tr>
  <tr>
    <td height=12>
      Any problem please contact: <a href="http://www.site.com">deathemperor at site.com</a>, Create by [email]ABC@hotmail.com[/email]</td>
  </tr>
  </form>
</table>"; 

?>
</td>
</tr>
</table>
</body>
</html>
it shows: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in index.php on line 170
170 is "Any problem please contact: <a href="http://www.site.com">deathemperor at site.com</a>, Create by ABC@hotmail.com"
if I remove the <a> tag, it works but I want to hyper link it
any idea ?
Reply With Quote
  #2  
Old 03-20-2004, 06:10 AM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href=\"what ever link url \">
Reply With Quote
  #3  
Old 03-20-2004, 06:48 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yay, my bad, have thought that but didn't try >_< thank you
btw how to let people upload zip file ?
Reply With Quote
  #4  
Old 03-24-2004, 07:04 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in the above script, how to check if a file aready there, if not, accept it for uploading, if yes, print a error message.
I've tried below be can seem to make it go fine >_<
PHP Code:
 if (file_exists($file_name)) { 
                    echo
"
                            <table width=414 border=0 cellpadding=0 cellspacing=0 align=center>
                               <tr>
                                <td width=414 height=13 align=center valign=top class=main-table><strong>IMAGES UPLOAD </strong></td>
                              </tr>
                              <tr>
                                <td height=100% bgcolor=#333333></td>
                              </tr>
                              <tr>
                                <td height=22 align=center valign=top class=main-table>
                                File already exists, Please change the filename or try another one.
                                </td>
                              </tr>
                                <tr>
                                <td height=100% bgcolor=#333333></td>
                              </tr>
                              <tr>
                                <td height=12></td>
                              </tr>
                              
                            </table>"
; } 
Reply With Quote
  #5  
Old 03-29-2004, 02:26 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please, any one please...
Reply With Quote
  #6  
Old 03-29-2004, 04:13 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a really interesting file-upload class here, but it might be beyond your level.

View the following article which explains file system handling:
http://www.sitepoint.com/forums/show...ight=uploading

Ignore the image gallery stuff, and just pick up the upload concepts.

It's hard to help with your problem since I don't know enough of the specifics. I also recommend you not combine your HTML with PHP, it's a horrible practice. Look into a templating system, like Smarty.
Reply With Quote
  #7  
Old 03-29-2004, 09:05 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so bad I still cannot deal with that
I got problem with setting directory for uploaded file >_<
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03988 seconds
  • Memory Usage 2,271KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete