Jump to content

testing email form - need help redirecting email


machepap

Recommended Posts

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

 

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
		}
	}
}
}



Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.