Jump to content

redirect link help


chanfuterboy

Recommended Posts

im busy with register page, everythink is working fine. The html code is on the same page thus after submit it come back in same page to post things in db. What i want is a script that after that it will not show again the register fields instead of that a other page.php help plz

<?php
include("dbconfig.php");


// item register ta kuminsa aki

// prome kos bo tei wak si e port bou nomber di submit mane ta skibi komo nomber dje botton
if(isset($_POST['submit']))

{
// nos tabuta par di variabel ku ta nomber ku ba dune fields nan

$articlename=  $_POST['username'];
$articlecolor=  $_POST['password'];



	{
		// den database
		// na Value ta depende den kuantu table bo ta hinka kos, bo mester buta ('',) den nos kaso tin 8 table den kual e table ku nos ta usa ta 6 7 i 8
		// Sobra tab
		// Sobra table ku no ta wordu usa na value ta keda bashi dor di un parentensis riba nan
		mysql_query("INSERT into users VALUES('','$_POST[username]','$_POST[password]','$pic')");
		echo"$pic";
	}else
	{
		echo "Can't upload. check folder permission";
	}
}



?>

Link to comment
Share on other sites

If you're looking to perform a page redirect, you can use the following code:

 

<?php
    if(...) //check if user is logged in
        header('Location: the_page_you_want_to_redirect_to.php') and exit;
?>

 

That code will redirect to the page you specify. You must place this in your script before anything is outputted with echo or print.

Link to comment
Share on other sites

Try this

 

if(!isset($_SESSION["username"])) {
   echo '<meta http-equiv="refresh" content="0;url=collection.php">';
   exit;
}

 

and use mysql_escape_string or mysql_real_escape_string

 

mysql_query("INSERT into users VALUES('','".mysql_real_escape_string($_POST[username])."','".mysql_real_escape_string($_POST[password])."','$pic')");

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.