php_begins Posted June 13, 2011 Share Posted June 13, 2011 I probably need synatx help or more: I have a page that has the following code for an image: <?php echo "<a href='".$gallery_folder.$photo_name."' >"; ?> <img src="<?php echo $imagespath.$row['Photo_path'].$row['Thumbnail1_name']; ?>" /></a> This takes you to this page: http://www.xyz.com/photo/a_home_a-433.html Now, i need to pass a variable to the above page so that when it redirects I get the following information on the URL: http://www.xyz.com/photo/a_home_a-433.html?album='some-album-name'. I tried different things but i am still getting an error in the page. This one of the things I tried: <a href="<?php echo $gallery_folder.$photo_name; ?>?album=<?php echo $category_name; ?> <img src="<?php echo $imagespath.$row['Photo_path'].$row['Thumbnail1_name']; ?>" /></a> I need help with the syntax. Quote Link to comment https://forums.phpfreaks.com/topic/239262-php-syntax-help-passing-a-variable-and-more/ Share on other sites More sharing options...
eMonk Posted June 13, 2011 Share Posted June 13, 2011 You can pass variables to new pages using sessions. Quote Link to comment https://forums.phpfreaks.com/topic/239262-php-syntax-help-passing-a-variable-and-more/#findComment-1229212 Share on other sites More sharing options...
php_begins Posted June 13, 2011 Author Share Posted June 13, 2011 I do not want to use sessions. I retreive the value in $category_name. I am not able to pass it though with the correct syntax. Quote Link to comment https://forums.phpfreaks.com/topic/239262-php-syntax-help-passing-a-variable-and-more/#findComment-1229221 Share on other sites More sharing options...
kenrbnsn Posted June 13, 2011 Share Posted June 13, 2011 Please post the exact code you've tried between tags. And and error messages you've gotten. Ken Quote Link to comment https://forums.phpfreaks.com/topic/239262-php-syntax-help-passing-a-variable-and-more/#findComment-1229229 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.