RE: [PHP-DB] [Import text file]
A quick trip through the MySQL manual hints that you may have to use forward slashes in your path on a windows system. So... LOAD DATA LOCAL INFILE 'C:/WINDOWS/TEMP/phpC255.TMP' INTO TABLE abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (dp_indpri,dp_nom,dp_ville) ...might just do the trick (note the forward slashes in the path to the file). Hope this helps. -Original Message- From: RG [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 6:32 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] [Import text file] Hi I try to do an import text file into a mysql table with the php script provided with Manucorp Easyphp, but it does not work. The message is : Erreur requete SQL: LOAD DATA LOCAL INFILE 'C:\WINDOWS\TEMP\phpC255.TMP' INTO TABLE abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (dp_indpri,dp_nom,dp_ville) MySQL a repondu:File 'c:windowstempphpc255.tmp' not found (Errcode:2) The path above seems to be incorrect, but i have not found where to modify it. Environment is : Apache 1.3.17 win32 PHP 4.0.5-dev MySQL client API version 3.23.32 An idea ?? RG [EMAIL PROTECTED] -- 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-DB] MySQL problem -- new to PHP
Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL problem -- new to PHP
Looks like is to do with MySQL permissions. Check your host's (the one you are trying to connect from) permissions to the server. To change permissions, from the MySQL prompt type; GRANT ALL ON * TO username@host IDENTIFIED BY password; Substitute in username, host and password for your ones. Easier to use PHPMyAdmin or SQLYog (www.sqlyog.com) if you're new to it. I'm pretty new, so learning all the time. A couple of links to get you started; http://www.mysql.com/doc/en/GRANT.html http://www.mysql.com/doc/en/GRANT.html Good luck, Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 13:20 To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem -- new to PHP Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] MySQL problem -- new to PHP
PHPMyAdmin is just a web-based tool for administering MySQL and it's pretty intuitive, assuming you've used similar tools before. You can download it and read more here http://www.phpwizard.net/projects/phpMyAdmin/ I would recommend SQLYog as an alternative; http://www.webyog.com/sqlyog/index.html as it's VERY intuitive and pretty simple to use. But then you can't beat going straight into the MySQL prompt and learning from there Here are some good links for tutorials and examples; www.php.net and www.mysql.com for searching on specific functions - unless you have the memory of a few Cray computers ;o) http://www.evilwalrus.com http://www.zend.com/zend/tut/ http://www.devshed.com/Server_Side/MySQL/ http://www.devshed.com/Server_Side/PHP/ There are tons out there, but they are good starting points. Good luck, Nick -Original Message- From: Mark Loewenberg [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 14:01 To: Clarkson, Nick Subject: Re: [PHP-DB] MySQL problem -- new to PHP Well you opened up my question! Do you know where to learn PHPMyAdmin? Thanks in advance, Mark Clarkson, Nick wrote: Looks like is to do with MySQL permissions. Check your host's (the one you are trying to connect from) permissions to the server. To change permissions, from the MySQL prompt type; GRANT ALL ON * TO username@host IDENTIFIED BY password; Substitute in username, host and password for your ones. Easier to use PHPMyAdmin or SQLYog (www.sqlyog.com) if you're new to it. I'm pretty new, so learning all the time. A couple of links to get you started; http://www.mysql.com/doc/en/GRANT.html http://www.mysql.com/doc/en/GRANT.html Good luck, Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 13:20 To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem -- new to PHP Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- Mark Loewenberg 770 428 1071 [EMAIL PROTECTED] http://www.ITSbiz.net Affordable Website Design Website Hosting @ $9.95/month ITSbiz also provides: IT Solutions Phone Systems Phone Data Wiring Services This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How can i upload files
Hi All, Can anyone tell me how can i select and upload files using php. Thanks in advance, Gabriel, - Original Message - From: Clarkson, Nick [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 13, 2003 10:59 AM Subject: RE: [PHP-DB] MySQL problem -- new to PHP Looks like is to do with MySQL permissions. Check your host's (the one you are trying to connect from) permissions to the server. To change permissions, from the MySQL prompt type; GRANT ALL ON * TO username@host IDENTIFIED BY password; Substitute in username, host and password for your ones. Easier to use PHPMyAdmin or SQLYog (www.sqlyog.com) if you're new to it. I'm pretty new, so learning all the time. A couple of links to get you started; http://www.mysql.com/doc/en/GRANT.html http://www.mysql.com/doc/en/GRANT.html Good luck, Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 13:20 To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem -- new to PHP Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. -- 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] How can i upload files
Gabriel -- ...and then Gabriel Gramajo said... % % Hi All, % Can anyone tell me how can i select and upload files using php. You can begin by not hijacking a thread and changing the topic. When you want to start something new, start a fresh message. You could next check the list archives; this comes up at least twice a month. After that you could take a look at the Fine Manual and read the Fine Example and try it out. That's all there is to it! % % Thanks in advance, % % Gabriel, HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg18431/pgp0.pgp Description: PGP signature
FW: [PHP-DB] [Import text file]
Just forwarding this on to the general list as it was only sent directly to me. -Original Message- From: karthikeyan.balasubramanian [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 9:03 AM To: Hutchins, Richard Subject: Re: [PHP-DB] [Import text file] try using something like this C:\\WINDOWS\\TEMP\\PHPC255.TMP Hope this works. Have a great day. - Original Message - From: Hutchins, Richard [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, February 13, 2003 6:41 PM Subject: RE: [PHP-DB] [Import text file] A quick trip through the MySQL manual hints that you may have to use forward slashes in your path on a windows system. So... LOAD DATA LOCAL INFILE 'C:/WINDOWS/TEMP/phpC255.TMP' INTO TABLE abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (dp_indpri,dp_nom,dp_ville) ...might just do the trick (note the forward slashes in the path to the file). Hope this helps. -Original Message- From: RG [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 6:32 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] [Import text file] Hi I try to do an import text file into a mysql table with the php script provided with Manucorp Easyphp, but it does not work. The message is : Erreur requete SQL: LOAD DATA LOCAL INFILE 'C:\WINDOWS\TEMP\phpC255.TMP' INTO TABLE abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (dp_indpri,dp_nom,dp_ville) MySQL a repondu:File 'c:windowstempphpc255.tmp' not found (Errcode:2) The path above seems to be incorrect, but i have not found where to modify it. Environment is : Apache 1.3.17 win32 PHP 4.0.5-dev MySQL client API version 3.23.32 An idea ?? RG [EMAIL PROTECTED] -- 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] MySQL problem -- new to PHP
If you cut and pasted your code, try to put localhost into quotes as well. Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 7:20 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL problem -- new to PHP Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL problem -- new to PHP
When changing/adding permissions to the mysql db for specific users, dont forget to do 'flush privileges'... my 2 cents On Thu, 2003-02-13 at 07:19, Evan Morris wrote: Hi all I am new to PHP (just basically started yesterday). I am currently having a problem connecting to a MySQL database. My sample code is: -- ?php mysql_connect(localhost,username,password) or die (Unable to connect to MySQL server.); $db = mysql_select_db(DB_NAME) or die (Unable to select requested database.); ? --- This throws the following error: --- Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to connect to this MySQL server --- Now, the mySQL server and the web server reside on the same machine. This warning is therefore saying that this machine does not have permission to connect to itself. Hmm. I have put entries in the host table and the user table, using both hostname and ip address, but no luck. I keep getting the same error. What am I doing wrong? Any and all help appreciated. Thanks Evan Morris [EMAIL PROTECTED] +27 11 792 2777 (tel) +27 11 792 2711 (fax) -- Mignon Hunter Web Developer Toshiba International 713.466.0277 x 3461 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] [Import text file]
This LIST need some change :). Generally we just say reply and give our suggestions. This works in other list. This one goes only to the person who posed the question. Have a great day. Karthikeyan B. - Original Message - From: Hutchins, Richard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 13, 2003 7:59 PM Subject: FW: [PHP-DB] [Import text file] Just forwarding this on to the general list as it was only sent directly to me. -Original Message- From: karthikeyan.balasubramanian [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 9:03 AM To: Hutchins, Richard Subject: Re: [PHP-DB] [Import text file] try using something like this C:\\WINDOWS\\TEMP\\PHPC255.TMP Hope this works. Have a great day. - Original Message - From: Hutchins, Richard [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, February 13, 2003 6:41 PM Subject: RE: [PHP-DB] [Import text file] A quick trip through the MySQL manual hints that you may have to use forward slashes in your path on a windows system. So... LOAD DATA LOCAL INFILE 'C:/WINDOWS/TEMP/phpC255.TMP' INTO TABLE abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (dp_indpri,dp_nom,dp_ville) ...might just do the trick (note the forward slashes in the path to the file). Hope this helps. -Original Message- From: RG [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 6:32 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] [Import text file] Hi I try to do an import text file into a mysql table with the php script provided with Manucorp Easyphp, but it does not work. The message is : Erreur requete SQL: LOAD DATA LOCAL INFILE 'C:\WINDOWS\TEMP\phpC255.TMP' INTO TABLE abonnes FIELDS TERMINATED BY ';' ESCAPED BY '\\' LINES TERMINATED BY '\r\n' (dp_indpri,dp_nom,dp_ville) MySQL a repondu:File 'c:windowstempphpc255.tmp' not found (Errcode:2) The path above seems to be incorrect, but i have not found where to modify it. Environment is : Apache 1.3.17 win32 PHP 4.0.5-dev MySQL client API version 3.23.32 An idea ?? RG [EMAIL PROTECTED] -- 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] [Import text file]
On Friday 14 February 2003 00:29, karthikeyan.balasubramanian wrote: This LIST need some change :). Your email client needs changing :) Generally we just say reply and give our suggestions. This works in other list. The 'other' list is broken. This one goes only to the person who posed the question. Real email clients gives you multiple response methods -- reply to sender; reply to list; reply to all; bounce; redirect etc -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* Drinking is not a spectator sport. -- Jim Brosnan */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] List Server Configuration; Was [Import text file]
Well ... in fact, most lists that I've been on use the Reply-To header to automate this. MOST email clients I have used do not recognize email as list email and while they have a Reply and Reply All option, I've never seen a Reply-List option. So ... what is right, and who is broke could be argued all day. The one I've seen used the most would be implemented as a change to the list server. -- Mitch On Fri, 14 Feb 2003, Jason Wong wrote: On Friday 14 February 2003 00:29, karthikeyan.balasubramanian wrote: This LIST need some change :). Your email client needs changing :) Generally we just say reply and give our suggestions. This works in other list. The 'other' list is broken. This one goes only to the person who posed the question. Real email clients gives you multiple response methods -- reply to sender; reply to list; reply to all; bounce; redirect etc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] List Server Configuration; Was [Import text file]
Mitch, et al -- ...and then [EMAIL PROTECTED] said... % % Well ... in fact, most lists that I've been on use the Reply-To header to % automate this. MOST email clients I have used do not recognize email as That doesn't make it right :-) % list email and while they have a Reply and Reply All option, I've never That doesn't mean they're doing it right :-) % seen a Reply-List option. That doesn't mean it doesn't exist :-) % % So ... what is right, and who is broke could be argued all day. The one % I've seen used the most would be implemented as a change to the list % server. I invite you to surf over to http://www.unicom.com/pw/reply-to-harmful.html and have a read on why this is such a bad idea. % % -- Mitch Now back to our regularly schedule discussions... HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg18438/pgp0.pgp Description: PGP signature
Re: [PHP-DB] crypt help
On Wed, Feb 12, 2003 at 03:33:22PM -0500, Zach Davis wrote: I have a question about the way I'm using the crypt function in a PHP/SQL gradebook I'm building. When I add a user to the users table, I also generate a encrypted version of their password using the following statement: // Crypt the password $crypt_num = crypt($student_num, $salt); // Crypt the password $crypt_pw = crypt($password, $salt); Then, when the user tries to log on later, they enter their password, and it gets encrypted in exactly the same way. The encrypted version of the PW is then compared to the encrypted version stored in a passwords table -- if they match, then the script validates the user and prints out the user's assignment scores. However, I've noticed that if anything past the 8th character in the password is irrelevant. So, if the password was 12345678910, and the user entered 12345678, the user would be able to enter. In other words, the encrypted version of 12345678910 would be the same as the encrypted version of 12345678. I think there must be something with my crypt statement -- any advice? If you want more than 8 characters, use MD5 or some such. Unix crypt as used for passwords doesn't do more than 8 characters. MD5 passwords can do much more. Len Sorensen -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Simple PHP Script
It's the good ole' register_globals feature... You'll need to either turn register_globals on in your php.ini file or access the variables from their respective arrays ($_SERVER,$_GET,$_POST)... since your form method is post it will be: $_POST['vname']. Make sense? If you put this at the top of your page it will extract these all for you: if (!empty($_SERVER)) extract($_SERVER); if (!empty($_GET)) { extract($_GET); } else if (!empty($HTTP_GET_VARS)) { extract($HTTP_GET_VARS); } if (!empty($_POST)) { extract($_POST); } else if (!empty($HTTP_POST_VARS)) { extract($HTTP_POST_VARS); } Ryan -Original Message- From: Poon, Kelvin (Infomart) [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 2:12 PM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Simple PHP Script Hi, I am new to PHP and had just written a simple php script to get things started. I have the following code: html body ?php if($submit1) { echo hello $vname; } else { ? form action=thispage.php method=post table trtdInput yourname/tdtdinput type=text name=vname/td/tr trtd colspan=2input type=submit name=submit1/td/tr /table /form ?php } ? /body /html So this page is suppose to display a input box and a submit button and once you enter ur name and press the button, it should show Hello [ur name] and the input box at the bottom of it and the button below and the process continue. I tried running it and inputted some text and pressed the button, and the Hello [ur name] didn't show up, it just display an input box and the submit button. Can someone please help me? Thanks a lot Kelvin -- 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] Simple PHP Script
Try referring to your variables as: $_POST['submit1'] and $_POST['vname'] Then check our register_globals on php.net to find out why. I'm pretty sure that's what the problem is. -Original Message- From: Poon, Kelvin (Infomart) [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 4:12 PM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Simple PHP Script Hi, I am new to PHP and had just written a simple php script to get things started. I have the following code: html body ?php if($submit1) { echo hello $vname; } else { ? form action=thispage.php method=post table trtdInput yourname/tdtdinput type=text name=vname/td/tr trtd colspan=2input type=submit name=submit1/td/tr /table /form ?php } ? /body /html So this page is suppose to display a input box and a submit button and once you enter ur name and press the button, it should show Hello [ur name] and the input box at the bottom of it and the button below and the process continue. I tried running it and inputted some text and pressed the button, and the Hello [ur name] didn't show up, it just display an input box and the submit button. Can someone please help me? Thanks a lot Kelvin -- 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-DB] first 10 or so words
Howdy, I have a SELECT query displaying the results in repeated rows in a table. I have a COMMENTS column coming out of the database table which will likely contain a paragraph of information. I would like to display only the first 10 or so words and then have a more link that people can click on to display all the info. Is there a simple method for this?? Cheers
RE: [PHP-DB] first 10 or so words
try SUBSTRING http://www.mysql.com/doc/en/String_functions.html Peter -Original Message- From: Bruce Levick [mailto:[EMAIL PROTECTED]] Sent: 13 February 2003 22:23 To: [EMAIL PROTECTED] Subject: [PHP-DB] first 10 or so words Howdy, I have a SELECT query displaying the results in repeated rows in a table. I have a COMMENTS column coming out of the database table which will likely contain a paragraph of information. I would like to display only the first 10 or so words and then have a more link that people can click on to display all the info. Is there a simple method for this?? Cheers -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] TXT files with fixed width
I need to import a fixed width txt to a my sql database, I know how to do that with a coma separated value. any1 knows how i can do this easilly or know some software to do this? any help would be appreciated. thanx Pedro -- Pedro Oliveira [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] dump data, and save as a file
Hi everyone, I want to dump some data from mysql into a file, and use php to force the browser to pop a download file window. This seems a simple procedure, but I am having trouble to make it work with IE. The following is what I did: ob_start(); $query = SELECT * FROM table; $result=mysql_query($query); while($row=mysql_fetch_array($result)) { echo $row['data']; } header(Cache-control: private); header(Content-Type: application/txt); header(Content-Disposition: attachment; filename=test.txt); //Note: I also tried: header(Content-Disposition: inline; filename=test.txt); ob_end_flush(); * It seems OK with Netscape, but with IE, all I got is all data displayed on the screen even with ob_start(). I also tried echo the data after header(), I have the same result. I have spent a long time on this, and searched for information on www.php.net, but can not find an answer. Your help is highly appreciated. Thanks in advance. Ruth