Re: [PHP-DB] Am I doing This Right?
The server is 4.0.6 ...And I tried to get the owner to update it. He said its not nesscarry.
Re: [PHP-DB] Am I doing This Right?
No, you're doing it wrong. ---John Holmes... - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 01, 2002 2:05 AM Subject: [PHP-DB] Am I doing This Right? > > > > function war3_replays_submit() { > > if ( isset($replay_file) ) { > $htmlHead = ""; > pgHead('Shadow Legion :: Warcraft III Replays', $htmlHead); > > // Get Current DB Entrys > $rDB = mysql_query("select * from war3_replays where 1"); > > // Select The Next Entry ID For Newly Uploaded Replay > $db_count = sizeof($rDB); > $db_nextid = $db_count + 1; > > // Define Date Dubmitted > $rDate = date("m-d-y"); > > // Define HTTP_POST_FILES Variables > $rTemp = $HTTP_POST_FILES['replay_file']['tmp_name']; > $rName = $HTTP_POST_FILES['replay_file']['name']; > $rSize = $HTTP_POST_FILES['replay_file']['size']; > > // Define Replay Upload DIR and FILE name > $rFile = $db_nextid."_".$HTTP_POST_FILES['replay_file']['name']; > $rLoc = "files/war3-replays/$rFile"; > > // DB Query For Inserting File Information into DB > // DB Layout [ id | user | date | url | size | type | replaytitle | > version | replayname | downloads ] > $q1 = "INSERT INTO war3_replays VALUES ( $db_nextid, > '$replay_submitter', '$rDate', '$rLoc', '$rSize', '$replay_type', > '$replay_version', '$replay_mapname', 0 ) "; > > // Check If The File Was Moved And Renamed Properly > if ( @ > !move_uploaded_file($HTTP_POST_FILES['replay_file']['tmp_name'], "$rLoc") ) { > print 'Sorry, file not correctly uploaded.'; > pgMid(); > nav('war3-replays-submit'); > pgFoot(); > exit(); > > // If File Was Moved And Renames Properly > } else { > > // Check If The Database Information Was Inserted Properly > if ( !mysql_query($q1) ) { > print 'Failed to insert the Replay Information into the > database.'; > pgMid(); > nav('war3-replays-submit'); > pgFoot(); > exit(); > > // If The DB Was Updated Properly... Make The User Happy !!! > } else { > > print 'Thank you for submitting your replay > '.$replay_submitter.'! > The view replay will be up within the next few days.Thanks > again!'; > > } > } > } else { > $htmlHead = ' src="/files/upload.js">'; > pgHead('Shadow Legion :: Warcraft 3 Replays',$htmlHead); > print ' > Upload Your Replay > action="?q=war3-replays-submit" method="post"> > borderColor="#99"> > > Replay File< > /font>: > < > /td> > > > Replay Title< > /font> > name="replay_title"> > > > Category:< > /center> > value="-">Type...Solo value="ffa">Free For AllTeam value="ums">Use Map Settings > > > Map Name:< > /center> > size="20" name="replay_mapname"> > > > War3 Version > When Replay Recorded: > id="replay_version">Version... > v1.03v1.02v1.01< > /option>v1.00 > > > Member:< > /center> > name="replay_submitter" id="replay_submitter"> > > > name="replay_disc" cols="40" rows="7"> > > > onClick="javascript:uploadCheck();" value="Upload"> type="reset" value="Start Over"> > > > > > > > '; > pgMid(); > nav('war3-replays-submit'); > pgFoot(); > } > } > ?> > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Am I doing This Right?
or just do phpinfo(); en check all the vars cause in the latest php versions it could be that you have to use $_POST[.. etc.. ___ Mark Snijders, Developer Atos Origin Groenewoudeseweg 1, Room VN-515 5621 BA Eindhoven, The Netherlands * : [EMAIL PROTECTED] *:+31 (0)40 - 2785992 (tel) * : +31 (0)40 - 2788729 (fax) The information in this mail is intended only for use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. Access to this mail by anyone else than the addressee is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken omitted to be taken in reliance of it, is prohibited and may be unlawful. -Original Message- From: Mohammad Saad [mailto:m_saad@;khi.comsats.net.pk] Sent: vrijdag 1 november 2002 11:11 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Am I doing This Right? check the values of these variables $rTemp = $HTTP_POST_FILES['replay_file']['tmp_name']; $rName = $HTTP_POST_FILES['replay_file']['name']; $rSize = $HTTP_POST_FILES['replay_file']['size']; // Define Replay Upload DIR and FILE name $rFile = $db_nextid."_".$HTTP_POST_FILES['replay_file']['name']; $rLoc = "files/war3-replays/$rFile"; they should contain some value , one more thing , mite be the case that $HTTP_POST_FILES['replay_file']['tmp_name'] should be $HTTP_POST_FILES['REPLAY_FILE']['TMP_NAME] do one thing, print_r($HTTP_POST_FILES); this should show you what that array contains Good Luck ----- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 01, 2002 2:45 PM Subject: Re: [PHP-DB] Am I doing This Right? > >After I submit the file, it goes back to the form, even though in the > script, it says to go to the database and move the uploaded file to a new > DIR. > >It ignores it as if the file wasn't uploaded. > >As for printing out the variables. All my important variables are > $HTTP_POST_FILES and those are all null. > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Am I doing This Right?
check the values of these variables $rTemp = $HTTP_POST_FILES['replay_file']['tmp_name']; $rName = $HTTP_POST_FILES['replay_file']['name']; $rSize = $HTTP_POST_FILES['replay_file']['size']; // Define Replay Upload DIR and FILE name $rFile = $db_nextid."_".$HTTP_POST_FILES['replay_file']['name']; $rLoc = "files/war3-replays/$rFile"; they should contain some value , one more thing , mite be the case that $HTTP_POST_FILES['replay_file']['tmp_name'] should be $HTTP_POST_FILES['REPLAY_FILE']['TMP_NAME] do one thing, print_r($HTTP_POST_FILES); this should show you what that array contains Good Luck ----- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 01, 2002 2:45 PM Subject: Re: [PHP-DB] Am I doing This Right? > >After I submit the file, it goes back to the form, even though in the > script, it says to go to the database and move the uploaded file to a new > DIR. > >It ignores it as if the file wasn't uploaded. > >As for printing out the variables. All my important variables are > $HTTP_POST_FILES and those are all null. > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Am I doing This Right?
On Friday 01 November 2002 17:45, [EMAIL PROTECTED] wrote: >After I submit the file, it goes back to the form, even though in > the script, it says to go to the database and move the uploaded file to a > new DIR. > >It ignores it as if the file wasn't uploaded. > >As for printing out the variables. All my important variables are > $HTTP_POST_FILES and those are all null. manual > Variables > Variable scope And also if you're using a version of php newer than 4.0.6 then you should be using $_FILES instead of $HTTP_POST_FILES. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* What we Are is God's gift to us. What we Become is our gift to God. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Am I doing This Right?
After I submit the file, it goes back to the form, even though in the script, it says to go to the database and move the uploaded file to a new DIR. It ignores it as if the file wasn't uploaded. As for printing out the variables. All my important variables are $HTTP_POST_FILES and those are all null.
Re: [PHP-DB] Am I doing This Right?
On Friday 01 November 2002 17:00, [EMAIL PROTECTED] wrote: >After I "upload" it was takes me back to the Form. And ignores > "$replay_file"... >And I don't know why. 1) Any error messages? 2) What exactly do you mean by: ignores "$replay_file"... Try some basic debugging techniques like printing the names & values of important variables at strategic places in your code to verify that they contain what you expect them to contain. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* One man's Mede is another man's Persian. -- George M. Cohan */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Am I doing This Right?
After I "upload" it was takes me back to the Form. And ignores "$replay_file"... And I don't know why.
Re: [PHP-DB] Am I doing This Right?
On Friday 01 November 2002 15:05, [EMAIL PROTECTED] wrote: > > function war3_replays_submit() { > > if ( isset($replay_file) ) { Doing what right? Where/what is the problem? -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* "See - the thing is - I'm an absolutist. I mean, kind of ... in a way ..." */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php