machepap Posted December 19, 2008 Share Posted December 19, 2008 hello, I'm new to php, (more a designer than a coder, but I want to learn!) - I've cut and pasted php code for an email form from the original designer's code into mine. It worked fine on a previous server, but now that my client switched hosts, I'm having troubles (the . I would like to make a test version so that the emailed form goes to me rather than the client. I had it at one point but I don't remember where in the code I need to change the email address. the code in question, and more about the problem I'm having, here: http://www.phpfreaks.com/forums/index.php/topic,230712.msg1069140.html#msg1069140 any help or suggestions would be very much appreciated! thanks, Amy Quote Link to comment Share on other sites More sharing options...
redarrow Posted December 19, 2008 Share Posted December 19, 2008 Try my sig url please ...... Quote Link to comment Share on other sites More sharing options...
machepap Posted December 19, 2008 Author Share Posted December 19, 2008 Sorry, I don't know a lot about php , not sure what I should be doing with this code? Quote Link to comment Share on other sites More sharing options...
sloth456 Posted December 19, 2008 Share Posted December 19, 2008 in reserv-1.php edit $to = "cabosail@gmail.com"; put your email in. I don't understand exactly what isn't working, do you get any error messages? What happens when the script runs. Quote Link to comment Share on other sites More sharing options...
machepap Posted December 19, 2008 Author Share Posted December 19, 2008 I tried putting my email in that place, was surprised to receive nothing. (Not sure if my client was receiving the message instead.) I will try again. I receive no error message. There is no error logged on the site. According to my client, he receives blank emails. Quote Link to comment Share on other sites More sharing options...
sloth456 Posted December 19, 2008 Share Posted December 19, 2008 ok I just copied the code you've provided to my host. Ran it and it worked fine. I got the follwoing email: ============================================================== New Reservation Request sent 19 December 2008 9:43:2 ============================================================== CONTACT INFORMATION Name: Email: Phone: RESERVATION REQUEST Tour: Type: Date(s) Adults: Children: Hotel: Arrival: COMMENTS AND SPECIAL REQUESTS: ============================================================== So the email sent definately is not blank. There are however no values next to each title. But this is because I only ran the mail sending part without defining values. When you uploaded the script did you make sure that the existing file structure was the same and that /includes/generalFunctions.php and /includes/language/language.php where present? Quote Link to comment Share on other sites More sharing options...
machepap Posted December 19, 2008 Author Share Posted December 19, 2008 Since the problem arose I did add those missing files (/includes/generalFunctions.php and /includes/language/language.php), though I have not heard that it works now... Strange thing: I tried changing to my email address in the code but it doesn't work. I am going to check to make sure those links (to /includes/generalFunctions.php and /includes/language/language.php) in my test files are correct... Looking back at my client's emails to me about the issue, it appears that he is saying he receives the form in the email, as you did, but the data is missing. What next? Quote Link to comment Share on other sites More sharing options...
sloth456 Posted December 19, 2008 Share Posted December 19, 2008 Would you be willing to attach all files used to run this. That way I can upload it to my own hosting and play around with it. I would change everything so that the emails would only send to me, but you might want to warn the client and say that he may get some test mails just in case. It sounds to me like the first file isn't sending the data to the reserv-1.php Quote Link to comment Share on other sites More sharing options...
machepap Posted December 19, 2008 Author Share Posted December 19, 2008 I've attached the max number of files (four). There's one more (a javascript file, not sure if you need it) which I'll attach in a subsequent post. Thank you thank you thank you! [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
machepap Posted December 19, 2008 Author Share Posted December 19, 2008 apparently I can't attach javascript files. The code is as follows: /* * * == BEGIN LICENSE == * * Prospek Création Inc - http://www.prospek.ca * Copyright(c) 2002-2007 Prospek * * File Name: pngfix.js * * File Authors: * Prospek Création Inc (www.prospek.ca) * service@prospek.ca * * == END LICENSE == * */ /* Correctly handle PNG transparency in Win IE 5.5 & 6. http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006. Use in <HEAD> with DEFER keyword wrapped in conditional comments: <!--[if lt IE 7]> <script defer type="text/javascript" src="pngfix.js"></script> <![endif]--> */ function pngFix(){ var arVersion = navigator.appVersion.split("MSIE") var version = parseFloat(arVersion[1]) if((version >= 5.5) && (document.body.filters)){ for(var i=0; i<document.images.length; i++){ var img = document.images[i] var imgName = img.src.toUpperCase() if(imgName.substring(imgName.length-3, imgName.length) == "PNG"){ var imgID = (img.id) ? "id='" + img.id + "' " : "" var imgClass = (img.className) ? "class='" + img.className + "' " : "" var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' " var imgStyle = "display:inline-block;" + img.style.cssText if (img.align == "left") imgStyle = "float:left;" + imgStyle if (img.align == "right") imgStyle = "float:right;" + imgStyle if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" /*var strNewHTML = "<img " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + " filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\">"*/ img.outerHTML = strNewHTML i = i-1 } } } } Quote Link to comment Share on other sites More sharing options...
machepap Posted December 19, 2008 Author Share Posted December 19, 2008 Now I am seeing there is another .js file - Do you need these> Let me know if there are others you need. I will send them along. Quote Link to comment Share on other sites More sharing options...
sloth456 Posted December 19, 2008 Share Posted December 19, 2008 Wow, thats a lot of javascript code. I personally hate javascript and can't get my head around it. But you say it all worked fine of the previous host. I can only conclude that the problem is one of the following: 1) You have not kept the same file structure 2) You have not uploaded all the previous files 3) Your client doesn't have javascript enabled or something for some strange reason 4) Your new host doesn't have support for some of the commands Solution, either find someone better than me to fix your problem, move back to the old host or contact your host and see if they can help, check that they provide support for everything in the code. I personally think #1 or #2 are most likely. So just make sure you definately have everything and that is uploaded in the right place. Sorry I couldn't of been of more help to you. By the way, just a note, a lot of your form submission is reliant on javascript which users sometimes have turned off, stopping it from working, what you have is not the ideal solution. Quote Link to comment Share on other sites More sharing options...
machepap Posted December 19, 2008 Author Share Posted December 19, 2008 Thanks so much for taking a look at this. a few follow-up questions: 1) What am I missing - why doesn't it work for me to replace the email address with my own? When I copied the code of the two .php files into new files (and updated the links between them) and replaced the email address with my own, I did not receive an email at all. I put the new files in the same place on the server. 2) Can I eliminate the javascript? What is this code depending on it for? 2) Would it make sense for me to replace the existing php and javascript with something more purely php? Is this straightforward php code I can take and modify from somewhere? thanks again for all your help Quote Link to comment Share on other sites More sharing options...
sloth456 Posted December 22, 2008 Share Posted December 22, 2008 1) It works for your client but not you? Despite the server being the same? Perhaps your spam filters are blocking the mail. 2) You can't simply eliminate the javascript. It wouldn't work anymore, you'd have to replace it with something else. 3) It would make good sense to replace the javascript with a much more robust php solution. The current javascript is unreliable, as I have said before, it requires the surfer to have javascript turned on. The actual php coding to make something like this isn't massively difficult, I can't think of somewhere you could get something ready made of the top of my head though. Good luck. Quote Link to comment 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.