Wow Web Designs Forums Home

Search
   
Members

Calendar

Help

Home
Search by username
Not logged in - Login | Register 
Wow Web Designs Forums > Scripting > PHP > PHP Script Question


PHP Script Question
 Moderated by: Aycan  

New Topic

Reply

Print
AuthorPost
tumms
Member


Joined: Sun Apr 17th, 2005
Location: Chicago, Illinois USA
Posts: 78
Status:  Offline
Mana: 
 Posted: Fri May 13th, 2005 02:31 am

Quote

Reply
Well, I take notes at school on a laptop, but the laptop is the schools. At the end of class, the teacher never gave us enough time to shut down the laptops and we were always late. So, in order to get the notes to your self, you have to send them to your email. Me being the smart fox I am, decided to make a script that would easily email something. Anyway...

The script is two different pages. One HTML one PHP.


This is the PHP script


<MAIL.HTML>
<html>
<body>
<form action="mail.php" method="POST">
To:<br><input name="to" type="text" value=""><br>
Subject:<br><input name="subject" type="text" value=""><br>
Your name:<br><input name="from_header" type="text" value=""><br>
Message:<br><textarea name="contents" rows=4 cols=50></textarea>
<br><input type="submit" value="Send" class="submit"></form>
</body>
</html>


Here is the PHP part.
<MAIL.PHP>
<?
if($contents != "")
{
//send mail - $subject & $contents come from surfer input
mail($_POST['to'], $_POST['subject'], $_POST['contents'], $_POST['from_header']);
// redirect back to url visitor came from
header("Location: $HTTP_REFERER");
}
else
{
print("<HTML><BODY>Error, no comments were submitted!");
print("</BODY></HTML>");
}
?>


Ok, the problem is that when ever I fill out all the imput boxes, the php page still displayes Error, no comments were submitted! So, whats the fix?

relaxzoolander
Super Moderator


Joined: Sun Jan 25th, 2004
Location: Columbus, Ohio USA
Posts: 459
Status:  Offline
Mana: 
 Posted: Fri May 13th, 2005 07:41 am

Quote

Reply
i dont do php...but dont you have to read in the form fields?
in asp...i would do this:
dim contents
contents=Request.Form("contents") 
otherwise...contents would equal "".

:P

r|z
---------------------------------------------------------
columbus ohio web designer

tumms
Member


Joined: Sun Apr 17th, 2005
Location: Chicago, Illinois USA
Posts: 78
Status:  Offline
Mana: 
 Posted: Sun May 15th, 2005 02:06 am

Quote

Reply
lol i have no idea, its my first wack at PHP. i wanted to get into ASP but my host doesnt support it

relaxzoolander
Super Moderator


Joined: Sun Jan 25th, 2004
Location: Columbus, Ohio USA
Posts: 459
Status:  Offline
Mana: 
 Posted: Sun May 15th, 2005 05:17 am

Quote

Reply
well...did you try what i suggested?

:?

r|z
----------------------------------------------
midpark

tumms
Member


Joined: Sun Apr 17th, 2005
Location: Chicago, Illinois USA
Posts: 78
Status:  Offline
Mana: 
 Posted: Sun May 15th, 2005 07:23 am

Quote

Reply
Nope!

csg
Member
 

Joined: Sun Apr 17th, 2005
Location: Kennewick, Washington USA
Posts: 114
Status:  Offline
Mana: 
 Posted: Mon May 16th, 2005 12:38 am

Quote

Reply
Well your script looks fine. i would check that all your variables are named correctly. Like for you textarea name and your php variable, so they match. Other wise there is something else going on.


I have a php and a asp host. My asp host is free and comes with an ftp. I don't even know how long I had that account. It is http://www.7host.com, and sing up for the free hosting. And if your interested http://www.1and1.com is having a 6 month free trial of there php bussiness hosting. It is free (they don't even ask for your credit card) and comes with a domain no charge.

Last edited on Mon May 16th, 2005 12:42 am by csg

tumms
Member


Joined: Sun Apr 17th, 2005
Location: Chicago, Illinois USA
Posts: 78
Status:  Offline
Mana: 
 Posted: Tue May 17th, 2005 09:12 pm

Quote

Reply
I couldn't find this trial you spoke of...if you could give me a link?

csg
Member
 

Joined: Sun Apr 17th, 2005
Location: Kennewick, Washington USA
Posts: 114
Status:  Offline
Mana: 
 Posted: Wed May 18th, 2005 09:39 pm

Quote

Reply
:shock::shock: Sorry I haven't been there in a while. I search for another host but I couldn't find one.

xeno
Member
 

Joined: Fri Jul 15th, 2005
Location:  
Posts: 4
Status:  Offline
Mana: 
 Posted: Wed Aug 3rd, 2005 03:56 am

Quote

Reply
try using one of these http://flashmailforms.com

tasteslikepurple
Member
 

Joined: Fri Nov 18th, 2005
Location:  
Posts: 2
Status:  Offline
Mana: 
 Posted: Wed Nov 23rd, 2005 06:47 pm

Quote

Reply
probably already fixed it by now but you need

IF ($_POST['contents'] != "")


 Current time is 11:00 am




Powered by WowBB 1.7 - Copyright © 2003-2006 Aycan Gulez
Page processed in 0.1948 seconds (9% database + 91% PHP). 17 queries executed.