Jump to content

[SOLVED] PHP Redirect


Scropion

Recommended Posts

I have been trying to do a profile searching and trying to redirect the user to the profile they want to search. The redirect function isn't allowing me to use any mysql_query.

 

Can someone help me?

 

Here is the code

 

if ($num_rows == 1) {
$extra = 'mypage.php?id=$r_info[id]';
$is=$r_info[id];
    $to = 'profile.php?id=$is';

    header('Location: '. $to); 
   exit;
}
?>

 

(edited to remove the small font tags)

Link to comment
https://forums.phpfreaks.com/topic/138893-solved-php-redirect/
Share on other sites

Use double quotes or concatenation instead of single quotes. Variables enclosed in single quotes are not evaluated:

<?php
if ($num_rows == 1) {
        $extra = 'mypage.php?id=' . $r_info['id'];
$is=$r_info['id'];
        $to = 'profile.php?id=' . $is;
        header('Location: '. $to); 
        exit();
}
?>

 

Ken

Link to comment
https://forums.phpfreaks.com/topic/138893-solved-php-redirect/#findComment-726295
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.