Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2007, 01:45 PM
Registered User
 
Join Date: Jul 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cool, looks good DJ. Thanks!

One thing though. Before i saw the javascript way you've shown (which would solve this problem), I was trying out a bit more of php and came accross a problem that is bugging me.

Code:
$ThisCategory=$_GET['Category'];
$Category = $ThisCategory;
$ThisPicture=$_GET['Picture'];

echo "<img src='images/$ThisCategory/$ThisPicture' width='353' height='280' alt=''></td>"  ;
On the left side of the page are links (Family, friends, places, etc..) and at the top are more links. What i wanted was for the user to click a link on the right and the $ThisCategory will be set, then the user will click on one of the links at the top of the page (Each numbered 01, 02, 03 etc..) and the $ThisPicture will be set, so i can pull only the pictures for that category.

Code:
<a href='http://localhost:8080/Website.php?Category=Photoshop'>
Is the link to set the Category field.

Code:
<?php
echo "<a href='http://localhost:8080/Website.php?Category=$ThisCategory?Picture=01.jpg'>";
?>
Is used for the 01, 02, 03 etc.. links at the top. However, I can't seem to keep the value of $ThisCategory? What am I doing wrong? Its just something i need to know.

A true friend stabs you in the back
 
Old July 12th, 2007, 02:47 PM
Registered User
 
Join Date: Jul 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry, got a bit of the code above wrong.

Code:
echo "<a href='http://localhost:8080/Website.php?Category=$ThisCategory&Picture=01.jpg'>";
Is what it should have been.

Also, Its worth mentioning again that i'm linking to the same page so in effect refreshing it. Thats why i cant figure out how to keep the value of $ThisCategory, otherwise it would be fairly simple.



A true friend stabs you in the back





Similar Threads
Thread Thread Starter Forum Replies Last Post
changing the place of the tag rajesh_css XSLT 3 October 30th, 2008 08:35 PM
Want to pass value at href in anchor tag on xslt Abhinavnaresh XSLT 4 February 21st, 2008 04:32 AM
Changing variables in match templates chicken XSLT 0 September 11th, 2006 10:26 AM
changing the value of variables in PHP jflores1 PHP How-To 1 January 8th, 2006 12:09 AM
Placing <a href etc. in PHP scripts mercury7 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 21st, 2003 07:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.