ironstone Posted January 29, 2009 Share Posted January 29, 2009 Hi. My first post on here so sorry if this all sounds a bit daft. Have a PHP file to take the name and address details etc from a form and then e-mail to me and the customer. It then takes the customer on to PayPal for payment etc. The PHP works fine when it's hosted by GoDaddy, now I'm trying to host it with Freeparking it doesn't work. The obvious thing to me is that the PHP is fine (as it works with GoDaddy), I've put in a Support request with Freeparking but I'm sure they'll come back saying it's not them it's my PHP. Should it be different for different hosting companies? Thanks in advance for any help you cna give me. Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/ Share on other sites More sharing options...
Mchl Posted January 29, 2009 Share Posted January 29, 2009 Show us your code. Most common reason for such problems is that some script rely on enabled register_globals. The thing is, this setting is unsafe, and more and more hosting companies disable it (and good thing they do!). Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749482 Share on other sites More sharing options...
ironstone Posted January 29, 2009 Author Share Posted January 29, 2009 Hi, thanks for the reply. In don't know what that means, but here's the code. There's a lot, hope that's ok. <? echo "<font face='Tahoma'>Please wait collectmyparcel.com is processing your booking ....</font>"; $enquiry_email = "support@collectmyparcel.com"; $email = "bookings@collectmyparcel.com"; $sitename = "collectmyparcel.com"; $xheaders .= "From: collectmyparcel.com <".$enquiry_email.">\n"; $xheaders .= "X-Sender: <".$enquiry_email.">\n"; $xheaders .= "X-Mailer: PHP\n"; // mailer $xheaders .= "X-Priority: 3\n"; // Urgent message! $xheaders .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type $xheaders .= "Bcc: bookings@collectmyparcel.com , bookings@collectmyparcel.com \n"; $message='<FONT SIZE=5 FACE="ARIAL"> <p><div align="center"><img src="http://www.collectmyparcel.com/images/indexlogotop.jpg" width="558" height="93"></p> <p class="style48">Booking Form Confirmation - DHL@Home 48</p></FONT> <FONT SIZE=1 FACE="ARIAL"> <table width="929" align="center"> <tr bordercolor="#003300"> <th width="304" scope="row"><div align="left"><span class="style42">Collection Date</span></div></th> <td width="165"><div align="left"><span class="style46"> '. $_REQUEST["date"] .' </span></div></td> <td colspan="3"><span class="style47"></span></td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"></div></th> <td><span class="style47"></span></td> <td colspan="3"><span class="style47"></span></td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">E-Mail address</span></div></th> <td> <div align="left"> '. $_REQUEST["email"] .' </div></td> <td colspan="3"><span class="style47"></span><span class="style47"></span><span class="style47"></span><span class="style47"></span><span class="style47"></span><span class="style47"></span><span class="style47"></span><span class="style47"></span><span class="style47"></span></td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection Name</span></div></th> <td><div align="left"> '. $_REQUEST["coll_name"] .' </div></td> <td width="114" rowspan="8"><div align="left"><img src="http://collectmyparcel.com/images/arrow.jpg" width="93" height="60"></div></td> <td width="292"><div align="left"><span class="style47"><B>Delivery Name</B></span></div></td> <td width="150">'. $_REQUEST["1del_name"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection Company</span></div></th> <td><div align="left"> '. $_REQUEST["coll_comp"] .' </div></td> <td><div align="left"><span class="style50"><B>Delivery Company</B></span></div></td> <td>'. $_REQUEST["1del_comp"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection Address 1</span></div></th> <td><div align="left"> '. $_REQUEST["coll_add1"] .' </div></td> <td><div align="left"><span class="style50"><B>Delivery Address 1</B></span></div></td> <td>'. $_REQUEST["1del_add1"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection Address 2</span></div></th> <td><div align="left"> '. $_REQUEST["coll_add2"] .' </div></td> <td><div align="left"><span class="style50"><B>Delivery Address 2</B></span></div></td> <td>'. $_REQUEST["1del_add2"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection Town / City</span></div></th> <td><div align="left"> '. $_REQUEST["coll_town"] .' </div></td> <td><div align="left"><span class="style50"><B>Delivery Town / City</B></span></div></td> <td>'. $_REQUEST["1del_town"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection County </span></div></th> <td><div align="left"> '. $_REQUEST["coll_county"] .' </div></td> <td><div align="left"><span class="style50"><B>Delivery County</B></span></div></td> <td>'. $_REQUEST["1del_county"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection Post Code</span></div></th> <td><div align="left"> '. $_REQUEST["coll_postcode"] .' </div></td> <td><div align="left"><span class="style50"><B>Delivery Post Code</B></span></div></td> <td>'. $_REQUEST["1del_postcode"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"><span class="style42">Collection Phone No</span></div></th> <td><div align="left"> '. $_REQUEST["coll_phone"] .' </div></td> <td><div align="left"><span class="style50"><B>Delivery Phone No</B></span></div></td> <td>'. $_REQUEST["1del_phone"] .'</td> </tr> <tr bordercolor="#003300"> <th scope="row"><div align="left"></div></th> <td><div align="left"><span class="style46"> </span></div></td> <td colspan="3"> </td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td><div align="left"><span class="style47"><span class="style46"> </span></span></div></td> <td colspan="3"><span class="style47"></span></td> </tr> <tr> <th scope="row"><div align="left"></div></th> <td><div align="left"><span class="style47"></span></div></td> <td colspan="3"><span class="style47"></span></td> </tr> <tr> <th scope="row"><div align="left"><span class="style42">Parcel Weight</span></div></th> <td><div align="left"><span class="style47"> '. $_REQUEST["1parcel_weight"] .' </span></div></td> <td colspan="3"><span class="style47"></span><span class="style47"></span><span class="style47"></span><span class="style47"></span></td> </tr> <tr> <th scope="row"><div align="left"><span class="style42">Parcel Dimensions</span></div></th> <td colspan="4"><div align="left"><span class="style46"> '. $_REQUEST["1parcel_length"] .' cm x '. $_REQUEST["1parcel_height"] .' cm x '. $_REQUEST["1parcel_width"] .' cm </span></div></td> </tr> <tr> <th scope="row"><div align="left"><span class="style42">Value</span></div></th> <td><div align="left"><span class="style47"> '. $_REQUEST["1parcel_value"] .' </span></div></td> <td colspan="3"> </td> </tr> <tr> <th scope="row"><div align="left"><span class="style42">Description</span></div></th> <td><div align="left"><span class="style47"> '. $_REQUEST["1parcel_desc"] .' </span></div></td> <td colspan="3"> </td> </tr> </table></FONT>'; $mail_sent = mail($email, "Booking Form - 24-48 Hr 1-2 Day Delivery", $message, $xheaders); $mail_sent = mail($_REQUEST["email"], "Confirmation of Booking - 24-48 Hr 1-2 Day Delivery", $message, $xheaders); $counter = $_REQUEST["1"]; $price = 8.75; ?> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="form_payapl"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="paypal@collectmyparcel.com"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="return" value="http://www.collectmyparcel.com/thankyou_booking.html"> <input type="hidden" name="cancel_return" value="http://collectmyparcel.com/services.html"> <input type="hidden" name="amount" value="<? echo ($price); ?>"> <input type="hidden" name="item_name" value="DHL48 - Parcel Booking for 1 Address"> </form> <script> form_payapl.submit(); </script> Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749491 Share on other sites More sharing options...
Mchl Posted January 29, 2009 Share Posted January 29, 2009 Change <? to <?php Short tags (<? ) are deprecated, and it your new host might have them disabled as well. PS. For future reference, post your code in tags. Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749499 Share on other sites More sharing options...
ironstone Posted January 29, 2009 Author Share Posted January 29, 2009 Hi, thanks for that. I changed <? to <?php but it is still doing the same thing, it made no difference. Do I need to do it for the bottom ?> to php?> Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749509 Share on other sites More sharing options...
Mchl Posted January 29, 2009 Share Posted January 29, 2009 No, you don't. Can you say what exactly happens when you run this code? Do you get any error messages? Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749512 Share on other sites More sharing options...
ironstone Posted January 29, 2009 Author Share Posted January 29, 2009 You could just have a go yourself if you like? www.collectmyparcel.com Step 1, select top service Step 2, (don't bother entering anything) Step 3, everything goes wrong Is that ok? I do appreciate your help. Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749513 Share on other sites More sharing options...
Mchl Posted January 29, 2009 Share Posted January 29, 2009 You did not upload the file with <? changed to <?php Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749514 Share on other sites More sharing options...
ironstone Posted January 29, 2009 Author Share Posted January 29, 2009 Hi again Sorry I've done it now, it works better but the PayPal info isn't getting across now? Also, nothing is getting e-mail to me either? Sorry I don't mean to mess you about like this. Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749517 Share on other sites More sharing options...
Mchl Posted January 29, 2009 Share Posted January 29, 2009 It says 'The link you have used to enter the PayPal system contains an incorrectly formatted item amount.' I never worked with PayPal integration, but in your form there is no information about item amount? [edit] Ahh.. let's see what we have here <input type="hidden" name="amount" value="<? echo ($price); ?>"> You have to change <? here to <?php as well (and all other occurences of <? as well) Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749522 Share on other sites More sharing options...
ironstone Posted January 29, 2009 Author Share Posted January 29, 2009 You're good! Now the PayPal part works perfectly. I am impressed! Now, my new friend :-) All I seem to be missing now is getting the info sent to the customers e-mail and to my e-mail. Fingers crossed you can help me here too. Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749525 Share on other sites More sharing options...
Mchl Posted January 29, 2009 Share Posted January 29, 2009 I never toyed with sending mails from php, so I don't know much about it really. I'd suggest you mark this topic as solved and start another one with question specifically about email. Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749526 Share on other sites More sharing options...
ironstone Posted January 29, 2009 Author Share Posted January 29, 2009 Thank you so much for your help. Really, thank you. Quote Link to comment https://forums.phpfreaks.com/topic/142946-php-works-with-one-hosting-company-but-not-another/#findComment-749529 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.