I am creating a script that requires the use of PHP. I know PERL can do much more than PHP can, but there are various factors involved. Basically, it is a simple upload script. I am using strict, and the error tells me that I have not defined the scalars within the PHP script, even though I have. I am no PHP programmer, and still have alot to learn about PERL. The PHP code is:
<? function uploadProg($filename1,$filename1_name){ ########Set the destination here############## $destination="Upload"; $address="http://24.65.85.177/games/upload/upload/"; # Complete path t +o file (with trailing slash) copy($filename1,$destination."/".$filename1_name); echo "<FONT COLOR=TAN><b>$filename1_name was uploaded succesfully.</b> +<br><br></FONT>"; echo "<A HREF=\"$address$filename1_name\"><FONT COLOR=TAN><b>$address$ +filename1_name</b></FONT></A><BR><BR><BR>"; } function main(){?> <form method="post" action="upload.php" enctype="multipart/form-data"> Upload Banner:<br> <input type="file" name="filename1" size="20" tabindex="1"><br> <input type="hidden" name="action" value="uploadProg"> <input type="submit" value="Upload Banner" tabindex="6"> </form><?} switch ($action){ default: main(); break; case "uploadProg": if ($filename1=="none") {echo("<BODY BGCOLOR=BLACK><h1><FONT COLOR=TAN +>Please make sure you have selected a valid file\!</h1></FONT></BODY> +"); break;} uploadProg($filename1,$filename1_name); break; } ?>
I want to put this code inside an HTML block:
print qq! # code coes here !;
^^ One main reason I'm using PHP, is because every PERL script I've tried to use for uploading, it has not worked on my server (Win32- Apache).
If you can help, please drop me an e-mail at firebird34@swirvemail.com or reply here.

edited: Thu Oct 3 03:22:24 2002 by jeffa - added code tags and applied liberal edits - hope i didn't lose anything ...


In reply to PHP through PERL by FireBird34

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.