Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
sending a variable in a link
Old 08-08-2004, 11:01 PM sending a variable in a link
jake5253's Avatar
Average Talker

Posts: 27
Location: Pennsylvania, USA
Trades: 0
PHP Code:
<?php
$picture_source 
$_GET['src'];
?>
<html>
<body>
<img src="<?php echo $picture_source ?>">
</body>
</html>
This was posted in another thread, how do you get that to include another php page?
jake5253 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-09-2004, 03:14 AM
Ultra Talker

Posts: 377
Trades: 0
you need to send a variable to a page? you may do it like a
<a href=yourpage.php?yourvar=yourvalue>

or you may send it trough standard form....
__________________
andrews_john

Please login or register to view this content. Registration is FREE
andrews_john is offline
Reply With Quote
View Public Profile Visit andrews_john's homepage!
 
Old 08-09-2004, 07:39 AM
Unknown.

Posts: 1,693
Trades: 0
If you want to include a php page depending on the varibale...

this hould help...

PHP Code:
<?php
 $page 
$_GET['page'];

//What to do if no page is specified in the variable
if (!$page){

$page 'mainpage.php';

}

//include the page
include $page;
?>
This way if you typed..
pagename.php?page=page.php
it would inlude the page.php page

But if you want it so that you can type..

pagename.php?page=page1
pagename.php?page=page2

etc.

and you can then specify what page loads...this would do...

PHP Code:
<?php
 $page 
$_GET['page'];

//What to do if no page is specified in the variable
if(!$page){

$page 'mainpage.php';

}

if(
$page == page1) {

$page 'pagenumber1.php';

}

if(
$page == page2) {

$page 'soemotherpage.php';

}

//You can then add as many more pages you want in the same way

//include the page
include $page;
?>
So if you typed..
pagename.php?page=page1
it would load pagenumber1.php

Hope this makes sense

Need any more help just ask

-James
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to sending a variable in a link
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18676 seconds with 12 queries