aquatradehub Posted March 19, 2014 Share Posted March 19, 2014 Hi, I am trying to pass a user to the page that contains any customer reviews. I am using the link <a href="reviews.php?username=$username">See reviews</a>on line 26 to try and access the users review.php page, but hovering over the link or clicking on it results in the followinghttp://e-quatics.com/reviews.php?username=$usernamethis should readeg. http://e-quatics.com/reviews.php?username=member1Here is the code for the page. I cant seem to figure out why the $username value is not picked up by the code and used in the link. <?php include 'core/init.php'; include 'includes/overall/header.php'; if (isset($_GET['username']) === true && empty($_GET['username']) === false) { $username = $_GET['username']; if (user_exists($username) === true) { $user_id = user_id_from_username($username); $profile_data = user_data($user_id, 'username', 'date'); $count_items_listed = count_items_listed($user_id); $count_live_items_listed = count_live_items_listed($user_id); // $count_items_sold = count_items_sold($user_id); // $count_items_purchased = count_items_purchased($user_id); // $count_reviews = count_reviews($user_id); ?> <h1><?php echo filterBadWords($profile_data['username']); ?>'s Profile</h1> <br> <p>Member Since: <?php echo $profile_data['date']; ?></p> <p>Number of items sold: <?php // echo $count_items_sold; ?></p> <p>Number of items purchased: <?php // echo $count_items_purchased; ?></p> <p>Number of customer reviews: <?php // echo $count_reviews ?><a href="reviews.php?username=$username">See reviews</a></p> <p>Number of live items currently listed: <?php echo $count_live_items_listed; ?></p> <p>Number of items currently listed: <?php echo $count_items_listed; ?></p> <?php } else { echo 'Sorry, that user doesn\'t exist!'; } } else { header('Location: index.php'); exit(); } include 'includes/overall/footer.php'; ?> As always guys, your help is much appreciated.aquaman Quote Link to comment Share on other sites More sharing options...
Solution aquatradehub Posted March 19, 2014 Author Solution Share Posted March 19, 2014 Its ok, worked it out<p>Number of customer reviews: <?php echo '<a href="reviews.php?username=' . $username . '">See customer reviews</a>'; ?></p> Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 19, 2014 Share Posted March 19, 2014 Because of your penchant to go into and out of PHP mode constantly, your error is because you are building that tag OUTSIDE of php mode. Better script organization and techniques would alleviate the need to use <? more than once in a script. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.