Jump to content

Recommended Posts

Hey,

 

function links() {
$query = "SELECT config_value FROM " . TBL_CONFIG . " WHERE config_name='site_location'";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
echo "/" .  $row['site_location'] . "/";
}

 

Website coding:

echo '<a href="' . links() . 'test.php">Test</a>';

 

The only outcome i get from that is // Test on the page itself.

 

Oops i forgot one part.

 

function login(){
echo '<a href="./index.php">Home</a><br />';
if (isset($_SESSION['user_id']) AND (substr($_SERVER['PHP_SELF'], -10) != 'logout.php')) {
	echo '<a href="./logout.php">Logout</a><br />
	<a href="./admin/profile.php">Profile</a><br />
	<a href="./admin/">Admin Panel</a><br />';
	if ($_SESSION['userlevel'] >= 9) {
		echo '<a href="/todo.php">To do list</a><br />		
			  <a href="./admin/view_users.php">View Users</a><br />'; 
	}
} else { //  Not logged in.
	echo ' <a href="register.php">Register</a><br />
<a href="' . links() . 'login.php">Login</a><br />
<a href="forgot_password.php">Forgot Password</a><br />
';
}
}

thats another function that also calls links() and it doesn't work eithor.

 

Um, your query is only returning the value for the 'config_value' column and then you are trying to reference the 'site_location' value. change the query to return the value you actually want to use.

 

<?php

function links() {
$query = "SELECT site_location FROM " . TBL_CONFIG . " WHERE config_name='site_location'";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
echo "/" .  $row['site_location'] . "/";
}

?>

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.