[PHP] Version of PHP and Database Type
Sorry about that. I'm using ODBC, and PHP version 4.2.0! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DNS-less Connections With PHP?
Could anybody explain to me (or even give me a link to a place explaining) the creation of DSN-less connections? I've extensivly searched Google with this, but I couldn't find anything that was of any help to me. I know how to do this in ASP, though... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Script Cannot Read File Field
I have a very nicely organized form, with a file field. The script can read all the fields, exepet for this one file field! I have no idea what is wrong. Maybe its scope? Well, anyhow, I could really use some help. The form's enctype is set to multipart/form-data, so that can't be the problem. The file field is named image, and in the script - to read the field - I use $_FILES['image']. Everything seems fine to me. My script is rather large. The HTML was generated by Dreamweaver, so its large, and messy. The script is below, tell me if I have to include the HTML in my post too... = ?php if (isset($_POST['form_post'])) { verify(); } else { exit; } function verify() { $name = $_POST['name']; $reviewer = $_POST['reviewer']; $summery = $_POST['summery']; $review = $_POST['review']; if (!$name or !$reviewer or !$summery or !$review) { if (!$name) { echo p class=\required\Error: bTitle of Show/b field is empty/p; } if (!$reviewer) { echo p class=\required\Error: bYour Name/b field is empty/p; } if (!$summery) { echo p class=\required\Error: bSummery of Review/b field is empty/p; } if (!$review) { echo p class=\required\Error: bTelevision Review/b field is empty/p; } exit (pPlease correct the above errors before reposting the review/p); } else { insert(); } } function insert() { $title = $_POST['title']; $name = $_POST['name']; $reviewer = $_POST['reviewer']; $summery = $_POST['summery']; $review = $_POST['review']; $day = $_POST['day']; $time = $_POST['time']; $channel = $_POST['channel']; $image = $_FILES['image']; if (!$_FILES['image'] == none) { if(!is_dir(../../../../images/)) { echo Directory does not exist, creating...br\n; mkdir(../../../../images); } if (copy($_FILES['image']['tmp_name'], ../../../../images/ . $_FILES['image']['name'])) { echo img src=\../../../../images/.$_FILES['image']['name'].\/img; } $filename = $_FILES['image']['name']; $filepath = ../../../../images/.$filename; // this will be put in the database. } // Replace any apostrophies found in the variables with double ('') apostrophies. $title = ereg_replace(', '', $title); $name = ereg_replace(', '', $name); $reviewer = ereg_replace(', '', $reviewer); $summery = ereg_replace(', '', $summery); $review = ereg_replace(', '', $review); $day = ereg_replace(', '', $day); $time = ereg_replace(', '', $time); $channel = ereg_replace(', '', $channel); $filepath = ereg_replace(', '', $filepath); $SQLQuery = INSERT INTO tblTelevision(fldTitle, fldName, fldReviewer, fldDate, fldSummery, fldReview, fldDay, fldTime, fldChannel, fldPoster) VALUES('$title', '$name', '$reviewer', NOW(), '$summery', '$review', '$day', '$time', '$channel', '$filepath'); $db = odbc_connect('ReviewDatabase', 'root', ''); $cursor = odbc_exec($db, $SQLQuery); echo pReview posted successfully!/p; odbc_close($db); } ? = I appreciat any help given. _ Sinceriously Cheerious, Dr. Shim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Alternate To Making Form Variables Global
Is there another way then to register form variables global? I just downloaded, and instlaled the newest version of PHP, and now my form script doesn't work anymore. I had to register the form variables global in the script. I'm asking, is there a better way of doing this? I've herd it can lead to possible security hazards. Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Alternate To Making Form Variables Global (Clerified)
Sorry, I'll have to clerify myself a bit. I'm rather tired. :) I have a script that verifys and inserts (into and Access databse) form values. I had to make the form variables global, in order to use them in my functions. Since the new PHP is out, the script doesn't work anymore. I think its probably because of the fact that I had to make those variables global (none of the variables are being read). Does any of you have an idea about how I can fix this problem? Thanks in advance. Dr. Shim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there another way then to register form variables global? I just downloaded, and instlaled the newest version of PHP, and now my form script doesn't work anymore. I had to register the form variables global in the script. I'm asking, is there a better way of doing this? I've herd it can lead to possible security hazards. Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Alternate To Making Form Variables Global (Clerified)
Thank you so much Austin, and Julio! Your replies are an amazing help to me. Thanks! Maybe I'll even get this project I'm working on done this week. =) Anyhoo, Julio, you mean that option in the PHP.INI, is it register_globals? Well, anyhow, I'm going to convert my script, as you put it. Again, thanks for your help, I'm going to definatly look up the extract() function, Austin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Streaming RealPlayer Content From an Access Database (not sending correct headers?)
I've almost got this working, expect that I'm not sending the correct Content-type header to the RealPlayer player. I've followed a tutorial from the O'Reilly network ( http://www.onlamp.com/pub/a/php/2000/09/15/php_mysql.html?page=1 ), and modified it for an Access database, and RealPlayer content. I click on a hyperlink in the table, thus initilizing the download script. RealPlayer opens up, then says it can't identify what I'm trying to play and will try and find a plugin for it, then the search for the plugin fails. The current content type header reads header(Content-type: application/vnd.rn-realmedia); Does anybody have any clue what type RealPlayer might identify? Here's my code for the download script. = if ($id) { include talks.php.inc;// This is the include file, I just named it differently from the tutorial $sql = SELECT * FROM tblTalks WHERE TalksID=$id; $cursor = odbc_exec($db_talks, $sql); $data = odbc_result($cursor, fldBinData); $name = odbc_result($cursor, fldFileName); $title = odbc_result($cursor, fldTitle); $summery = odbc_result($cursor, fldSummery); header(Content-type: application/vnd.rn-realmedia); header(Content-Disposition: stream; filename=$name); header(Content-Description: Speeches from Barry); echo $data; } Here is the source for the include file /* talks.php.inc */ /* Note that I left out the or die parts out (in the $db_talks and $sql), they were very long, and would make the code unreadable here */ $db_talks = odbc_connect(TalksDatabase, root, ''); function make_query($query) { global $db_talks; $sql = odbc_exec($db_talks, $query); return $sql; } Thanks for any help you peeps can give me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query
I'm using ODBC (Access). But I can execute the SQL manually in Access too. I did, here's my query: SELECT * FROM fldField WHERE IDField = 3; I have to actually put in a value for IDField, it doesn't recognize my variable, of coarse. This works just fine. Rick Emery [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Jason means that you should execute it from the mysql command line; In your PHP code: print $sql. Then copy from that window and paste into mysql command line and execute. What are the results? -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Monday, April 01, 2002 10:48 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query Hmm, run it manually? I'm a newbie, so, could you explain how I'd do that? =) Jason Murray [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'd say $id is blank, not being passed in, or is equal to a nonexistant IDArt. Maybe you should echo out your SQL and run it manually to see what's going on. J -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT Work now, freak later! -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 2:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query I have a variable which is appeneded to the end of a URL, like http://www.your_web_site.com/your_page/?your_variable=your_value This would return your_value; echo $your_variable; But this wouldn't work, and returns an error $sql = SELECT * FROM fldField WHERE IDField = . $id; What could possibly be wrong? If you need more info, then tell me. Here's my code: ?php $db = @odbc_connect('ReviewDatabase', 'root', '') or exit)(Error occured:br$php_errormsg); $sql = SELECT * FROM tblArt WHERE IDArt = $id; $cursor = @odbc_exec($db, $sql) or exit (Error occrued:br$php_errormsg); odbc_close($db); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable Appended To The End of a URL Is Not Working in SQL Query
I have a variable which is appeneded to the end of a URL, like http://www.your_web_site.com/your_page/?your_variable=your_value This would return your_value; echo $your_variable; But this wouldn't work, and returns an error $sql = SELECT * FROM fldField WHERE IDField = . $id; What could possibly be wrong? If you need more info, then tell me. Here's my code: ?php $db = odbc_connect('ReviewDatabase', 'root', '') or exit)(Error occured:br$php_errormsg); $sql = SELECT * FROM tblArt WHERE IDArt = $id; $cursor = odbc_exec($db, $sql) or exit (Error occrued:br$php_errormsg); odbc_close($db); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query
Hmm, run it manually? I'm a newbie, so, could you explain how I'd do that? =) Jason Murray [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'd say $id is blank, not being passed in, or is equal to a nonexistant IDArt. Maybe you should echo out your SQL and run it manually to see what's going on. J -- Jason Murray [EMAIL PROTECTED] Web Developer, Melbourne IT Work now, freak later! -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 02, 2002 2:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query I have a variable which is appeneded to the end of a URL, like http://www.your_web_site.com/your_page/?your_variable=your_value This would return your_value; echo $your_variable; But this wouldn't work, and returns an error $sql = SELECT * FROM fldField WHERE IDField = . $id; What could possibly be wrong? If you need more info, then tell me. Here's my code: ?php $db = @odbc_connect('ReviewDatabase', 'root', '') or exit)(Error occured:br$php_errormsg); $sql = SELECT * FROM tblArt WHERE IDArt = $id; $cursor = @odbc_exec($db, $sql) or exit (Error occrued:br$php_errormsg); odbc_close($db); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query
The your_variable thing was just an example. It actually uses $id (an a real URL). Tyler Longren [EMAIL PROTECTED] wrote in message 003001c1da02$f46e65b0$0101a8c0@nightengale">news:003001c1da02$f46e65b0$0101a8c0@nightengale... Well, there's not $id variable. And you're trying to select it. Should be this: ?php $db = @odbc_connect('ReviewDatabase', 'root', '') or exit)(Error occured:br$php_errormsg); // next line has changed $sql = SELECT * FROM tblArt WHERE IDArt = $your_variable; $cursor = @odbc_exec($db, $sql) or exit (Error occrued:br$php_errormsg); odbc_close($db); ? Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com - Original Message - From: Dr. Shim [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 01, 2002 10:41 PM Subject: [PHP] Variable Appended To The End of a URL Is Not Working in SQL Query I have a variable which is appeneded to the end of a URL, like http://www.your_web_site.com/your_page/?your_variable=your_value This would return your_value; echo $your_variable; But this wouldn't work, and returns an error $sql = SELECT * FROM fldField WHERE IDField = . $id; What could possibly be wrong? If you need more info, then tell me. Here's my code: ?php $db = @odbc_connect('ReviewDatabase', 'root', '') or exit)(Error occured:br$php_errormsg); $sql = SELECT * FROM tblArt WHERE IDArt = $id; $cursor = @odbc_exec($db, $sql) or exit (Error occrued:br$php_errormsg); odbc_close($db); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function Not Accepting Variable Values From a Form
Alas, more problems with forms =) Well now, here is my problem. I have a form, method is set to post, and action is set to the same page. I also have a hidden field named form_post and it's value is 1. Underneath this form is my PHP script. ?php if (isset($form_post)) { echo Function \isset\ called. Values are...br\n Title: $titlebr\n Author: $authorbr\n Lead Actors: $actorsbr\n Poster: $posterbr\n Summ.: $summerybrbr\n\n Rev.: $reviewbrbr\n\n; verify();// Function call to verify } else { exit; }// Since form_post is set, it proceeds to verify. Strangley enough, all the values appear in this if block. function verify() { echo Verify called. Values are...br\n Title: $titlebr\n Author: $authorbr\n Lead Actors: $actorsbr\n Poster: $posterbr\n Summ.: $summerybrbr\n\n Rev.: $reviewbrbr\n\n; } In the function verify no values appear, just: Title: Author: Lead Actors: Poster: Summ.: Rev.: Although -- as the comment said -- the if block shows all the values just fine. What could possibly be wrong? The solution to my last problem was to get rid of any functions. However, that results in highly messy code! There has got to be a way of having values passed to a function. Thanks for any help/suggestions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Function Not Accepting Variable Values From a Form
I will try $_POST[] first. I do that under the value parameter for each form element? input type=text name=author value=?php $_POST['author'] ? Right? -- Julio Nobrega Trabalhando [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Scope. Try to pass the values as the function reference (inside the ()), 'global' them, or use $_POST[''], from 4.1 and beyond. If you don't know what's a 'scope', there's an entry on the manual that can explain better. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Dr. Shim [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Alas, more problems with forms =) Well now, here is my problem. I have a form, method is set to post, and action is set to the same page. I also have a hidden field named form_post and it's value is 1. Underneath this form is my PHP script. ?php if (isset($form_post)) { echo Function \isset\ called. Values are...br\n Title: $titlebr\n Author: $authorbr\n Lead Actors: $actorsbr\n Poster: $posterbr\n Summ.: $summerybrbr\n\n Rev.: $reviewbrbr\n\n; verify();// Function call to verify } else { exit; }// Since form_post is set, it proceeds to verify. Strangley enough, all the values appear in this if block. function verify() { echo Verify called. Values are...br\n Title: $titlebr\n Author: $authorbr\n Lead Actors: $actorsbr\n Poster: $posterbr\n Summ.: $summerybrbr\n\n Rev.: $reviewbrbr\n\n; } In the function verify no values appear, just: Title: Author: Lead Actors: Poster: Summ.: Rev.: Although -- as the comment said -- the if block shows all the values just fine. What could possibly be wrong? The solution to my last problem was to get rid of any functions. However, that results in highly messy code! There has got to be a way of having values passed to a function. Thanks for any help/suggestions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Function Not Accepting Variable Values From a Form
function verify() { echo Verify called. Values are...br\n Title: . $_POST['title'] . br\n# This works! Author: $authorbr\n Lead Actors: $actorsbr\n Poster: $posterbr\n Summ.: $summerybrbr\n\n Rev.: $reviewbrbr\n\n; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Again, and Again, and AGAIN!
That's fine. I already got it going (somebody helped me). Thanks for that tip anyhow. Mike Gohlke [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you hitting enter while in one of the fields or clicking the submit button. I've seen versions of IE that would not set the submit button if enter was used. Personally, I would check for isset($username) isset($password). Mike... (Sorry for the very late reply, etc. I've been dealing with a screwy server for the past few days:( Jason Wong wrote: On Sunday 17 March 2002 13:14, Jason Wong wrote: You're using 4.1.1, $HTTP_POST_VARS{} has been replaced by $_POST[] (see changelog/history/php.ini for details). Sorry a typo: $HTTP_POST_VARS[] has been replaced by $_POST[] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Escaping Quotes in a String and Ending With A Quote
Well, this is a fairly simple problem. I'm having problems with escaping a string, and then ending the string right after the escape! For example, echo Then Johnathan said, \That's exactly what I said!\; I get a parse error on the line where the string is. Very simple problem, I just can't seem to solve it though. Maybe I'm going crazy =) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Escaping Quotes in a String and Ending With A Quote
Hmmm. How about this? echo form name=\frmMovies\ method=\post\ action=\ . echo $PHP_SELF . \; Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tue, 19 Mar 2002, Dr. Shim wrote: Well, this is a fairly simple problem. I'm having problems with escaping a string, and then ending the string right after the escape! For example, echo Then Johnathan said, \That's exactly what I said!\; I get a parse error on the line where the string is. Very simple problem, I just can't seem to solve it though. Maybe I'm going crazy =) There's nothing wrong with that PHP code. Are you sure you really copied and pasted it directly from the problem code - or that the parse error isn't somewhere else? miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Escaping Quotes in a String and Ending With A Quote
Strangley enough, $PHP_SELF is empty. Nothing appears when I do it the way Bob and you suggested, the action property equals . Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tue, 19 Mar 2002, Dr. Shim wrote: Hmmm. How about this? echo form name=\frmMovies\ method=\post\ action=\ . echo $PHP_SELF . \; You're concatenating echo $PHP_SELF rather than just $PHP_SELF, which isn't necessarily helping. But just between me and you, life would be a lot easier if you simply did: echo 'form name=frmMovies method=post action=' . $PHP_SELF . ''; miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Escaping Quotes in a String and Ending With A Quote
*screams, I'm such a newbie!!* I didn't know I had to declare $PHP_SELF with global before using it inside a function. Sorry! Works now! Thanks very much! =) Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you inside a function, having neglected to do global $PHP_SELF; ? miguel On Tue, 19 Mar 2002, Dr. Shim wrote: Strangley enough, $PHP_SELF is empty. Nothing appears when I do it the way Bob and you suggested, the action property equals . Miguel Cruz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Tue, 19 Mar 2002, Dr. Shim wrote: Hmmm. How about this? echo form name=\frmMovies\ method=\post\ action=\ . echo $PHP_SELF . \; You're concatenating echo $PHP_SELF rather than just $PHP_SELF, which isn't necessarily helping. But just between me and you, life would be a lot easier if you simply did: echo 'form name=frmMovies method=post action=' . $PHP_SELF . ''; miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help Out A Newbie In Configuring PHP.INI
Well, I was stupid posting this question anyway. Don't worry about my problem. I have it fixed. =) Again, I will be more careful not to repeat posts (or post things I can find the answer for somewhere else). ---Original Message--- Well, aroung 14 Feb I ended up saying this to an address that might or might not be yours :-): -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Again, and Again, and AGAIN!
I've tried repediately to have a PHP script validate a form when the form is submitted. I'm quite new to PHP, and I'd really appreciate the help anybody could give me. I've been stuck on this problem far to long. I have a form (here's the code): form method=post action=?php $PHP_SELF; ? Username: input type=text name=username maxlength=255 value=? $HTTP_POST_VARS['username']; ? br Password: input type=text name=password maxlength=8 value=? $HTTP_POST_VARS['password']; ? br input type=submit name=login value=Log In onclick=document.refresh() br br /form And right underneath the form code, I have my PHP script: ?php if (isset($login)) { insert(); } function insert() { $db = odbc_connect('mydatabase', 'myusername', 'mypassword'); if(!$db) { echo An error has occured. Please a href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to me.brbr~~~br$PHP_ERRORbr$dbbr~~~; } $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username' AND fldPassword = '$password'; $cursor = odbc_exec($db, $SQLQuery); if (!$cursor) { echo An error has occured. Please a href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to me.brbrbr . odbc_errormsg($db) . br~~~; } } ? What I'm trying to achieve here is that when the user fills out the form, presses the Log In button, the script underneath validates and inserts the data into a database. Now, I click on the Log In button, nothing happens. Could anybody please help me with this? I would really, really appreciat any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Again, and Again, and AGAIN!
I've changed form method=post action=?php $PHP_SELF; ? To form method=post action=?php =$PHP_SELF; ? And I get a parse error. Could you possibly help me correct this? (I'm a newbie, so have pity on me. =) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Again, and Again, and AGAIN!
Sorry about the subject heading. I've put in form method=post action=?php echo $PHP_SELF; ? But still when I click on the Log In button, thing happens. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Again, and Again, and AGAIN!
Oh, by the way, the if...then claus runs successfully, but the function never is called. Am I wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Again, and Again, and AGAIN!
I'm using PHP 4.1.1 (for Windows). Here is *all* of my code. html head titleAdministrative Log-In Page/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FF Please enter your username and password below in the fields below. form method=post action=?php echo $PHP_SELF; ? Username: input type=text name=username maxlength=255 value=?php echo $HTTP_POST_VARS['username']; ? br Password: input type=text name=password maxlength=8 value=? echo $HTTP_POST_VARS['password']; ? br input type=submit name=login value=Log In br br /form ?php if (isset($login)) { insert(); echo $login; } function insert() { $db = odbc_connect('IdentDatabase', 'root', ''); if(!$db) { echo An error has occured. Please a href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to me.brbr~~~br$PHP_ERRORbr$dbbr~~~; } $SQLQuery = SELECT fldID FROM tblUsers WHERE fldUsername = '$username' AND fldPassword = '$password'; $cursor = odbc_exec($db, $SQLQuery); if (!$cursor) { echo An error has occured. Please a href=\mailto:[EMAIL PROTECTED]\;e-mail/a the text below to me.brbrbr . odbc_errormsg($db) . br~~~; } } ? /body /html Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... On Sunday 17 March 2002 12:04, Dr. Shim wrote: Sorry about the subject heading. I've put in form method=post action=?php echo $PHP_SELF; ? But still when I click on the Log In button, thing happens. Please post the rest of your code and also which version of PHP you're using. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Your lover will never wish to leave you. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help Out A Newbie In Configuring PHP.INI
Uh oh, did I ask this question before? If I did, I'm very sorry. =( David Robley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Note that I'm using the Windows version of PHP. Whenever I use a mail() function in my PHP code I get an error of Failed to Connect on line number. So, I'm guessing my error lies in the PHP configuration file. I searched around the PHP.INI file for anything resembililing mail. I found these two lines: [mail function] ; For Win32 only. SMTP = alienmelon.com ; For Win32 only. sendmail_from = [EMAIL PROTECTED] I filled them out also, as you see above. Did I fill them out correctly? Even though I filled them out as you see above I still get the same error. Is the root of the error in the .ini at all? I have feeling of deja vu here. Is alienmelon.com a valid mail server? If not, you need to change it to something that is. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can Event Handlers Trigger PHP Code?
My question is can event handlers on form objects trigger PHP code? input type=submit name=submit value=Submit Form onclick='PHP CODE HERE' Or even an onsubmit event handler on forms? If something like this is possible, could any of you tell me how? I've tried, and tried. I've used PHP tags inside the event handler input type=submit name=submit value=Submit Form onclick='? PHP CODE HERE ?' But the result is that the event handler is blank input type=submit name=submit value=Submit Form onclick='' since the interpreter hides any PHP code. Thus nothing happens on the event. Any help is appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help Out A Newbie In Configuring PHP.INI
Note that I'm using the Windows version of PHP. Whenever I use a mail() function in my PHP code I get an error of Failed to Connect on line number. So, I'm guessing my error lies in the PHP configuration file. I searched around the PHP.INI file for anything resembililing mail. I found these two lines: [mail function] ; For Win32 only. SMTP = alienmelon.com ; For Win32 only. sendmail_from = [EMAIL PROTECTED] I filled them out also, as you see above. Did I fill them out correctly? Even though I filled them out as you see above I still get the same error. Is the root of the error in the .ini at all? Thanks for any help ahead of time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A Small Bug Giving Me A Big Headache
Nope, all my values are strings. Markas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); As the manual says: Note: Unlike the two other syntaxes, variables will not be expanded when they occur in single quoted strings. ... So maybe some your fiels requires a numeric value, but because no extraction occurs, it receives string? Dr. Shim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I did, and a rather informative error message came. I didn't know how to debug like that. Sorry, I'm rather new to this. It says [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Well, add this and tell us what it says: if(!$cursor) echo odbc_error($db).: .odbc_errormsg($db); right after that odbc_exec() call. *always check for errors - and when you get one, show it!* -Rasmus On Sat, 2 Mar 2002, Dr. Shim wrote: I've tried, and tried. Reread, and reread. I can't at all find out what's wrong with these two lines of code. $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); $cursor = odbc_exec($db, $SQLString); I have an if...then conditional statement causing echo to print out an error message if the $cursor returns false. The $cursor keeps returning false. I don't know why! My $db variable (which plugs into the odbc database) is fine. Those two lines have got to be the problem. Can you people help me out with this? If I have to give you my whole script (not very long) I will. Thanks for any help you can give me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A Small Bug Giving Me A Big Headache
Matt Schroebel suggested I echo $SQLString; The echo statement returned INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES (, , , , ,) So, clearly, the error lies in the form that passes the values to this script. Thanks Matt, we're getting closer. Dr. Shim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Nope, all my values are strings. Markas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); As the manual says: Note: Unlike the two other syntaxes, variables will not be expanded when they occur in single quoted strings. ... So maybe some your fiels requires a numeric value, but because no extraction occurs, it receives string? Dr. Shim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I did, and a rather informative error message came. I didn't know how to debug like that. Sorry, I'm rather new to this. It says [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Well, add this and tell us what it says: if(!$cursor) echo odbc_error($db).: .odbc_errormsg($db); right after that odbc_exec() call. *always check for errors - and when you get one, show it!* -Rasmus On Sat, 2 Mar 2002, Dr. Shim wrote: I've tried, and tried. Reread, and reread. I can't at all find out what's wrong with these two lines of code. $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); $cursor = odbc_exec($db, $SQLString); I have an if...then conditional statement causing echo to print out an error message if the $cursor returns false. The $cursor keeps returning false. I don't know why! My $db variable (which plugs into the odbc database) is fine. Those two lines have got to be the problem. Can you people help me out with this? If I have to give you my whole script (not very long) I will. Thanks for any help you can give me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A Small Bug Giving Me A Big Headache
OK. Is Short a keyword? The Short part in INERT INTO Movies (Title, Actors, Review, Reviewer, Short) is giving me the Syntax Error message. I will rename my tables with a mv suffix. Lets see if that solves the problem. Dr. Shim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Matt Schroebel suggested I echo $SQLString; The echo statement returned INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES (, , , , ,) So, clearly, the error lies in the form that passes the values to this script. Thanks Matt, we're getting closer. Dr. Shim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Nope, all my values are strings. Markas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); As the manual says: Note: Unlike the two other syntaxes, variables will not be expanded when they occur in single quoted strings. ... So maybe some your fiels requires a numeric value, but because no extraction occurs, it receives string? Dr. Shim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; I did, and a rather informative error message came. I didn't know how to debug like that. Sorry, I'm rather new to this. It says [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Well, add this and tell us what it says: if(!$cursor) echo odbc_error($db).: .odbc_errormsg($db); right after that odbc_exec() call. *always check for errors - and when you get one, show it!* -Rasmus On Sat, 2 Mar 2002, Dr. Shim wrote: I've tried, and tried. Reread, and reread. I can't at all find out what's wrong with these two lines of code. $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); $cursor = odbc_exec($db, $SQLString); I have an if...then conditional statement causing echo to print out an error message if the $cursor returns false. The $cursor keeps returning false. I don't know why! My $db variable (which plugs into the odbc database) is fine. Those two lines have got to be the problem. Can you people help me out with this? If I have to give you my whole script (not very long) I will. Thanks for any help you can give me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A Small Bug Giving Me A Big Headache
I've tried, and tried Reread, and reread I can't at all find out what's wrong with these two lines of code $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); $cursor = odbc_exec($db, $SQLString); I have an ifthen conditional statement causing echo to print out an error message if the $cursor returns false The $cursor keeps returning false I don't know why! My $db variable (which plugs into the odbc database) is fine Those two lines have got to be the problem Can you people help me out with this? If I have to give you my whole script (not very long) I will Thanks for any help you can give me -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP] A Small Bug Giving Me A Big Headache
I did, and a rather informative error message came. I didn't know how to debug like that. Sorry, I'm rather new to this. It says [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. Rasmus Lerdorf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]; Well, add this and tell us what it says: if(!$cursor) echo odbc_error($db).: .odbc_errormsg($db); right after that odbc_exec() call. *always check for errors - and when you get one, show it!* -Rasmus On Sat, 2 Mar 2002, Dr. Shim wrote: I've tried, and tried. Reread, and reread. I can't at all find out what's wrong with these two lines of code. $SQLString = INSERT INTO Movies (Title, Actors, Review, Reviewer, Short) VALUES ('$Title','$Actors','$Review','$Reviewer','$Short'); $cursor = odbc_exec($db, $SQLString); I have an if...then conditional statement causing echo to print out an error message if the $cursor returns false. The $cursor keeps returning false. I don't know why! My $db variable (which plugs into the odbc database) is fine. Those two lines have got to be the problem. Can you people help me out with this? If I have to give you my whole script (not very long) I will. Thanks for any help you can give me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Troubles With Mail Function
Yes it is. Gary helped me find it. :) Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I think the SMTP would be same as you use for your email client (outlook, eudora, other?) -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 11:33 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Troubles With Mail Function Alright, I will show you my entire mail code here. BTW: I cannot mail using mail() function [mail function] ; For Win32 only. SMTP = mindspring.com ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path = I'm using Windows XP at the moment to develop. I'm not quite sure what I'd put under SMTP...is there any tutorials online that would show me how to configure this right? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Troubles With Mail Function
Actually, I don't really know what to put in it. I thought that's what it wanted. What does it want? David Robley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Well, I did this: [mail function] SMTP=mindspring.com sendmail_form=[EMAIL PROTECTED] ...rest I left unchanged... Still doesn't work. :( BTW I'm using Windows at the moment to develop. That SMTP value looks a bit suspicious?? Are you sure that is correct? -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Troubles With Mail Function
Alright, I will show you my entire mail code here. BTW: I cannot mail using mail() function [mail function] ; For Win32 only. SMTP = mindspring.com ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path = I'm using Windows XP at the moment to develop. I'm not quite sure what I'd put under SMTP...is there any tutorials online that would show me how to configure this right? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Troubles With Mail Function
Well I tried what Gary suggested. I did smtp.mindspring.com and it worked beutifully. I feel stupid that the problem was so simple. But, alas, I'm learing. Thanks all you. Robley, that is some very informative information, this digging. dig -t mx alienmelon.com in console right? David Robley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Alright, I will show you my entire mail code here. BTW: I cannot mail using mail() function [mail function] ; For Win32 only. SMTP = mindspring.com ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path = I'm using Windows XP at the moment to develop. I'm not quite sure what I'd put under SMTP...is there any tutorials online that would show me how to configure this right? In addition to my previous message - OK, I've gone and put the necessary software on the linux side of this thing and asked the appropriate questions - if I do a 'dig' on alienmelon i find: ; DiG 9.1.2 -t mx alienmelon.com ;; global options: printcmd ;; Got answer: ;; -HEADER- opcode: QUERY, status: NOERROR, id: 43766 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3 ;; QUESTION SECTION: ;alienmelon.com. IN MX ;; ANSWER SECTION: alienmelon.com. 28739 IN MX 10 mail.alienmelon.com. ;; AUTHORITY SECTION: alienmelon.com. 163967 IN NS NS.HOST4U.NET. alienmelon.com. 163967 IN NS NS2.HOST4U.NET. ;; ADDITIONAL SECTION: mail.alienmelon.com. 28739 IN A 64.33.108.112 NS.HOST4U.NET. 170095 IN A 209.150.128.30 NS2.HOST4U.NET. 3201 IN A 209.150.129.3 ;; Query time: 154 msec ;; SERVER: 203.96.152.4#53(203.96.152.4) ;; WHEN: Thu Feb 14 16:07:51 2002 ;; MSG SIZE rcvd: 146 which implies that alienemelon uses mail.alienmelon.com to handle its mail. So a ping to that to see if it exists gives us C:\WINDOWSping mail.alienmelon.com Pinging mail.alienmelon.com [64.33.108.112] with 32 bytes of data: Reply from 64.33.108.112: bytes=32 time=329ms TTL=239 Reply from 64.33.108.112: bytes=32 time=325ms TTL=239 Reply from 64.33.108.112: bytes=32 time=315ms TTL=239 Reply from 64.33.108.112: bytes=32 time=315ms TTL=239 Ping statistics for 64.33.108.112: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 315ms, Maximum = 329ms, Average = 321ms C:\WINDOWS so it seems to exist. I suggest you try mail.alienmelon.com as the SMTP entry in your config and see what happens. -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Troubles With Mail Function
Hello. I'm pretty new to PHP, so if this is a dumb question, or has been answered already, I'd like to get a link to that answer, or an alternative on how I can solve the problem. :) Anyhow, I have a very simple one line script. ? mail([EMAIL PROTECTED], ::Urgent Message::, $body); ? A form is filled out and thus the $body variable contains the body of the message. I get this error: Warning: Unknown error in c:\program files\apache group\apache\htdocs\email.php on line 2 I have no idea what the problem could be. Could anybody help me? Dr. Shim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Troubles With Mail Function
No I haven't. How do I do that Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Have you set up the [mail function] section of your php.ini file ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Troubles With Mail Function
Well, I did this: [mail function] SMTP=mindspring.com sendmail_form=[EMAIL PROTECTED] ...rest I left unchanged... Still doesn't work. :( BTW I'm using Windows at the moment to develop. -Original Message- Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... this is what I've got for that section: [mail function] SMTP = localhost ;for win32 only sendmail_from = [EMAIL PROTECTED] ;for win32 only sendmail_path = /usr/sbin/sendmail -t -i ;for unix only, may supply arguments as well (default is 'sendmail -t -i') if your problem is caused by anything else, then I can't help you there, maybe someone??? HTH (hope this helps) Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DreamWeaver/PHP ability?
http://www.geocities.com/php4ud/ Seach google for php4ud God bless google! Matt Williams [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Luke Crouch wrote: I know Dreamweaver UltraDev has nice site management features for using a JSP/SQL type serverdoes it have similar capabilities with PHP/MySQL? Does anyone know? -L Search the archives on this one. There is a project called php4ud or something like that but I can't remember the url. I've never used it so I couldn't comment m: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DreamWeaver/PHP ability?
Would this happen to be the one? http://www.interakt.ro If it is, then the extension can be found here: http://www.interakt.ro/products/PHAkt/index.php This place also has several othe extensions: http://www.udzone.com/index.asp?TypeId=3CatId=68 Found these links using Google. God bless Google! =) Original Message- Gary [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I did try an extension with it once with terrible results. I do not know if it is the same one. The extension would take all the includes and make them the same name, not every time but often enough to scrap it. I don't use Dreamweaver much anyway, Homesite with server mapping enabled works ust fine. Gary Edward R. Bailey wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Actually Ultradev does support PHP if you buy a php application server extension. A company in Romania (The name escapes me) makes the extension and I have heard it works very well. I am sure somebody can find the name of the company by searching for PHP Ultradev extension. Just my two cents, Ed -Original Message- From: Gary [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 7:15 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: DreamWeaver/PHP ability? There is no PHP support in Dreamweaver UltraDev. Gary Luke Crouch wrote: I know Dreamweaver UltraDev has nice site management features for using a JSP/SQL type serverdoes it have similar capabilities with PHP/MySQL? Does anyone know? -L -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBPGMzjd/a5giN7qTnEQJQZQCffLQzy7ZQMQccQdcsjYv3Ha/L5m4AoJL3 JuORBJVQ7el//bdKgUWesnoH =rB4g -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php