Jump to content

Page Refreshing


Cless

Recommended Posts

Hmm... I can't figure out where that would go. Do you know where it would go in this?:

 

<?PHP

//Include Cookie File
include("cookie1.php");

//Include Top File
include("top2.html");

//Include Submit File
include("submit.html");

//Display Description And Content
echo "<hr>
<b>-Promotional Pokémon-</b><br />
<hr>
<small>Sometimes, Staff will be nice and give you a Promotional (Promo) Pokémon. They are free. Pokémon 
obtained will be automatically sent to your Box.</small><br /><br />";

//Set Variables
$GP_Submit= $_POST['GP_Submit'];

if(!$GP_Submit)
{
if($GotPromo=="Yes")
{
echo "Sorry, $Username, you have already obtained the current Promotional Pokémon, $PromoName.";
}
else
{
echo "The current Promotional Pokémon is...<br /><br />

<img src='/IMG/$Promo1/$Promo2/$Promo3/$Promo'><br />
<b>$PromoName</b><br /><br />

<form method='POST'>
<input type='submit' id='sbt_btn' name='GP_Submit' class='forminput' value='Obtain' onclick='hide_btn(this);' />
<span id='submit_btn_msg' style='display:none'>Loading...</span>
</form>";
}
}
//Otherwise, Submit Data
else
{
echo "Promotional Pokémon successfully obtained!<br /><br />";
$AddPoké="Yes";
$AddPoké1=$PromoName;
$AddPoké2=$PromoGender;
include("AddPoke.php");
mysql_query("UPDATE Users SET Promo='Yes' WHERE Username='$Username'");
unset($GLOBALS['_POST']['GP_Submit']); 
}

//Include Bottom File
include("bottom2.html");

?>

 

Thanks. ^_^

 

Link to comment
https://forums.phpfreaks.com/topic/60893-page-refreshing/#findComment-303292
Share on other sites

Like that?:

 

<?PHP

//Include Cookie File
include("cookie1.php");

//Include Top File
include("top2.html");

//Include Submit File
include("submit.html");

//Display Description And Content
echo "<hr>
<b>-Promotional Pokémon-</b><br />
<hr>
<small>Sometimes, Staff will be nice and give you a Promotional (Promo) Pokémon. They are free. Pokémon 
obtained will be automatically sent to your Box.</small><br /><br />";

//Set Variables
$GP_Submit= $_POST['GP_Submit'];

if(!$GP_Submit)
{
if($GotPromo=="Yes")
{
echo "Sorry, $Username, you have already obtained the current Promotional Pokémon, $PromoName.";
}
else
{
echo "The current Promotional Pokémon is...<br /><br />

<img src='/IMG/$Promo1/$Promo2/$Promo3/$Promo'><br />
<b>$PromoName</b><br /><br />

<form method='POST'>
<input type='submit' id='sbt_btn' name='GP_Submit' class='forminput' value='Obtain' onclick='hide_btn(this);' />
<span id='submit_btn_msg' style='display:none'>Loading...</span>
</form>";
header ('location: pagename.php');
}
}
//Otherwise, Submit Data
else
{
echo "Promotional Pokémon successfully obtained!<br /><br />";
$AddPoké="Yes";
$AddPoké1=$PromoName;
$AddPoké2=$PromoGender;
include("AddPoke.php");
mysql_query("UPDATE Users SET Promo='Yes' WHERE Username='$Username'");
unset($GLOBALS['_POST']['GP_Submit']); 
}

//Include Bottom File
include("bottom2.html");

?>

Link to comment
https://forums.phpfreaks.com/topic/60893-page-refreshing/#findComment-303314
Share on other sites

I tried it, didn't work. :S

 

I get this error message:

 

Warning: Cannot modify header information - headers already sent by (output started at /usr/export/www/vhosts/funnetwork/hosting/tpmrpg/top2.html:148) in /usr/export/www/vhosts/funnetwork/hosting/tpmrpg/promo.php on line 44

Link to comment
https://forums.phpfreaks.com/topic/60893-page-refreshing/#findComment-304900
Share on other sites

its because of the include and echo... ok try this one

 


<?
//Include Cookie File
require_once("cookie1.php");
//Include Top File
require_once("top2.html");
//Include Submit File
require_once("submit.html");

//Display Description And Content
/*echo */
$content = "";
$content .= "<hr>
<b>-Promotional Pokémon-</b><br />
<hr>
<small>Sometimes, Staff will be nice and give you a Promotional (Promo) Pokémon. They are free. Pokémon 
obtained will be automatically sent to your Box.</small><br /><br />";

//Set Variables
$GP_Submit= $_POST['GP_Submit'];

if(!$GP_Submit)
{
if($GotPromo=="Yes")
{
$content .= "Sorry, $Username, you have already obtained the current Promotional Pokémon, $PromoName.";
}
else
{
$content .= "The current Promotional Pokémon is...<br /><br />

<img src='/IMG/$Promo1/$Promo2/$Promo3/$Promo'><br />
<b>$PromoName</b><br /><br />

<form method='POST'>
<input type='submit' id='sbt_btn' name='GP_Submit' class='forminput' value='Obtain' onclick='hide_btn(this);' />
<span id='submit_btn_msg' style='display:none'>Loading...</span>
</form>";
header ('location: gotopagename.php');
}
}
//Otherwise, Submit Data
else
{
$content .= "Promotional Pokémon successfully obtained!<br /><br />";
$AddPoké="Yes";
$AddPoké1=$PromoName;
$AddPoké2=$PromoGender;
include("AddPoke.php");
mysql_query("UPDATE Users SET Promo='Yes' WHERE Username='$Username'");
unset($GLOBALS['_POST']['GP_Submit']);
header ('location: gotopagename.php');
}

print $content;

//Include Bottom File
require_once("bottom2.html");
?>



Link to comment
https://forums.phpfreaks.com/topic/60893-page-refreshing/#findComment-305194
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.