.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
PHP Header Help
Old
  (#1)
biohazerd87
Moderator by day Waypointer by night
 
biohazerd87's Avatar
 
Status: Offline
Posts: 1,039
Join Date: Apr 2004
Location: Missouri
Default PHP Header Help - 08-01-2005

ok on some forms i have after you submit it uses the function header... but it won't work. When you submit the form it just refreshes the page istead of going to the header loction. Is there some setting on the PHP itself that you can change to make the header function work?
  
Reply With Quote
Re: PHP Header Help
Old
  (#2)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: PHP Header Help - 08-01-2005

the function must be runned before the headers are sent..
so it must be runned very early in the script..
  
Reply With Quote
Re: PHP Header Help
Old
  (#3)
biohazerd87
Moderator by day Waypointer by night
 
biohazerd87's Avatar
 
Status: Offline
Posts: 1,039
Join Date: Apr 2004
Location: Missouri
Default Re: PHP Header Help - 08-01-2005

ok i beleive you but it worked before the servers went down and when they came back up it didn't work... lemme try moving it up futher hang on

[EDIT] No that didn't work, also i am not talking about headers i am talking about header[/EDIT]

Last edited by biohazerd87; 08-01-2005 at 03:54..
  
Reply With Quote
Re: PHP Header Help
Old
  (#4)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: PHP Header Help - 08-01-2005

can you post your code ? usually when something's wrong it's much easier for people to spot out bugs when they see the code.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: PHP Header Help
Old
  (#5)
biohazerd87
Moderator by day Waypointer by night
 
biohazerd87's Avatar
 
Status: Offline
Posts: 1,039
Join Date: Apr 2004
Location: Missouri
Default Re: PHP Header Help - 08-01-2005

note this is the action page
PHP Code:
<?php 
/* Step One Code */ 
$name $_POST['name']; // The name field 
$email $_POST['email']; // The email field
$bot $_POST['bot']; // Bot name
$maps $_POST['maps']; // maps to waypoint 
$message $_POST['msg']; // The name field
$subject $_POST['subject']; // The Subject Field
$submit $_POST['Submit']; // submit button. Will be used for security later. 
if(isset($submit)){ 
/* Step Two Code */ 
// Sends the email to an email depending on choice of bot
if ($bot=="csb"){
$to "commonbullet@yahoo.com";
} else {
$to "wpbotsunited@gmail.com";
}
// Get their IP address 
$ip $_SERVER['REMOTE_ADDR'];
 
// Time and date of request 
$date date("j-m-Y H:i:s"); // This will get the date in the format: 5-7-2004 10:10:26 
$msg "Site Generated Email\n:::::::::::Waypoint Request:::::::::::\n\nName: $name\nEmail: $email\nBot: $bot\nIP Address: $ip\nTime and date sent: $date\n\nMaps:\n$Maps\n\nMessage:\n$message\n\nBOT LABEL CODE:\npb = PODbot mm\njb = JoeBot\ncsb = CSBot\nrb = Realbot\nsb = Shrikebot\nhpbb = HPBBot\nrcb = RCBot";
//$subject = "Waypoint Request";// no subject for gmail :)
$headers "From: Waypoints-United"// Will set the from address to whoever is emailing you. 
/* Step Three Code */ 
mail($to$subject$msg$headers); 
/* Step Four Code */ 
//Header AKA thanks page and info on request
header ("Location: http://lan.crazymonkeycomputers.com/rt.htm");

?>
  
Reply With Quote
Re: PHP Header Help
Old
  (#6)
BAStumm
Member
 
BAStumm's Avatar
 
Status: Offline
Posts: 138
Join Date: Jan 2004
Location: Spokane, WA USA
Default Re: PHP Header Help - 21-01-2005

http://us3.php.net/register_globals

php.net is your friend, use it.






  
Reply With Quote
Re: PHP Header Help
Old
  (#7)
FrostyCoolSlug
Member
 
FrostyCoolSlug's Avatar
 
Status: Offline
Posts: 318
Join Date: Mar 2004
Default Re: PHP Header Help - 11-04-2005

register_globals is also a great way of making PHP Scripts exploitable :/

PHP Code:
if(isset($submit)){ 
a better way of doing this, would be:

PHP Code:
if (!empty($_POST)) { 
Other than that, looks ok.. but..
always make sure you die(); after your HTTP headers are sent, this stops PHP sending output which will then make the header ignored by browsers (I've hit this problem before ) So:

PHP Code:
header("Location: http://lan.crazymonkeycomputers.com/rt.htm");
die();

(You also have a space after your header call, this could also cause problems.)


=====
Craig "FrostyCoolSlug" McLure
Network Administrator of the ChatSpike IRC Network
  
Reply With Quote
Re: PHP Header Help
Old
  (#8)
Ancient
PodBot MM's Laziest Waypointer
 
Ancient's Avatar
 
Status: Offline
Posts: 1,010
Join Date: Jan 2005
Location: Nebraska, United States of America
Default Re: PHP Header Help - 16-01-2006

Thanks for the stuff man works great, it is on my hosting upgrade stuff.

Thank you very much.
  
Reply With Quote
Re: PHP Header Help
Old
  (#9)
biohazerd87
Moderator by day Waypointer by night
 
biohazerd87's Avatar
 
Status: Offline
Posts: 1,039
Join Date: Apr 2004
Location: Missouri
Default Re: PHP Header Help - 16-01-2006

Glad we could help
  
Reply With Quote
Reply


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

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

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com