Webmaster Key - Discussion Forums


Welcome, Guest. Please login or register.
Did you miss your activation email?
February 09, 2012, 09:50:52 AM

Login with username, password and session length
Welceome to Forums!

Important information for guests and new members:

In order to understand the full benefits of becoming an active member of this forum, please review the following information on guest and new member restrictions. These forum changes have been prompted by an overwhelming and unreasonable amount of bot postings and incoherent guest spam messages. We wish to prevent these events from happening in the future and make our community a more comfortable place for all of our members.

For guests:

Guests are not allowed to open new topics, polls, or posts attachments.
If you wish to open up new discussions on this forum, we encourage you to register.

For new members:

New members with less than five posts are not allowed to modify additional profile information such as avatars, contact information, biographies, and signatures. However, new members are encouraged to post their own topics or reply to topics initiated by other members. Become active on the forums and 5 posts should be an easy task!

We are a diverse community with members from all over the world. We encourage new ideas and interesting conversation. Do not be afraid to post webmaster/computer-related questions or problems, as our active members are always willing to help when they are able. Interested? Join us.

+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ Coding Talk
| | | |-+ Need quick help with formmail.php - not working
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print
Author Topic: Need quick help with formmail.php - not working  (Read 3447 times)
Shaken
Novice
*
Posts: 10


Ballarat Website Design


WWW
« on: December 23, 2006, 03:27:06 AM »

Hi guys,

I need to get a fast resolution on this so any help is greatly appreciated.

I've been trying to get a clients formmail working but i'm having problems...

I'm no php wiz, but I got it working on my site fine a while back, and i've just replicated what was needed on the clients site (changing the relevant info of course), but I still can't get it to operate...

It simply consists of the formail.php, the contact.htm and confirmation.htm pages.

Now the only code that needs changing (from what I use on my site) is the following - subbing in the actual domain info for the client. The rest of the php file I haven't touched, so i'm assuming it's ok as it works fine on my own site.

Code:
$recipient = "info@clientsdomain.com.au";

// if the redirect option is set: redirect them

$redirect = "http://www.clientsdomain.com.au/confirmation.htm";

// referers.. domains/ips that you will allow forms to reside on.

$referers = array('clientsdomain.com.au');

When you fill out the contact form and click on 'submit' it just loads to the formail.php file in the next window (shows up blank etc), not the confirmation.htm file that it should. It doesn't bring up any errors at all.

Why is it not working for this site?

They are on the exact same host as I am and I have done the exact same process with them as I did with myself to get it to work for me. Mail is working fine by itself - i sent a test email from my account to theirs and then replied back...that's all working fine. It's the php side of things that is the issue, and I have no idea how to go about fixing it...

Any help would be appreciated...
Report to moderator   Logged

SensoVision
Administrator
Veteran
*****
Posts: 5 857


I'm proud user of Debian GNU/Linux OS


WWW
« Reply #1 on: December 25, 2006, 10:04:59 PM »

Hi man! Sorry for delay, many folks are off because of holiday time, and I was busy with home problems. Will try to help you if it's not too late.
First of all, is permissions are set correctly? Sometimes wrong permissions could cause really weird bugs.
Also I'm using mail script which wrote on my own so not familiar with formail, it would help if I can check it's code as it could give me a clue what's wrong. Can you provide me with it's code?(it seems that on the web available several scripts with same name).
Report to moderator   Logged

Denis
Shaken
Novice
*
Posts: 10


Ballarat Website Design


WWW
« Reply #2 on: December 25, 2006, 11:56:07 PM »

Hi man! Sorry for delay, many folks are off because of holiday time, and I was busy with home problems. Will try to help you if it's not too late.
First of all, is permissions are set correctly? Sometimes wrong permissions could cause really weird bugs.
Also I'm using mail script which wrote on my own so not familiar with formail, it would help if I can check it's code as it could give me a clue what's wrong. Can you provide me with it's code?(it seems that on the web available several scripts with same name).
I've had xmas day off here, but now it's back to work for me... Undecided

File permission is set to 755
Code can be found here
Report to moderator   Logged

Shaken
Novice
*
Posts: 10


Ballarat Website Design


WWW
« Reply #3 on: December 27, 2006, 12:27:22 AM »

Resolved  Wink
Report to moderator   Logged

SensoVision
Administrator
Veteran
*****
Posts: 5 857


I'm proud user of Debian GNU/Linux OS


WWW
« Reply #4 on: December 27, 2006, 12:46:12 AM »

Code:
Sorry to hear that you have to work during holidays, I know from my own experience this feeling as spend few times New Year(which in my country most celebrated day of the year) working or studying :-\

Regarding your problem, I've checked script you've showed me and it seems that you either modify your script or pointed me to different version as code you provide in your first post contain $redirect variable which isn't appear in code found under URL, but guess that's not an issue as long as you didn't modify the rest of script.

I know you've said that you're on the same host, but actually you could be on different servers and it's all up to admin how they setup them, I know from experience that setup could be different and some thing which apply to one site may not apply to another hosted on same hosting... That's why it could be worth to check everything.

Since I can't see or have access to your client's site, I'll try give you few ideas what may help you identify the problem:
1. let's start with checking if PHP is working fine for client's account, if any of PHP scripts are working you may skip this, if not just make a file like this:
[code=test.php]
<?php
Echo "This is just a test :)";
phpinfo();
?>

If you will be able to see output, than problem is probably in something else... BTW if possible I would recommend to create this file in same directory and same permissions as formmail.

2. Some servers have different setup and may not work with shot version of PHP tags "<?" used in the given script, that's why for compatibility reasons I'm suggesting you to change opening tag for "<?php". Also for some reason source doesn't have PHP closing tag, I know that most times it would work without it, but I believe it wouldn't harm to add one at the last line "?>"
3. can you try to comment out $redirect variable, this should give you default message. I'm just trying to eliminate any redundant option so if we got a problem it would be located in formmail.php for sure.
4. if everything above didn't help you may wish to see if script is actually able to receive any data you may do this like this:
just find this part of code:
Code:
// send it off
mail_it(stripslashes($content), ($subject)?stripslashes($subject):"Form Submission", $email, $recipient);
and replace it with something like this:
Code:
// send it off
echo "Test if form could recieve submitted the data:<br />", $content, "<br />";
mail_it(stripslashes($content), ($subject)?stripslashes($subject):"Form Submission", $email, $recipient);
[/code]

Hope that if it doesn't help at least it would bring more light on the source of the problem, let me know what you come up with.
Report to moderator   Logged

Denis
SensoVision
Administrator
Veteran
*****
Posts: 5 857


I'm proud user of Debian GNU/Linux OS


WWW
« Reply #5 on: December 27, 2006, 12:47:31 AM »

ups Tongue seems I'm too late Smiley
will you share what was causing the problem?
Report to moderator   Logged

Denis
Shaken
Novice
*
Posts: 10


Ballarat Website Design


WWW
« Reply #6 on: December 27, 2006, 02:05:29 AM »

I had tried several different form mail scripts (may have pointed you to one that I had done and since changed etc), but I was having issues with them all, so obviously fiddled with something that they all needed.

There was some code that I messed up (as I mentioned earlier i'm no php coder - I hate the stuff with a passion  Grin)...I followed it up with my host after not getting anywhere with it, and they rectified the problem for me. The format of the php syntax in the file was invalid apparently. It wasn't much, but enough to stop me in my tracks. Anyhow, it's all working good now.  Wink

Thanks for your help though mate.
Report to moderator   Logged

SensoVision
Administrator
Veteran
*****
Posts: 5 857


I'm proud user of Debian GNU/Linux OS


WWW
« Reply #7 on: December 27, 2006, 02:11:59 AM »

Quote
Thanks for your help though mate.
not at all, too bad I can't answer earlier as wasn't on PC for whole day.

Quote
. The format of the php syntax in the file was invalid apparently. It wasn't much, but enough to stop me in my tracks. Anyhow, it's all working good now.  Wink
Guess that it could be problem with php opening and/or closing tags... you may try to check it some day if curious Wink
Report to moderator   Logged

Denis
Pages: [1] Go Up Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print 
+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ Coding Talk
| | | |-+ Need quick help with formmail.php - not working

Jump to:  
« previous next »


Our Partners
RelmaxTOP Ranking System Web Hosting RelmaxTOP Ranking System
Staff Sites
12Noon[12Noon Gallery] Andy[Urgentclick]
Tamuril[Tamuril's Digital Art Exhibit] Sensovision
Powered by MySQL Powered by PHP We are hosted by Relmax Inc. |Our Privacy Policy | Sitemap
Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
Forum design by Tamuril © 2005.
Valid XHTML 1.0! Valid CSS!