Jump to content

header refresh


hyster

Recommended Posts

is it possable to put a $var inside the url in a header refresh?

 

tried

header( 'refresh:0; url=index.php?mess=add&$get['part']' );

header( 'refresh:0; url=index.php?mess=add&<?php $get['part'] ?>' );

 

im using the header as part of a if statment and depending on which is used depeds on what the url i want.

 

full if statment (headers not complete in the below code)

 

if ($_GET['instr'] == 'min'){
echo $count = $_GET['qty'] - 1;

$sql1="UPDATE vega_parts SET qty='$count' WHERE part='{$_GET['part']}'";
$result1=mysql_query($sql1);
if($result1){
header( 'refresh:0; url=index.php?mess=rem' );
}
else {
echo "ERROR";
}
}elseif($_GET['instr'] == 'plus'){
echo $count = $_GET['qty'] + 1;
$sql1="UPDATE vega_parts SET qty='$count' WHERE part='{$_GET['part']}'";
$result1=mysql_query($sql1);
if($result1){
header( 'refresh:0; url=index.php?mess=add&' );
}
else {
echo "ERROR";
}
}else{
echo "Error";
}

Link to comment
https://forums.phpfreaks.com/topic/239978-header-refresh/
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.