Hey guys!
I'm a newbie with php and MySQL...I was able to find a solution for all my problems I had before but now I got stuck:queasy:
what I want is -> get this code to work:
<?php
/* $value1 = ('http://www.google.com/search?q='); */
include 'dbc.php';
page_protect();
$result = mysql_query("select go_value1 from users where id='$_SESSION[user_id]'");
if (isset($_SESSION['user_id']))
while ($row = mysql_fetch_array($result)) {
${$value1} = $row['go_value1'];
}
if (!empty($_REQUEST['searchbar']))
{
$url = array(
'> Go!'=>"{$value1}__keywords__");
header('Location:'.str_replace('__keywords__',preg_replace('/(\ )+/', '+', trim($_REQUEST['searchbar'])),$url[trim($_REQUEST['go1'])]));
die();
}
else
{
die();
}
?>
When I'm using the quoted variable / $value1 = ('http://www.google.com/search?q='); / everything works fine! But I want to grab that value from my database, because a user should be able to change that value....
I tried so many different ways already, but wasn't able to make it work :bemused:
Would be cool if someone could help me with the code! I'm desperate 🙁
Thx