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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.