julieb Posted September 15, 2008 Share Posted September 15, 2008 I was just wondering how can i change this to work with my server? I have php5 on my server. thank you so much.. Julie [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/ Share on other sites More sharing options...
kenrbnsn Posted September 15, 2008 Share Posted September 15, 2008 It should work fine in PHP5. Are you having any problems? Also, for short scripts, just show the code in the message between tags. Ken Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642195 Share on other sites More sharing options...
Mchl Posted September 15, 2008 Share Posted September 15, 2008 At first glance no changes are needed. Doesn't it work as expected? Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642198 Share on other sites More sharing options...
julieb Posted September 15, 2008 Author Share Posted September 15, 2008 At first glance no changes are needed. Doesn't it work as expected? Nope... my hosting company says they have php5 and the php file is for php4....I read online somewhere that the code should not read $ it should read post something... but I dont know anything about the codes.. thank you for responding:) Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642209 Share on other sites More sharing options...
Mchl Posted September 15, 2008 Share Posted September 15, 2008 I see nothing here that wouldn't work in PHP 5. Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642214 Share on other sites More sharing options...
julieb Posted September 15, 2008 Author Share Posted September 15, 2008 hmmm... well thanks anyways. When I try to use it...down in the status bar it just keeps saying waiting on my server.. thank you anyways... Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642231 Share on other sites More sharing options...
Mchl Posted September 15, 2008 Share Posted September 15, 2008 Do you use it alone, or as a part of some bigger script. There should be at least HTML form to go with it. Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642237 Share on other sites More sharing options...
julieb Posted September 15, 2008 Author Share Posted September 15, 2008 it is actually on a template... Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642246 Share on other sites More sharing options...
Mchl Posted September 15, 2008 Share Posted September 15, 2008 Please add error_reporting(E_ALL); ini_set("display_errors","1"); at the beginning of your script (just below <?php ) and tell us if there are any errors reported Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642254 Share on other sites More sharing options...
julieb Posted September 15, 2008 Author Share Posted September 15, 2008 Okay I will try that now.... Thanks be right back... Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642256 Share on other sites More sharing options...
julieb Posted September 15, 2008 Author Share Posted September 15, 2008 I didn't see any errors.. where am I to look for them?? sorry.. Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642311 Share on other sites More sharing options...
Mchl Posted September 15, 2008 Share Posted September 15, 2008 In your browser's window when you execute the script... Strange... Let's try another thing: add this echo "message: $message"; echo "<br/>"; echo "headers: $headers"; Just above mail($sendTo, $subject, $message, $headers); This way we'll see if message and headers are set up properly Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642313 Share on other sites More sharing options...
wildteen88 Posted September 15, 2008 Share Posted September 15, 2008 How are running the script? I understand its a template but how is this script invoked? There is nothing wrong with the script you have attached. PHP5 is backwards compatible with PHP4 code. That script will not output anything as its not being told to output anything. All it does is send an email. Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642315 Share on other sites More sharing options...
julieb Posted September 15, 2008 Author Share Posted September 15, 2008 hmmm. well I put in the codes but it still is not working... Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642363 Share on other sites More sharing options...
julieb Posted September 15, 2008 Author Share Posted September 15, 2008 this is where I have it... http://webdesignz.net/rd/ph.html Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642367 Share on other sites More sharing options...
julieb Posted September 16, 2008 Author Share Posted September 16, 2008 I saw the error message on my server. This is what it said [15-Sep-2008 18:04:01] PHP Notice: Undefined index: firstName in /home/webdesi/public_html/rentacoder/rd/email.php on line 32 [15-Sep-2008 18:04:01] PHP Notice: Undefined index: lastname in /home/webdesi/public_html/rentacoder/rd/email.php on line 32 [15-Sep-2008 18:04:01] PHP Notice: Undefined index: firstName in /home/webdesi/public_html/rentacoder/rd/email.php on line 32 [15-Sep-2008 18:04:01] PHP Notice: Undefined index: lastname in /home/webdesi/public_html/rentacoder/rd/email.php on line 32 I am assuming line 32 is incorrect?? Any suggestions... thank you so much! Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642489 Share on other sites More sharing options...
discomatt Posted September 16, 2008 Share Posted September 16, 2008 add an if( isset($var['index']) ) before attempting to use the variable. Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642490 Share on other sites More sharing options...
julieb Posted September 16, 2008 Author Share Posted September 16, 2008 add an if( isset($var['index']) ) before attempting to use the variable. where do I put it... a n00b here.... Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642496 Share on other sites More sharing options...
fanfavorite Posted September 16, 2008 Share Posted September 16, 2008 Are you calling the page whatever.php or are you trying to run the script in your html page? Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642515 Share on other sites More sharing options...
fanfavorite Posted September 16, 2008 Share Posted September 16, 2008 Sorry disregard that last message, I see its email.php from your above error. The problem is that the values are not being sent. Make sure you are submitting your form as POST and that you are using the input names: firstName, lastname, email, message Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642522 Share on other sites More sharing options...
Mchl Posted September 16, 2008 Share Posted September 16, 2008 Ok. So you're using it together with a Flash (which makes it a little bit more complicated for me) Anyway, the mail.php expects to be fed with firstName lastname email message While your contact form has these fields Name Company E-Mail Phone Message They aren't exactly the same, are they? Now, it's almost sure, that your form is not sending the required information to mail.php script (or the other way round - mail.php is not prepared for working with this form). How to fix it, I've no idea, because I have no experience with Flash forms. Maybe... Maybe if you added trigger_error(print_r($_POST), E_USER_NOTICE); somewhere in your mail.php, we could see what data is actually being sent from the form. The message would appear in error logs, just where you've found information about 'undefined indexes' Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642589 Share on other sites More sharing options...
julieb Posted September 16, 2008 Author Share Posted September 16, 2008 thanks I am going to see if I get them both right it will work... Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-642609 Share on other sites More sharing options...
wildteen88 Posted September 16, 2008 Share Posted September 16, 2008 Are you wanting something to happen when the user submits the form in your contact page (other than send the email ofcourse)? Such as a confirmation message or something. If so you'll need to add more code to your flash app for this to happen. Also as you're using mail() you'll need to make sure PHP is configured to use an SMTP server in order for any emails to be sent. You should check with your host about this. Quote Link to comment https://forums.phpfreaks.com/topic/124351-php5-and-contact-form/#findComment-643046 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.