Tech Reviews, Guides, Articles, and Forums for PC Hardware, Modding, and Gaming Enthusiasts
Fury-Tech Forums

Go Back   Fury-Tech Forums > Software Forums > Programming and Coding

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-29-2004, 07:20 PM
freshtokyo's Avatar
Great Diviner
Great Diviner
 
Join Date: Nov 2003
Location: In Maine
Posts: 1,638
Rep Power: 7
freshtokyo is on a distinguished road
Send a message via AIM to freshtokyo
Default Contact form

Ok, so I've been working on my site and i'm getting really close to getting it live, (except for a couple of things...) one is the contact page... here is the form

Code:
<form METHOD=POST ACTION="contact1.php"> 
		<table width="300" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td>Name:</td>
				<td><INPUT TYPE="text" NAME="name"></td>
			</tr>
			<tr>
				<td>E-mail:</td>
				<td><INPUT TYPE="text" NAME="email"></td>
			</tr>
			<tr>
				<td valign="top">Comments:</td>
				<td><TEXTAREA NAME="comments" ROWS="10" COLS="34"></TEXTAREA></td>
			</tr>
			<tr>
				<td>
<input type="submit" name="Submit" value="Submit"></td>
				<td>
<input type="reset" name="reset" value="Reset"></td>
			</tr>
		</table>
		</form>
and here is "contact1.php" code...

Code:
<? // THIS IS THE BEGIINNING OF THE PHP CODE 

$name     = @$HTTP_POST_VARS['name'];
$address  = @$HTTP_POST_VARS['address'];
$state    = @$HTTP_POST_VARS['state'];
$city     = @$HTTP_POST_VARS['city'];
$zip      = @$HTTP_POST_VARS['zip'];
$country  = @$HTTP_POST_VARS['country'];
$phone    = @$HTTP_POST_VARS['phone'];
$email    = @$HTTP_POST_VARS['email'];
$comments = @$HTTP_POST_VARS['comments'];
$fax      = @$HTTP_POST_VARS['fax'];
$error_msg="";
$msg="";



$sender_email="";

if(!isset($name)){
	if($name==""){
		$sender_name="Web Customer";
	}
}else{
	$sender_name=$name;
}
if(!isset($email)){
	if($email==""){
	$sender_email="Customer@website.com";
	}
}else{
	$sender_email=$email;
}
if($error_msg != ""){
	echo"You didn't fill in these required fields:
"
	. nl2br($error_msg) .'
Please   return  to the'
         ." previous page and try again.";
exit;}
$mailheaders  = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mailheaders .= "From: $sender_name <$sender_email>\r\n";
$mailheaders .= "Reply-To: $sender_email <$sender_email>\r\n"; 
mail("","",stripslashes($msg), $mailheaders);
 echo "<h2>Thank you for your feedback $name</h2>";
echo 'This is the information you submitted 
';
echo nl2br(stripslashes($msg));
echo '

';
//THIS IS THE END OF THE PHP CODE ?>
Now I've been working on finding a contact script that works (and is free) for about 2 hours straight... and this is the first one that seems to be the closest to actually working! It seems to be pretty simple, but I can't figure out a couple of things...
1. why does it pass even if no information has been provided?
2. HOW COME I'M NOT GETTING THE CONTACT INFO EMAILED TO ME?!!!!

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-30-2004, 06:14 PM
Tekime's Avatar
Administrator
Great Diviner
 
Join Date: Aug 2002
Location: Maine
Posts: 5,248
Rep Power: 10
Tekime is on a distinguished road
Send a message via AIM to Tekime Send a message via MSN to Tekime Send a message via Yahoo to Tekime
Default

Bro, I'll try and play with this soon. Pretty fuggin busy today. Have a massiv PHP project we are rolling out over the next month (and that's just stage one), so unfortunately I have a zillion lines of my own code to pour over, lol... I will check this out though!
__________________
ABIT NF8 | Athlon 64 2800+ | 1GB Corsair XMS PC-3200 | MSI GeForce 6600GT

My blog, business, Twitter, ryze, LinkedIn, Digg, Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-30-2004, 07:13 PM
freshtokyo's Avatar
Great Diviner
Great Diviner
 
Join Date: Nov 2003
Location: In Maine
Posts: 1,638
Rep Power: 7
freshtokyo is on a distinguished road
Send a message via AIM to freshtokyo
Default

actually don't bother... it was a shit tutorial... I posted it on codewalkers... and basically got laughed at... but if you do have a simple contact form you could send me I'd much appreciate it! (trying to tie the remaining pieces of freshtokyo.com together!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-23-2004, 12:32 PM
freshtokyo's Avatar
Great Diviner
Great Diviner
 
Join Date: Nov 2003
Location: In Maine
Posts: 1,638
Rep Power: 7
freshtokyo is on a distinguished road
Send a message via AIM to freshtokyo
Default

ok here's another one...

Code:
	<form action="process.php" method="post">
			Name: <input type="text" name="name" size="20" maxlength="20">

			Email: <input type="text" name="email" size="30" maxlength="30">

			Subject: <input type="text" name="subject" size="30" maxlength="30">

			Content: <textarea name="text" cols="50" rows="10"></textarea>

			<input type="submit" name="submit" value="Send">
		</form>
and to process the form...
Code:
<?php
	@extract ($_POST);
	$name = stripslashes($name);
	$email = stripslashes($email);
	$subject = stripslashes($subject);
	$text = stripslashes($text);
	mail ('matt@freshtokyo.com',$subject,$text,"From: $name <$email>");
	header ("location:contact.php");
?>
Any ideas why this isn't working? Should this work off my Laptop or does it need to be out there on the web to work?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-23-2004, 12:47 PM
Tekime's Avatar
Administrator
Great Diviner
 
Join Date: Aug 2002
Location: Maine
Posts: 5,248
Rep Power: 10
Tekime is on a distinguished road
Send a message via AIM to Tekime Send a message via MSN to Tekime Send a message via Yahoo to Tekime
Default

Have you tried echoing the variables to see if they are receiving the proper values?

Sample code is nice, but I would be less dependent on existing code to find your way, and try coming up with your own solution. Most of the problems you run into are basic syntax errors, or application control logic failures that can be addressed with some standard debugging techniques.

Making code that works, and making code that you understand, are two totally different things. Not saying you don't understand wth it's doing, but I see you wrestling with a ton of sample code when you could probably work through one on your own and really learn what the code is doing, why it's written as it is, how the application logic is controlled, etc. Guarantee you spend 10 hours fuxoring around with some little problem, when you finally figure it out, it will be both exhilerating and educational.
__________________
ABIT NF8 | Athlon 64 2800+ | 1GB Corsair XMS PC-3200 | MSI GeForce 6600GT

My blog, business, Twitter, ryze, LinkedIn, Digg, Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-23-2004, 03:09 PM
freshtokyo's Avatar
Great Diviner
Great Diviner
 
Join Date: Nov 2003
Location: In Maine
Posts: 1,638
Rep Power: 7
freshtokyo is on a distinguished road
Send a message via AIM to freshtokyo
Default

that's it... i'm going to molest this code. ;D thx for the input
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-23-2004, 03:09 PM
freshtokyo's Avatar
Great Diviner
Great Diviner
 
Join Date: Nov 2003
Location: In Maine
Posts: 1,638
Rep Power: 7
freshtokyo is on a distinguished road
Send a message via AIM to freshtokyo
Default

oh man... there is no smilie for ;D how about
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-23-2004, 03:11 PM
freshtokyo's Avatar
Great Diviner
Great Diviner
 
Join Date: Nov 2003
Location: In Maine
Posts: 1,638
Rep Power: 7
freshtokyo is on a distinguished road
Send a message via AIM to freshtokyo
Default

ok few
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-23-2004, 07:30 PM
Tekime's Avatar
Administrator
Great Diviner
 
Join Date: Aug 2002
Location: Maine
Posts: 5,248
Rep Power: 10
Tekime is on a distinguished road
Send a message via AIM to Tekime Send a message via MSN to Tekime Send a message via Yahoo to Tekime
Default

Hehe good luck Don't hesitate to post your questions obviously just giving my $.02 based on my very similar experience of learning PHP.
__________________
ABIT NF8 | Athlon 64 2800+ | 1GB Corsair XMS PC-3200 | MSI GeForce 6600GT

My blog, business, Twitter, ryze, LinkedIn, Digg, Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Currently Viewing
Go Back   Fury-Tech Forums > Software Forums > Programming and Coding




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Form Combo Boxes Question... Technophile Graphics, Web Design, CSS & Scripting 3 12-30-2004 02:14 PM
FIC IC-VL67 Small Form Factor PC Tekime General Hardware 0 10-15-2003 10:25 AM


All times are GMT -5. The time now is 10:05 PM.


PHP Scripts
BidVerve Directory
PageRank Script
SEO Scripts
37 SEO Scripts
List Cleaner Script
Keyword Cleaner
Directory Script
Directory Script

Directories
BidVerve Directory
BidVerve Directory
Nerve Directories
Nerve Directories
Directory Grow
Directory Grow

Our Supporters
entertainment sites
online casino

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.