Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 4th, 2002, 04:59 PM
benjb benjb is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Manchester, UK
Posts: 3 benjb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
help me please

Hi,

I have been following the tutorial fine until this point. I just can't get the code below to work. If you press the submit before filling in the email and message field it just reloads the feedback.html. Ok that bit of the code works but everything below doesn't. Even if I fill in all the fields the mail isn't sent whereas with the code earlier on in the tut it worked fine. Can you help me? I am new to all this and I am having teething problems.


<?
if (!isset($email) || !isset($message)) {
header( "Location: URL" );
}
elseif (empty($email) || empty($message)) {
header( "Location: URL" );
}
else {
mail( "yourname@yourdomain.com", "Feedback Form Results",
$message, "From: $email" );
header( "Location: URL" );
}
?>


Cheers

Benjb

Reply With Quote
  #2  
Old September 4th, 2002, 05:41 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Benjb,

What's the problem you're having?

Are you testing this on a server, or on a local machine? If it's on a local machine, did you configure the mail settings:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =


Also, if you're running PHP with "register_globals" set to OFF, you'll have to make use of the superglobal arrays "$_POST" and "$_GET". So in your example, depending on whether you're using "POST" or "GET" in the method definition of your FORM, you would use this:

PHP Code:
<? 
if (!isset($_POST['email']) || !isset($_POST['message'])) { 
header"Location: [url]http://localhost/feedback.html[/url]" ); 
}


Any information on your problem/error you're having would be helpful.

Also, for future reference, please read the forum rules on posting code and coding problems.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #3  
Old September 4th, 2002, 07:14 PM
benjb benjb is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Manchester, UK
Posts: 3 benjb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Frank,

You are a star!! I must have had register_globals set to OFF.

Thankyou


Benjb

Reply With Quote
  #4  
Old September 5th, 2002, 09:56 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Benjb,

You're welcome! Anytime...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > help me please


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT