Web Design Forum: PHP contact form XHTML strict - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

PHP contact form XHTML strict Rate Topic: ***** 1 Votes

#1 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,839
  • Joined: 14-February 08
  • Reputation: 168
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 03 June 2008 - 12:45 PM

PHP dufus alert!! I've been scouring the web for a free PHP contact form which validates as XHTML strict, but I can't find one... Anyone point me to one?
Thanks
0

#2 User is offline   Jem 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 288
  • Joined: 20-April 08
  • Reputation: 1
  • Gender:Female
  • Location:Telford, Shrops.
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 03 June 2008 - 01:03 PM

My mail form has an XHTML transitional doctype, but would validate as strict if you swap it for the right doctype.
0

#3 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,839
  • Joined: 14-February 08
  • Reputation: 168
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 03 June 2008 - 01:20 PM

View PostJem, on Jun 3 2008, 14:03, said:

My mail form has an XHTML transitional doctype, but would validate as strict if you swap it for the right doctype.

Wow thanks Jem! You're a star :)

Quote

Ultimately better than you

How right you are :lol:
0

#4 User is offline   Jem 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 288
  • Joined: 20-April 08
  • Reputation: 1
  • Gender:Female
  • Location:Telford, Shrops.
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 03 June 2008 - 01:44 PM

No probs - if you have any problems with it (though you shouldn't) feel free to contact me directly.

I love my little tagline - draws a lot of attention ;)
0

#5 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,839
  • Joined: 14-February 08
  • Reputation: 168
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 03 June 2008 - 02:14 PM

View PostJem, on Jun 3 2008, 14:44, said:

No probs - if you have any problems with it (though you shouldn't) feel free to contact me directly.

I love my little tagline - draws a lot of attention ;)

OOOHhh it's beautiful!! Thank you!
I'd like to take the form and use it as an includes for my website. Do I need to change the form action to _SELF or something similar, or do I need to seperate the html and PHP into separate files so that the form calls the same PHP wherever in the site it appears? If so, can you help me figure it out?
Thanks again
0

#6 User is offline   Jem 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 288
  • Joined: 20-April 08
  • Reputation: 1
  • Gender:Female
  • Location:Telford, Shrops.
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 03 June 2008 - 03:26 PM

You should - in theory - be able to copy the block of html with all the form bits anywhere on to a web page and as long as the action attribute points to the right place (form.php or whatever you've called the page) it will work. You'd have to remove the <?php get_data(); ?> bits from the field values though.

It's probably worth mentioning I've not actually tested that myself, mind ;)
0

#7 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,839
  • Joined: 14-February 08
  • Reputation: 168
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 03 June 2008 - 06:19 PM

View PostJem, on Jun 3 2008, 16:26, said:

You should - in theory - be able to copy the block of html with all the form bits anywhere on to a web page and as long as the action attribute points to the right place (form.php or whatever you've called the page) it will work. You'd have to remove the <?php get_data(); ?> bits from the field values though.

It's probably worth mentioning I've not actually tested that myself, mind ;)

It works! Thanks again!
0

#8 User is offline   1christopher 

  • Expert
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 652
  • Joined: 22-February 08
  • Reputation: 0
  • Location:South Lincs
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 11 July 2008 - 07:53 PM

Does this work with SSL secure server?

And is it based on Formmail or am i jus confused!
0

#9 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 31 July 2008 - 10:17 AM

what about all those rude words that are in the form defined after the following:

$exploits =
$profanity =
$spamwords =
$bots =

aren't they a bad thing to have within your html page - won't they get indexed by google???
Not sure i'd want all those rude words within my HTML.

Any thoughts?
0

#10 User is offline   BabyBen 

  • </cheeky>
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 564
  • Joined: 13-March 07
  • Reputation: 0
  • Location:Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 31 July 2008 - 10:23 AM

View PostEskymo, on Jul 31 2008, 11:17, said:

what about all those rude words that are in the form defined after the following:

$exploits =
$profanity =
$spamwords =
$bots =

aren't they a bad thing to have within your html page - won't they get indexed by google???
Not sure i'd want all those rude words within my HTML.

Any thoughts?


That part of the form is in PHP and will never appear in the users browsers (nor in the HTML source) - it'll never be seen.

Would it be possible for you to add in a Captcha, or a question "If I've got three apples, and I eat one - how many do I have left?" etc.
0

#11 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 31 July 2008 - 10:34 AM

I might try this form out then - I was just a bit concerned about having all those rude words appear within the code.
I need a simple small form for a site I'm doing now, so will see how this works.

It would be good with a captcha - but I don't code php so not a job for me.
0

#12 User is offline   BabyBen 

  • </cheeky>
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 564
  • Joined: 13-March 07
  • Reputation: 0
  • Location:Scotland
  • Experience:Intermediate
  • Area of Expertise:Designer

Posted 31 July 2008 - 02:32 PM

View PostEskymo, on Jul 31 2008, 11:34, said:

I might try this form out then - I was just a bit concerned about having all those rude words appear within the code.
I need a simple small form for a site I'm doing now, so will see how this works.

It would be good with a captcha - but I don't code php so not a job for me.


I might have a little bash :)
0

#13 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 31 July 2008 - 08:56 PM

I tried the form and it doesn't work...
i followed the instructions and inputted my email address and web address where it said, uploaded it, filled it out and pressed send and it's been over 15 minutes and I've still not received anything...
0

#14 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 31 July 2008 - 09:57 PM

I stand corrected. I got the first test email through - it took about half an hour - Anyone know why it would take so long?
The second test hasn't come through at all.
0

#15 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 31 July 2008 - 10:01 PM

sorry - got it working now - missed a '.' out of the email address on the last few test forms. Still not sure why the first test took so long to arrive though.
0

#16 User is offline   J Sin 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 01-August 08
  • Reputation: 0
  • Location:Framingham, MA
  • Experience:Intermediate
  • Area of Expertise:Web Designer

  Posted 01 August 2008 - 03:36 PM

Hello everyone!

I just discovered this forum via Google while searching for a form I could create that would be XHTML Strict-compliant.

Jem, I used your free php mail-form and, although it both displays and functions correctly, when I go to check my page's validation, I get two errors.

Any idea how I can fix this so the contact form returns a valid compliance?

Thanks a million.

~ Jason ~

PS - This site looks fantastic, I'm so glad I found it.
0

#17 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 01 August 2008 - 03:54 PM

the text area needs the width and height defined. I used:

<fieldset>
	<legend>Required Message:</legend>
	<label for="comments">* Please type your message below:<br />
	<textarea name="comments" id="comments" rows="6" cols="100" class="textbox"><?php get_data("comments"); ?></textarea></label><br />
</fieldset>

0

#18 User is offline   J Sin 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 01-August 08
  • Reputation: 0
  • Location:Framingham, MA
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 02 August 2008 - 03:42 AM

View PostEskymo, on Aug 1 2008, 11:54, said:

the text area needs the width and height defined. I used:

<fieldset>
	<legend>Required Message:</legend>
	<label for="comments">* Please type your message below:<br />
	<textarea name="comments" id="comments" rows="6" cols="100" class="textbox"><?php get_data("comments"); ?></textarea></label><br />
</fieldset>


Ah, that did the trick! Thank you so much! I'm so glad I found this website :)
0

#19 User is offline   dede 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 14
  • Joined: 19-September 08
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 19 September 2008 - 01:10 AM

just a little hint about this great piece of code: i think that using preg_match instead of eregi for server validation is faster (although in this situation won't make any difference), but in the next PHP 6, eregi function will be completely removed
0

#20 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 25 November 2008 - 09:33 AM

I installed this fomr on a clients website and all was fine for a few weeks but now she's getting about 20 or so spam emails through it and it's really annoying her - is there anything I can do?
0

#21 User is offline   AJReading 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 182
  • Joined: 02-July 07
  • Reputation: 2
  • Gender:Male
  • Location:York
  • Experience:Advanced
  • Area of Expertise:Coder

Posted 25 November 2008 - 10:15 AM

Depends on the content of the spam. I've found that blocking "http:" usually works since there is usually a url in there... It may not suit everyone ofcourse.

	if (preg_match_all("/<a|http:/i", implode($_POST))) {	 // check for <a and http:
	   echo "Naughty Spammer!"; exit();
	}

0

#22 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 25 November 2008 - 10:23 AM

some examples of the stuff she's getting throught the form are as follows:

Quote

Name: Djxnhvtq
Email: nzgylvhj@lnvjqskq.com
Telephone: ELQATDqxdxlhB
Comments: Thanks!, adult affiliate click pay per, %O, adult learning style, %P, seven of nine adult, :-PPP, active adult community napa valley, 5470, pictures of heat rash in adults, 566614, adultery coping husband, :((, lack of focus adult medical condition, 9009, adult voyeur pic, 21697, adult swim lucy, 8-(, chinese adult actress, qlzbzr, adult video business, :-OO, adult only resorts in las vegas, wogulh, free adult dvd video, 80895,
Submit: Send


Quote

Name: Eadzahtv
Email: oxswokzo@oapmirqj.com
Telephone: ELQATDqxdxlhB
Comments: Thanks!, adult gay spanking, 226, adult personals quality, lhh, free adult online tv, ynvf, adult escort vacation, =-DDD, ruby adult film star, %), adult flick free hardcore, slp, adult services taiwan, jytuy, number of adult tooth, =PPP, adult exercise camp, 203, adult only resorts in las vegas, batvto, adult companion holiday, >:OOO,
Submit: Send


Quote

Name: zihbsrbod
Email: qsyfoo@dvwgaj.com
Telephone: 539720788
Comments: vvxNF7 atiklmfyvfzv, qwxeqwxqbuab, [link=http://jhkocqxypgco.com/]jhkocqxypgco[/link], http://acpanniwkskr.com/
Submit: Send


Lots of rude stuff but also gobbledeegook...
0

#23 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 25 November 2008 - 06:14 PM

Anyone have any ideas here. I'd really appreciate the help!

Thanks

E
0

#24 User is offline   mikejonesey 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 355
  • Joined: 30-June 08
  • Reputation: 0
  • Location:Brighton, UK
  • Experience:Web Guru
  • Area of Expertise:Designer/Coder

Posted 05 December 2008 - 08:53 PM

just use captcha, download any common forum / blog and use the captcha images in one of those packages.
0

#25 User is offline   weldan 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 05-December 08
  • Reputation: 0
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 08 December 2008 - 02:17 PM

View Postmikejonesey, on Dec 6 2008, 04:53, said:

just use captcha, download any common forum / blog and use the captcha images in one of those packages.


I give it a try (need more practice with xhtml codes. I can't figure out why it won't validates as xhtml 1.0 strict.)

php contact form with random math question. (with my sloppy codes, :D)

Test run

Source files
0

#26 User is offline   Jem 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 288
  • Joined: 20-April 08
  • Reputation: 1
  • Gender:Female
  • Location:Telford, Shrops.
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 08 December 2008 - 03:00 PM

View PostEskymo, on Nov 25 2008, 18:14, said:

Anyone have any ideas here. I'd really appreciate the help!

Thanks

E

I am ever so sorry, I didn't see that this thread had been updated while I took a break from this forum!

A mail form version 2 is in the works with more spam protection, but in the mean time if you want to try adding a simple question field it might help...

After the form textarea, add:

<label><input type="text" name="quiz" id="quiz" /> What colour is the sea?</label><br />


then change this bit:

		$error_msg .= "That is not a valid e-mail address. \n";
	}


to:

		$error_msg .= "That is not a valid e-mail address. \n";
	} elseif (empty($_POST['quiz']) || strtolower($_POST['quiz']) != "blue") {
		$error_msg .= "Invalid answer to 'What colour is the sea?' \n";
	}


If you decide to change the question, don't forget to change "blue" to match the correct answer.

(Please note, I'm at work so haven't tested this but it should work!)

Edit: if anyone wants to play with version 2, you can grab it here:
http://www.jemjabell...ail_form_v2.txt
but note that it's still under construction. :)
0

#27 User is offline   Eskymo 

  • Web Guru
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,433
  • Joined: 05-September 06
  • Reputation: 36
  • Gender:Female
  • Location:Fife, Scotland, UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 08 December 2008 - 04:32 PM

i think that should work just fine - will give it a go and let you know.
0

#28 User is offline   Dazza30 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 61
  • Joined: 20-November 08
  • Reputation: 0
  • Experience:Intermediate
  • Area of Expertise:I'm Learning

Posted 22 February 2009 - 11:55 PM

Hi all

Im not sure if its because ive been working to long or that i just f---ed up but all i get when i try to view my page in a browser (Other than the xhtml) is this

function clean($data) { $data = trim(stripslashes(strip_tags($data))); return $data; } // lets check a few things - not enough to trigger an error on their own, but worth assigning a spam score.. // score quickly adds up therefore allowing genuine users with 'accidental' score through but cutting out real spam :) $points = (int)0; $badwords = array("adult", "beastial", "bestial", "blowjob", "clit", "cum", "cunilingus", "cunillingus", "cunnilingus", "****", "ejaculate", "fag", "felatio", "fellatio", "****", "fuk", "fuks", "gangbang", "gangbanged", "gangbangs", "hotsex", "hardcode", "jism", "jiz", "orgasim", "orgasims", "orgasm", "orgasms", "phonesex", "phuk", "phuq", "porn", "pussies", "pussy", "spunk", "xxx", "viagra", "phentermine", "tramadol", "adipex", "advai", "alprazolam", "ambien", "ambian", "amoxicillin", "antivert", "blackjack", "backgammon", "texas", "holdem", "poker", "carisoprodol", "ciara", "ciprofloxacin", "debt", "dating", "porn", "link=", "voyeur"); $exploits = array("content-type", "bcc:", "cc:", "document.cookie", "onclick", "onload", "javascript"); foreach ($badwords as $word) if (strpos($_POST['comments'], $word) !== false) $points += 2; foreach ($exploits as $exploit) if (strpos($_POST['comments'], $exploit) !== false) $points += 2; if (strpos($_POST['comments'], "http://") === true || strpos($_POST['comments'], "www.") === true) $points += 2; elseif (isset($_POST['nojs'])) $points += 1; elseif (preg_match("/(<.*>)/i", $_POST['comments'])) $points += 2; elseif (strlen($_POST['name']) < 3) $points += 1; elseif (strlen($_POST['comments']) < 15 || strlen($_POST['comments'] > 1500)) $points += 2; // end score assignments if (empty($_POST['name']) || empty($_POST['email']) || empty($_POST['comments'])) { $error_msg .= "Name, e-mail and comments are required fields. \n"; } elseif (strlen($_POST['name']) > 15) { $error_msg .= "The name field is limited at 15 characters. Your first name or nickname will do! \n"; } elseif (!ereg("^[A-Za-z' -]*$", $_POST['name'])) { $error_msg .= "The name field must not contain special characters. \n"; } elseif (!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$",strtolower($_POST['email']))) { $error_msg .= "That is not a valid e-mail address. \n"; } elseif (!empty($_POST['url']) && !preg_match('/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i', $_POST['url'])) $error_msg .= "Invalid website url."; if ($error_msg == NULL && $points <= $maxPoints) { $subject = "Automatic Form Email"; $message = "You received this e-mail message through your website: \n\n"; foreach ($_POST as $key => $val) { $message .= ucwords($key) . ": $val \r\n"; } $message .= 'IP: '.$_SERVER['REMOTE_ADDR']."\r\n"; $message .= 'Browser: '.$_SERVER['HTTP_USER_AGENT']."\r\n"; $message .= 'Points: '.$points; if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) { $headers = "From: $yourEmail \r\n"; $headers .= "Reply-To: {$_POST['email']}"; } else { $headers = "From: $yourWebsite <$yourEmail> \r\n"; $headers .= "Reply-To: {$_POST['email']}"; } if (mail($yourEmail,$subject,$message,$headers)) { echo '

Your mail was successfully sent.
'; } else { echo '

Your mail could not be sent this time.
'; } } } function get_data($var) { if (isset($_POST[$var])) echo htmlspecialchars($_POST[$var]); } if ($error_msg != NULL) { echo '

ERROR:
'; echo nl2br($error_msg) . "
"; } ?>

Name: " />
E-mail: " />
Website URL: " />
Location: " />
Comments: <?php get_data("comments"); ?>


All this is version 2 of the code mentioned earlier found here Version 2

I copied everything after the head tags in the script file and pasted it into the place i want the form to appear, i also changed the page file type from html to php.

I have absolutly no experience with php so i cant begin to think where i could have gone wrong, any ideas anyone?
0

#29 User is offline   Ade 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 105
  • Joined: 22-February 09
  • Reputation: 1
  • Gender:Male
  • Location:UK
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 19 March 2009 - 09:42 PM

Dazza, if you're testing locally and you are not running a PHP server, then seeing the code (in some form or another) is expected and normal. Firefox, for example, will show the PHP as plain text in an otherwise normal HTML page. IE7 shows just code until you hit the refresh button, and then it will mimic Firefox's view. The simple expedient answer is to comment out the PHP code (use HTML comment marks) while you're testing locally. Then Firefox won't show any oddities and IE7 only needs a refresh to "look" normal, albeit with an "error on page" icon at bottom left, but that's not a concern at the testing stage. Hope that helps.
0

#30 User is online   AdamConder 

  • Dedicated Member
  • PipPip
  • View gallery
  • Group: Members
  • Posts: 197
  • Joined: 18-May 09
  • Reputation: 9
  • Gender:Male
  • Location:Newcastle, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 24 July 2009 - 09:44 AM

I am using your form and I have uploaded the form to my server and I keep getting:

"Your mail could not be sent this time."

I've checked everything and there's nothing that's wrong with my coding, Could it be my server not allowing it? (Free server).

http://gamerzone.uuuq.com/contact.php
0

#31 User is online   Mikec1uk 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 226
  • Joined: 06-December 07
  • Reputation: 7
  • Gender:Male
  • Location:UK
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 24 July 2009 - 09:49 AM

View PostAdamConder, on 24 July 2009 - 09:44 AM, said:

I am using your form and I have uploaded the form to my server and I keep getting:

"Your mail could not be sent this time."

I've checked everything and there's nothing that's wrong with my coding, Could it be my server not allowing it? (Free server).

http://gamerzone.uuuq.com/contact.php


Hi Adam,

What host are you with? Do they allow PHP?
0

#32 User is online   AdamConder 

  • Dedicated Member
  • PipPip
  • View gallery
  • Group: Members
  • Posts: 197
  • Joined: 18-May 09
  • Reputation: 9
  • Gender:Male
  • Location:Newcastle, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 24 July 2009 - 09:51 AM

Yea they will allow php because I am using MySql queries in php files etc?

I have with: www.zymic.com (my domain is uuuq.com)

Thanks for the fast reply!
0

#33 User is online   Mikec1uk 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 226
  • Joined: 06-December 07
  • Reputation: 7
  • Gender:Male
  • Location:UK
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 24 July 2009 - 10:16 AM

View PostAdamConder, on 24 July 2009 - 09:51 AM, said:

Yea they will allow php because I am using MySql queries in php files etc?

I have with: www.zymic.com (my domain is uuuq.com)

Thanks for the fast reply!


Unfortunately, I don't think Zymic support the Mail Function on their free web hosting. You will need to contact them to enable it, which costs about $10.
0

#34 User is online   AdamConder 

  • Dedicated Member
  • PipPip
  • View gallery
  • Group: Members
  • Posts: 197
  • Joined: 18-May 09
  • Reputation: 9
  • Gender:Male
  • Location:Newcastle, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 24 July 2009 - 10:18 AM

Right do you know if that's a one off payment? :D I'm not even sure if I want to publish this site properly on a paid host etc. Its really just an website so I can test my skills. :D
0

#35 User is online   Mikec1uk 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 226
  • Joined: 06-December 07
  • Reputation: 7
  • Gender:Male
  • Location:UK
  • Experience:Nothing
  • Area of Expertise:Nothing

Posted 24 July 2009 - 10:23 AM

It's a one off activation fee I believe.

It's only to stop spammers signing up for free and abusing the system.

If you don't want to pay the $10, have a look at a service such as this:

Email me form

Hope it helps!
0

#36 User is offline   Mr_Ye 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 33
  • Joined: 09-July 09
  • Reputation: 2
  • Gender:Male
  • Location:West London
  • Experience:Intermediate
  • Area of Expertise:I'm Learning

Posted 01 August 2009 - 03:31 PM

Thanks for this Jem - it's a great little script :)

Could I have a 'Thank you - message sent' message appear on the same page as the contact form rather than the form.php printing the message out seperately?

I'm new to php so any help would be appreciated ;) Cheers all.
0

#37 User is online   AdamConder 

  • Dedicated Member
  • PipPip
  • View gallery
  • Group: Members
  • Posts: 197
  • Joined: 18-May 09
  • Reputation: 9
  • Gender:Male
  • Location:Newcastle, UK
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 05 August 2009 - 07:49 PM

It does this automatically.
0

#38 User is offline   Jem 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 288
  • Joined: 20-April 08
  • Reputation: 1
  • Gender:Female
  • Location:Telford, Shrops.
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 25 August 2009 - 06:53 PM

Apologies for abandoning this thread again (blame pregnancy and morning sickness taking up most of my time!) There were some tweaks made to version 2 of the form a month or so ago, so anyone running an older version may wish to update (although if you're having no problems it's not urgent.)
0

#39 User is offline   mrchristoph 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,231
  • Joined: 18-August 09
  • Reputation: 76

Posted 06 October 2009 - 11:27 AM

Hi, I have just tried uploading this form to a site as a test, and it doesn't seem to work as it can't locate the php portion - in fact when viewing the source it doensn't even show there. This is my first dabble with PHP so I am probably doing something fundamentally wrong.

I presume the whole thing needs to go in one PHP file, rather than a HTML one linking to a PHP file? I have confirmation from the host that PHP is enabled and working. Anyway here it is (without styling or anything yet):

http://www.cttestare....uk/Contact.php

thanks
0

#40 User is offline   riceo 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 29-September 09
  • Reputation: 0
  • Gender:Male
  • Location:Essex
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 06 October 2009 - 11:46 AM

You need to stick the PHP code in it's own file with a .php extension.The HTML form needs to know where this file is to send the user's data, so you need to alter the form action:

<form action="NAMEOFPHPFILEHERE.php" method="post">
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users