header??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
TLPD
Forum Newbie
Posts: 7
Joined: Mon Jun 30, 2003 10:14 am

header??

Post by TLPD »

i've this code (insert.php)
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($dbname) or die("Unable to select database");

$query="INSERT INTO diemhk4 VALUES ('','$ten','$mssv','$ctdl','$dientu','$ktso','$ltdt','$toanrr','$cnxh','$anhvan','$pptinh','$thuchanh')";
mysql_query($query);
mysql_close();
$tr_url="http://localhost/hocphp/diemhk/add.html";
header("Location : $tr_url");
exit();
?>
i want that when i just finish input database at add.html ( this file is used to input data and then it 'll call insert.php file) it'll come back the add.html file to input again
but the code above didn't work although it inputs data successful
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

try

Code: Select all

header("Location: $tr_url");
User avatar
TLPD
Forum Newbie
Posts: 7
Joined: Mon Jun 30, 2003 10:14 am

Post by TLPD »

it's the same my code. but i don't understand why it couldn't work
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

fussy about spaces, is it working now?
Post Reply