[PHP-DB] Re: Page cannot be displayed continues
Matthew Perry [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Everyone, Thank you very much for your advice about not using PUT. I will use GET or POST from now on. I am, however, failing to understand how to use headers to change pages instead of meta tags. After checking if the user has logged in correctly I do this: if ($loginGood){ echo 'meta http-equiv=refresh content=0;URL=welcome.php'; } else { echo 'meta http-equiv=refresh content=0;URL=loginerror.php'; } How can I use a header like the following one to do change pages based on variable input? if ($loginGood){ header('location: welcome.php'); exit; } else { header('location: loginerror.php'); exit; } Regards, Torsten Thank you for your time and patience, - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Image / file uploader
On 30 April 2004 01:10, Craig Hoffman wrote: When I put single quotes in the PHP_SELF and I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING and I can't use double quotes because its in an echo statement. What am I missing? Curly braces: echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data' Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] PHP Training
Yeah...Zandstra, Teach Yourself PHP in 24 Hours, 3rd ed. (Sams 2004). ;-) -Original Message- From: Rafi Sheikh [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 11:50 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] PHP Training Any one know of a good training course for PHP (beg to intermediate-1-3 days) in the twin cities area? Best regards, RS This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. -- 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] Image / file uploader
This is really becoming an irritating small bug. I tried the curly brackets and the photo name still does not show up when I echo out the query. Everything else about the script works fine. Why does PHP choke on forms that submit files to themselves? I am slowly running out things to try... Suggestions? Thanks for everyone's help. CH __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimbmedia.com _ On Apr 30, 2004, at 5:05 AM, Ford, Mike [LSS] wrote: On 30 April 2004 01:10, Craig Hoffman wrote: When I put single quotes in the PHP_SELF and I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING and I can't use double quotes because its in an echo statement. What am I missing? Curly braces: echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data' Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Image / file uploader
Craig Hoffman wrote: This is really becoming an irritating small bug. I tried the curly brackets and the photo name still does not show up when I echo out the query. Everything else about the script works fine. Why does PHP choke on forms that submit files to themselves? I am slowly running out things to try... Suggestions? Remove the action attribute of your form tag. Default is to post back to same page. echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data' Also yuk! Have you considered at the very least separating your presentation layer out into separate files so that you don't echo() your HTML? This will make your life easier if ever you want some non-PHP person to help w/ layout. It'll also make your life easier if you want to redesign the form later w/o having to muck around in your processing logic or if you want to add caching to your site. It'll also make your life easier if you want to move templates out of the web root or want to change your app design to use an object-oriented application framework (like Mojavi, Binarycloud, etc.). etc., etc., etc. Hans -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] inserting same data into multiple tables question (?)
Hi, I want to input the same data into multiple tables in one query if possible. So what I want to do is input about 6 usernames I have into about 15 tables. How would I do this? In one query? I really don't want to run multiple queries over 15 times to put in the data in each table. Would this work? INSERT into tbl1 , tbl2 , tbl3 ... ? J Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] inserting same data into multiple tables question (?)
You can't with standard SQL, nor with MySQL. _ - Original Message - From: JeRRy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 30, 2004 3:04 PM Subject: [PHP-DB] inserting same data into multiple tables question (?) Hi, I want to input the same data into multiple tables in one query if possible. So what I want to do is input about 6 usernames I have into about 15 tables. How would I do this? In one query? I really don't want to run multiple queries over 15 times to put in the data in each table. Would this work? INSERT into tbl1 , tbl2 , tbl3 ... ? J Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com -- 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] inserting same data into multiple tables question (?)
From: JeRRy [EMAIL PROTECTED] I want to input the same data into multiple tables in one query if possible. It's not. You really have to question your database schema if you need to do this. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Image / file uploader
Hans, Thanks Hans. I tried what your suggested and still no luck. __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimbmedia.com _ On Apr 30, 2004, at 7:57 AM, Hans Lellelid wrote: Craig Hoffman wrote: This is really becoming an irritating small bug. I tried the curly brackets and the photo name still does not show up when I echo out the query. Everything else about the script works fine. Why does PHP choke on forms that submit files to themselves? I am slowly running out things to try... Suggestions? Remove the action attribute of your form tag. Default is to post back to same page. echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data' Also yuk! Have you considered at the very least separating your presentation layer out into separate files so that you don't echo() your HTML? This will make your life easier if ever you want some non-PHP person to help w/ layout. It'll also make your life easier if you want to redesign the form later w/o having to muck around in your processing logic or if you want to add caching to your site. It'll also make your life easier if you want to move templates out of the web root or want to change your app design to use an object-oriented application framework (like Mojavi, Binarycloud, etc.). etc., etc., etc. Hans -- 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] Image / file uploader
Thanks Hans. I tried what your suggested and still no luck. What does the actual HTML form look like? Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Image / file uploader
Here you go: I mostly echo out the HTML. I have included the entire form here. Thanks - CH echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data'); echo (table border='0' cellpadding='5' width='500' cellspacing='0' id='result_table' tr bgcolor='#DBE6D1' td width='100'bName:b/td td$row[name]/td); echo (/tr); echo (tr); if ($row[photo_name] != '') { echo (tdimg src='images/clients/$row[photo_name]' width='50' align='right' id='photo_login' /td); } else { $photo_name = 'nbsp;'; } echo(tr bgcolor='#ECF8DF' tdbBio:/b/td td colspan='2'textarea rows='4'name='bio' cols='45'$row[bio]/textarea/td /tr tr bgcolor='#DBE6D1' tdbGoals:/b/td td colspan='2'textarea rows='4' name='goals' cols='45'$row[goals]/textarea/td /tr tr bgcolor='#ECF8DF' tdbFavorite Race:/b/td td colspan='2'textarea rows='4' name='fav_race' cols='45'$row[fav_race]/textarea/td /tr tr bgcolor='#DBE6D1' tdbFavorite Place to Train:/b/td td colspan='2'textarea rows='4' name='fav_train' cols='45'$row[fav_train]/textarea/td /tr tr bgcolor='#ECF8DF' td bUpload Photo:/b/td td colspan='2'input type='file' name='photo' /tr tr bgcolor='#DBE6D1' td colspan='3' INPUT type='hidden' name='MAX_FILE_SIZE' value='1000' input type='hidden' name='oldimage' value='.$row[photo_name].' input type='hidden' name='user_id' value='$row[0]' input type='hidden' name='postback_bio' value='true' input type='submit' value='Submit' id='submit_buttom'/td /tr /table /form); __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimbmedia.com _ On Apr 30, 2004, at 8:47 AM, Chris Boget wrote: Thanks Hans. I tried what your suggested and still no luck. What does the actual HTML form look like? Chris -- 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] inserting same data into multiple tables question (?)
Hi, John W. Holmes wrote: From: JeRRy [EMAIL PROTECTED] I want to input the same data into multiple tables in one query if possible. It's not. You really have to question your database schema if you need to do this. Yeah, I agree w/ John -- you probably want to examine your database schema if you think you need to do that. If you are building a really complex application that really does require a whole bunch of inserts for adding a user, then you should probably consider using TRIGGERS -- and a database that supports them (e.g. PostgreSQL). http://www.postgresql.org/docs/7.4/interactive/plpgsql-trigger.html You would do something like (in Postgres): CREATE FUNCTION do_other_inserts RETURNS trigger AS ' BEGIN INSERT INTO table2 (username) VALUES (NEW.username); INSERT INTO table3 (username) VALEUS (NEW.username); END; ' LANGUAGE plpgsql; CREATE TRIGGER other_inserts AFTER INSERT ON table1 FOR EACH ROW EXECUTE PROCEDURE do_other_inserts(); Of course you'll probably want to also add triggers to handle deleting and updating users. The better/faster solution would be to use integer (user_id rather than username) foreign keys and specify ON UPDATE CASCADE and ON DELETE CASCADE so that the updates and deletes would propogate automatically. You'd probably still need an INSERT trigger, though, if you have related rows which must be added. I'm assuming that since you asked whether you can INSERT into multiple tables, that this is probably sounding a little overwhelming. I encourage you to spend some time to figure this stuff out now, though, because it will only become a nightmare when you actually have production data you realize that your data model is inefficient unscalable. Hans -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Image / file uploader
Here you go: I mostly echo out the HTML. I have included the entire form here. Thanks - CH echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data'); echo (table border='0' cellpadding='5' width='500' ... If you could send the actual resulting HTML that is echoed by your script, that would be more helpful in diagnosing why your browser isn't posting back to the right page. HL -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Image / file uploader
No problem - Here you go. Thanks - CH !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleeClimb Media and RaceLogix Traininglog/title meta name=generator content=BBEdit 7.1.3 / meta name=author content=eClimb Media - www.eclimbmedia.com / meta name=copyright content=eClimb Media - www.eclimbmedia.com / meta name=description content=online personal traininglog brought to you by eClimb Media and RaceLogix / meta name=keywords content=personal training, marathon training program, racelogix, eclimb media, running, traininglog, training / /head link rel=stylesheet rev=stylesheet href=css/standard.css media=all / body table width=700 border=0 cellspacing=0 cellpadding=0 align=center id=main_content_table tr td colspan=4 id=content_headerh2Welcome to Training log/h2/td /tr tr valign=top td width=100 id=content_table_navtable id=left_nav_table cellpadding=0 cellspacing=0 tr td width=100 height=22 id=homea href=index.phpHome/a/td /tr /table br / table id=left_nav_tablecellpadding=0 cellspacing=0 tr td width=100 height=22 id=coachinga href=login.phpLogin/a/td /tr tr td width=100 height=22 id=mailinga href=mailinglist.phpMailing List/a/td /tr tr td width=100 height=22 id=contacta href=contact.phpContact/a/td /tr /table br / table id=left_nav_table cellpadding=0 cellspacing=0 tr td width=125 height=22 id=coachinga href=coaching.phpCoaching/a/td /tr tr td width=125 height=22 id=Group Runa href=grouprun.phpGroup Runs/a/td /tr tr td width=125 height=22 id=Group Runa href=featuredathlete.phpFeatured Athlete/a/td /tr /table br / table id=left_nav_tablecellpadding=0 cellspacing=0 tr td width=100 height=22 id=utilitiesa href=util.phpUtilities/a/td /tr tr td width=100 height=22 id=logouta href=logout.phpLogout/a/td /tr /table/td td id=content_cell width=500h4Edit Your Bio/h4 h2Tell us a little about yourself./h2 p id='message'No new image supplied./p UPDATE users SET bio = 'Hello World - Bio', goals = 'Hello World - Goal', fav_race = 'Hello World - Race', fav_train = 'Hello World - Trainingf', photo_name = '' WHERE user_id = '12' form method='post' action='/~choffman/www/mtrain/client_profile.php' encType='multipart/form-data'table border='0' cellpadding='5' width='500' cellspacing='0' id='result_table' tr bgcolor='#DBE6D1' td width='100'bName:b/td tdCraig Hoffman/td/trtrtr bgcolor='#ECF8DF' tdbBio:/b/td td colspan='2'textarea rows='4'name='bio' cols='45'Hello World - Bioing/textarea/td /tr tr bgcolor='#DBE6D1' tdbGoals:/b/td td colspan='2'textarea rows='4' name='goals' cols='45'Hello World - Goaling/textarea/td /tr tr bgcolor='#ECF8DF' tdbFavorite Race:/b/td td colspan='2'textarea rows='4' name='fav_race' cols='45'Hello World - Raceing/textarea/td /tr tr bgcolor='#DBE6D1' tdbFavorite Place to Train:/b/td td colspan='2'textarea rows='4' name='fav_train' cols='45'Hello World - Trainingfsdf/textarea/td /tr tr bgcolor='#ECF8DF' td bUpload Photo:/b/td td colspan='2'input type='file' name='photo' /tr tr bgcolor='#DBE6D1' td colspan='3' INPUT type='hidden' name='MAX_FILE_SIZE' value='1000' input type='hidden' name='oldimage' value='' input type='hidden' name='user_id' value='12' input type='hidden' name='postback_bio' value='true' input type='submit' value='Submit' id='submit_buttom'/td /tr /table /form /td /tr /table /body /html __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimbmedia.com _ On Apr 30, 2004, at 8:56 AM, Hans Lellelid wrote: Here you go: I mostly echo out the HTML. I have included the entire form here. Thanks - CH echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data'); echo (table border='0' cellpadding='5' width='500' ... If you could send the actual resulting HTML that is echoed by your script, that would be more helpful in diagnosing why your browser isn't posting back to the right page. HL -- 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] Image / file uploader
Craig, Where is the code that actually handles the image upload? Is it in /~choffman/www/mtrain/client_profile.php? If so, can you post that too? Rich -Original Message- From: Craig Hoffman [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 10:08 AM To: Hans Lellelid Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Image / file uploader No problem - Here you go. Thanks - CH !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleeClimb Media and RaceLogix Traininglog/title meta name=generator content=BBEdit 7.1.3 / meta name=author content=eClimb Media - www.eclimbmedia.com / meta name=copyright content=eClimb Media - www.eclimbmedia.com / meta name=description content=online personal traininglog brought to you by eClimb Media and RaceLogix / meta name=keywords content=personal training, marathon training program, racelogix, eclimb media, running, traininglog, training / /head link rel=stylesheet rev=stylesheet href=css/standard.css media=all / body table width=700 border=0 cellspacing=0 cellpadding=0 align=center id=main_content_table tr td colspan=4 id=content_headerh2Welcome to Training log/h2/td /tr tr valign=top td width=100 id=content_table_navtable id=left_nav_table cellpadding=0 cellspacing=0 tr td width=100 height=22 id=homea href=index.phpHome/a/td /tr /table br / table id=left_nav_tablecellpadding=0 cellspacing=0 tr td width=100 height=22 id=coachinga href=login.phpLogin/a/td /tr tr td width=100 height=22 id=mailinga href=mailinglist.phpMailing List/a/td /tr tr td width=100 height=22 id=contacta href=contact.phpContact/a/td /tr /table br / table id=left_nav_table cellpadding=0 cellspacing=0 tr td width=125 height=22 id=coachinga href=coaching.phpCoaching/a/td /tr tr td width=125 height=22 id=Group Runa href=grouprun.phpGroup Runs/a/td /tr tr td width=125 height=22 id=Group Runa href=featuredathlete.phpFeatured Athlete/a/td /tr /table br / table id=left_nav_tablecellpadding=0 cellspacing=0 tr td width=100 height=22 id=utilitiesa href=util.phpUtilities/a/td /tr tr td width=100 height=22 id=logouta href=logout.phpLogout/a/td /tr /table/td td id=content_cell width=500h4Edit Your Bio/h4 h2Tell us a little about yourself./h2 p id='message'No new image supplied./p UPDATE users SET bio = 'Hello World - Bio', goals = 'Hello World - Goal', fav_race = 'Hello World - Race', fav_train = 'Hello World - Trainingf', photo_name = '' WHERE user_id = '12' form method='post' action='/~choffman/www/mtrain/client_profile.php' encType='multipart/form-data'table border='0' cellpadding='5' width='500' cellspacing='0' id='result_table' tr bgcolor='#DBE6D1' td width='100'bName:b/td tdCraig Hoffman/td/trtrtr bgcolor='#ECF8DF' tdbBio:/b/td td colspan='2'textarea rows='4'name='bio' cols='45'Hello World - Bioing/textarea/td /tr tr bgcolor='#DBE6D1' tdbGoals:/b/td td colspan='2'textarea rows='4' name='goals' cols='45'Hello World - Goaling/textarea/td /tr tr bgcolor='#ECF8DF' tdbFavorite Race:/b/td td colspan='2'textarea rows='4' name='fav_race' cols='45'Hello World - Raceing/textarea/td /tr tr bgcolor='#DBE6D1' tdbFavorite Place to Train:/b/td
Re: [PHP-DB] Image / file uploader
Sure - I never thought i would have some many issues with a simple postback. ;) Here 's the code: ? function display_edit_bio($user_id) { if($_POST['postback_bio']) { include include/dbadmin.php; //image uploader $uploadpath = 'images/clients/'; $source = $HTTP_POST_FILES['photo']['tmp_name']; $photo_name = $HTTP_POST_FILES['photo']['name']; $dest = ''; if (($source != '') ($source != '')) { $dest = $uploadpath.$photo_name; if ($dest != '') { if (move_uploaded_file($source, $dest)) { echo (p id='message'Image and Bio has been successfully stored./p ); } else { echo (p id='message'Image could not be stored./p); } } } else { echo (p id='message'No new image supplied./p); $photo_name = $oldimage; } //declare varibles $user_id = $_POST[user_id]; $name = $_POST[name]; $bio = $_POST[bio]; $goals = $_POST[goals]; $fav_race = $_POST[fav_race]; $fav_train = $_POST[fav_train]; $photo = $_POST[photo_name]; $query = UPDATE users SET bio = '$bio', goals = '$goals', fav_race = '$fav_race', fav_train = '$fav_train', photo_name = '$photo_name' WHERE user_id = '$user_id'; echo $query; $msg = span style='color:red' id='message'Could not update record/span; $result = mysql_query($query, $db) or ($msg); } ? __ Craig Hoffman iChat: m0untaind0g __ On Apr 30, 2004, at 9:17 AM, Hutchins, Richard wrote: Craig, Where is the code that actually handles the image upload? Is it in /~choffman/www/mtrain/client_profile.php? If so, can you post that too? Rich -Original Message- From: Craig Hoffman [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 10:08 AM To: Hans Lellelid Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Image / file uploader No problem - Here you go. Thanks - CH !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleeClimb Media and RaceLogix Traininglog/title meta name=generator content=BBEdit 7.1.3 / meta name=author content=eClimb Media - www.eclimbmedia.com / meta name=copyright content=eClimb Media - www.eclimbmedia.com / meta name=description content=online personal traininglog brought to you by eClimb Media and RaceLogix / meta name=keywords content=personal training, marathon training program, racelogix, eclimb media, running, traininglog, training / /head link rel=stylesheet rev=stylesheet href=css/standard.css media=all / body table width=700 border=0 cellspacing=0 cellpadding=0 align=center id=main_content_table tr td colspan=4 id=content_headerh2Welcome to Training log/h2/td /tr tr valign=top td width=100 id=content_table_navtable id=left_nav_table cellpadding=0 cellspacing=0 tr td width=100 height=22 id=homea href=index.phpHome/a/td /tr /table br / table id=left_nav_tablecellpadding=0 cellspacing=0 tr td width=100 height=22 id=coachinga href=login.phpLogin/a/td /tr tr td width=100 height=22 id=mailinga href=mailinglist.phpMailing List/a/td /tr tr td width=100 height=22 id=contacta href=contact.phpContact/a/td /tr /table br / table id=left_nav_table cellpadding=0 cellspacing=0 tr td width=125 height=22 id=coachinga href=coaching.phpCoaching/a/td /tr tr td width=125 height=22 id=Group Runa href=grouprun.phpGroup Runs/a/td /tr tr td width=125 height=22 id=Group Runa href=featuredathlete.phpFeatured Athlete/a/td /tr /table br / table id=left_nav_tablecellpadding=0 cellspacing=0 tr td width=100 height=22 id=utilitiesa href=util.phpUtilities/a/td /tr tr td width=100 height=22 id=logouta href=logout.phpLogout/a/td /tr /table/td td id=content_cell width=500h4Edit Your Bio/h4 h2Tell us a little about yourself./h2 p id='message'No new image supplied./p UPDATE users SET bio = 'Hello World - Bio', goals = 'Hello World - Goal', fav_race = 'Hello World - Race', fav_train = 'Hello World - Trainingf', photo_name = '' WHERE user_id = '12' form method='post' action='/~choffman/www/mtrain/client_profile.php' encType='multipart/form-data'table border='0' cellpadding='5' width='500' cellspacing='0' id='result_table' tr bgcolor='#DBE6D1' td width='100'bName:b/td tdCraig Hoffman/td/trtrtr bgcolor='#ECF8DF'
Re: [PHP-DB] Image / file uploader
That worked! Han's and everyone else thank you very much. I owe everyone who helped out a beer. ;) Thanks CH __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimbmedia.com _ On Apr 30, 2004, at 9:22 AM, Hans Lellelid wrote: Errr $HTTP_POST_FILES is not superglobal (am I wrong?) $_FILES or specify global $HTTP_POST_FILES Hans Craig Hoffman wrote: ? function display_edit_bio($user_id) { if($_POST['postback_bio']) { include include/dbadmin.php; //image uploader $uploadpath = 'images/clients/'; $source = $HTTP_POST_FILES['photo']['tmp_name']; $photo_name = $HTTP_POST_FILES['photo']['name']; $dest = ''; if (($source != '') ($source != '')) { $dest = $uploadpath.$photo_name; if ($dest != '') { if (move_uploaded_file($source, $dest)) { echo (p id='message'Image and Bio has been successfully stored./p ); } else { echo (p id='message'Image could not be stored./p); } } } else { echo (p id='message'No new image supplied./p); $photo_name = $oldimage; } //declare varibles $user_id = $_POST[user_id]; $name = $_POST[name]; $bio = $_POST[bio]; $goals = $_POST[goals]; $fav_race = $_POST[fav_race]; $fav_train = $_POST[fav_train]; $photo = $_POST[photo_name]; $query = UPDATE users SET bio = '$bio', goals = '$goals', fav_race = '$fav_race', fav_train = '$fav_train', photo_name = '$photo_name' WHERE user_id = '$user_id'; echo $query; $msg = span style='color:red' id='message'Could not update record/span; $result = mysql_query($query, $db) or ($msg); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Image / file uploader
Jinkeys! I had a hunch the problem was with that upload script. Nice catch, Hans! Rich -Original Message- From: Craig Hoffman [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 10:41 AM To: Hans Lellelid Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Image / file uploader That worked! Han's and everyone else thank you very much. I owe everyone who helped out a beer. ;) Thanks CH __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimbmedia.com _ On Apr 30, 2004, at 9:22 AM, Hans Lellelid wrote: Errr $HTTP_POST_FILES is not superglobal (am I wrong?) $_FILES or specify global $HTTP_POST_FILES Hans Craig Hoffman wrote: ? function display_edit_bio($user_id) { if($_POST['postback_bio']) { include include/dbadmin.php; //image uploader $uploadpath = 'images/clients/'; $source = $HTTP_POST_FILES['photo']['tmp_name']; $photo_name = $HTTP_POST_FILES['photo']['name']; $dest = ''; if (($source != '') ($source != '')) { $dest = $uploadpath.$photo_name; if ($dest != '') { if (move_uploaded_file($source, $dest)) { echo (p id='message'Image and Bio has been successfully stored./p ); } else { echo (p id='message'Image could not be stored./p); } } } else { echo (p id='message'No new image supplied./p); $photo_name = $oldimage; } //declare varibles $user_id = $_POST[user_id]; $name = $_POST[name]; $bio = $_POST[bio]; $goals = $_POST[goals]; $fav_race = $_POST[fav_race]; $fav_train = $_POST[fav_train]; $photo = $_POST[photo_name]; $query = UPDATE users SET bio = '$bio', goals = '$goals', fav_race = '$fav_race', fav_train = '$fav_train', photo_name = '$photo_name' WHERE user_id = '$user_id'; echo $query; $msg = span style='color:red' id='message'Could not update record/span; $result = mysql_query($query, $db) or ($msg); } -- 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] Image / file uploader
does it puke when its not using _self? Craig Hoffman wrote: This is really becoming an irritating small bug. I tried the curly brackets and the photo name still does not show up when I echo out the query. Everything else about the script works fine. Why does PHP choke on forms that submit files to themselves? I am slowly running out things to try... Suggestions? Thanks for everyone's help. CH __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimbmedia.com _ On Apr 30, 2004, at 5:05 AM, Ford, Mike [LSS] wrote: On 30 April 2004 01:10, Craig Hoffman wrote: When I put single quotes in the PHP_SELF and I get this error: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING and I can't use double quotes because its in an echo statement. What am I missing? Curly braces: echo (form method='post' action='{$_SERVER['PHP_SELF']}' encType='multipart/form-data' Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Subject: Image / file uploader
BTW that line should read if ($dest =='') not if ($dest = '') You need 2 equals signs to test for equality, using one you are setting $dest to an empty string. It's a miracle it ever worked ;-) Cheers - Neil if ($dest = '') { if (move_uploaded_file($source, $dest)) { echo (p id='message'Image and Bio has been successfully stored./p ); } else { echo (p id='message'Image could not be stored./p); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] headers and if statements
?if($logIn != 1) {header(Location: loginError.php);}? Why does this direct me to loginError.php even when $logIn = 1? - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] headers and if statements
Hum. Is $logIn null at times?!?! ?if($logIn != 1) {header(Location: loginError.php);}? Why does this direct me to loginError.php even when $logIn = 1? - Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] headers and if statements
Have you tried: ?php if (!$login=1) {header(Location: loginerror.php);)? -Original Message- From: Daniel Clark [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 4:19 PM To: matthew perry Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] headers and if statements Hum. Is $logIn null at times?!?! ?if($logIn != 1) {header(Location: loginError.php);}? Why does this direct me to loginError.php even when $logIn = 1? - Matt -- 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] headers and if statements
From: matthew perry [EMAIL PROTECTED] ?if($logIn != 1) {header(Location: loginError.php);}? Why does this direct me to loginError.php even when $logIn = 1? It doesn't. Double check your value of $logIn by printing it out or using print_r/vardump/etc... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] headers and if statements
I think that would try to set $login=1. Need two == Have you tried: ?php if (!$login=1) {header(Location: loginerror.php);)? -Original Message- From: Daniel Clark [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 4:19 PM To: matthew perry Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] headers and if statements Hum. Is $logIn null at times?!?! ?if($logIn != 1) {header(Location: loginError.php);}? Why does this direct me to loginError.php even when $logIn = 1? - Matt -- 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] headers and if statements
From: Erik Meyer [EMAIL PROTECTED] Have you tried: ?php if (!$login=1) {header(Location: loginerror.php);)? Uhmm... Have _YOU_ tried that??? = vs == ? ;) ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] headers and if statements
I am testing now testing it with the ==, silly mistake -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 4:38 PM To: Erik Meyer; PHP-DB Subject: Re: [PHP-DB] headers and if statements From: Erik Meyer [EMAIL PROTECTED] Have you tried: ?php if (!$login=1) {header(Location: loginerror.php);)? Uhmm... Have _YOU_ tried that??? = vs == ? ;) ---John Holmes... -- 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] headers and if statements
We've ALL done it before :-) I am testing now testing it with the ==, silly mistake -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, April 30, 2004 4:38 PM To: Erik Meyer; PHP-DB Subject: Re: [PHP-DB] headers and if statements From: Erik Meyer [EMAIL PROTECTED] Have you tried: ?php if (!$login=1) {header(Location: loginerror.php);)? Uhmm... Have _YOU_ tried that??? = vs == ? ;) ---John Holmes... -- 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: [PHP] What's wrong with this IF statement?
if ($cat_id != 53 || $cat_id != 54 || $cat_id != 55 || $cat_id != 117 || $cat_id != 118 || $cat_id != 74) anyone else see the problem with the IN clause instead: ie. if !($cat in (53, 54, 55, 117, 118, 74))... makes building SQL statements much easier. especially with mutiple SELECTS in a pull down form object. -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] SQL for Showing the number of queries served on each day.
I found this code below that allows me to retreive the queries served on my server for each day but can't figure out how to actually display the information using echo. Can some one give me an example using the following SQL? SELECT DATE_FORMAT(ex_date, '%Y %m %d %W'), COUNT(id) FROM email WHERE ex_dateNow()-INTERVAL 50 DAY GROUP BY DATE_FORMAT(ex_date, '%Y %m %d %W') ORDER BY DATE_FORMAT(ex_date, '%Y %m %d %W') DESC Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SQL for Showing the number of queries served on each day.
Vern wrote: I found this code below that allows me to retreive the queries served on my server for each day but can't figure out how to actually display the information using echo. Can some one give me an example using the following SQL? SELECT DATE_FORMAT(ex_date, '%Y %m %d %W'), COUNT(id) FROM email WHERE ex_dateNow()-INTERVAL 50 DAY GROUP BY DATE_FORMAT(ex_date, '%Y %m %d %W') ORDER BY DATE_FORMAT(ex_date, '%Y %m %d %W') DESC You probably just need to use an alias. SELECT DATE_FORMAT(ex_date, '%Y %m %d %W') as mydate, COUNT(id) as mycount Then, you'll have columns called mydate and mycount in your result set. Without knowing what database you're using, it's hard to give an example with exact code. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: SQL for Showing the number of queries served on each day.
Vern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I found this code below that allows me to retreive the queries served on my server for each day but can't figure out how to actually display the information using echo. Can some one give me an example using the following SQL? SELECT DATE_FORMAT(ex_date, '%Y %m %d %W'), COUNT(id) FROM email WHERE ex_dateNow()-INTERVAL 50 DAY GROUP BY DATE_FORMAT(ex_date, '%Y %m %d %W') ORDER BY DATE_FORMAT(ex_date, '%Y %m %d %W') DESC Thanks i'd use : SELECT DATE_FORMAT(ex_date, '%Y %m %d %W') as mydate, COUNT(id) AS mysum FROM email WHERE ex_dateNow()-INTERVAL 50 DAY GROUP BY mydate ORDER BY mydate DESC then you get mydate as the date you need and mysum as the count of id's regards, U. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SQL for Showing the number of queries served on each day.
That did it thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php