/    Sign up×
Community /Pin to ProfileBookmark

Dynamic pages

is that what you call that? a [B]dynamic pages[/B]?, how does it works? any samples? how can i make a link without posting the link page to the ADDRESS BOX.

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@webgovernorApr 21.2005 — Do mean web-pages generated by php (or other sss)...?

Like:

[code=php]<?php

$myVariable = 'THis is a variable.' ;

echo $myVariable; //make the variable appear on the page

//or even

echo "<b> $myVariable </b> <br />"; //make it bold

?>
[/code]



Maybe I don't understand what you mean...

Address box... I'm confused, I'll let someone else handle this one.

But hopefully my post helped???

Good Luck!
Copy linkTweet thisAlerts:
@ne3ro0authorApr 22.2005 — hmm. me too, i dont really understand what i mean.. just want to know how php scripts do something like this in the URL page when i click the home link:

>>> http://his-site.com/index.php?option=com_frontpage&Itemid=1

then when i click the second link in the navigation bar it look something like this in the URL box:
>>> http://his-site.com/index.php?option=com_content&task=section&id=4&Itemid=42

then so on, how can i do something like this without viewing the name of the page in the URL box. it only views the INDEX.PHP then some variables and numbers on it.?

is a PHP script do this one? do this called a dynamic pages?
Copy linkTweet thisAlerts:
@webgovernorApr 22.2005 — Oh, um

The symbols and words following a "?" at the end of a PHP represent

variables.

Vars start with a "&" or in html "&amp;"

So the url,

mydomain.com/file.php?var1=value1&var2=value2&var3=value3

See? Pretty simple.

TO access those vars in PHP you'd type something like this:

[code=php]<?php
$var1 = $_GET['var1'];

//or use the 'QUERY_STRING' method

//$var1 now hold the value "value1"
?>[/code]


As far as the page name inside the url box, I think it's pretty much required...

Well, i hope this helped.

Good Luck!
Copy linkTweet thisAlerts:
@ne3ro0authorApr 25.2005 — im kinda confused.. im new upon coding something like this. yeah that really help, i understand the flow, can u attach sample files, a simple 3 pages. if you dont mind. for my own purpose, so i can learn much of it. cause the problem of mine i just link the pages directly, which im viewing the name of the link in the URL box.

example:

index:

mydomain.com/index.php

when i click the 2nd link:

mydomain.com/link2.php

then i click the 3rd link:

mydomain.com/link3.php

etc.

did u get what i mean? i just want to hide the name of the page using variables as what u have said. like the samples you posted.

Thanks a lot.
Copy linkTweet thisAlerts:
@ne3ro0authorApr 25.2005 — http://ca.php.net/manual/en/tutorial.firstpage.php

Simple PHP tutorials.[/QUOTE]


i know how to create a page alright? what i mean is that creating a link without putting the name of the page in the URL box. just as variables and symbols.
Copy linkTweet thisAlerts:
@SheldonApr 25.2005 — I have a small idea of what you want,

instead of
index:

mydomain.com/index.php

when i click the 2nd link:

mydomain.com/link2.php

then i click the 3rd link:

mydomain.com/link3.php[/QUOTE]


You want:

mydomain.com/index.php

mydomain.com/index.php?page=1

mydomain.com/?page=2

mydomain.com/?page=3 and so on


Ok, try duplicate your index.php

rename the second to home.php or something.

in index.php

have



[code=php] <?


switch($HTTP_GET_VARS['page']){
case 'home':
include 'home.php';
break;
case '1':
include 'page1.php';
break;
case '2':
include 'page2.php';
break;
case '3':
include 'page3.php';
break;
default:
echo 'home.php';
break;
}


?>[/code]


then link your pages as http://mydomain/?page=1 or

http://mydomain/index.php?page=1



I hope this helps else sorry, read my caption below.


Sheldon
Copy linkTweet thisAlerts:
@scragarApr 25.2005 — you mean like on my site where my pages are all:

MyDomain.com?s=news

MyDomain.com?s=forum

MyDomain.com?s=forum/show/thread

? that's all done by including the pages like so:

[code=php]<?
$kat = $_GET['s'];
$path = "/home/www/includes";
if($kat != ""){
if($kat != "forum"){
$kast = @include $kat.".php";
}else{
$kast = @include $kat."/index.php";

if(! $kast){
echo "error: requested page cannot be found.";
};
}else{
include "news.php";
};
?>[/code]


EDIT: sorry, I never realsised you'd posted, or otherwise I wouldn't have.
Copy linkTweet thisAlerts:
@ne3ro0authorApr 26.2005 — 
I hope this helps else sorry, read my caption below.
[/QUOTE]


it really helps a lot, nothing to bother in you caption, Warcraft was a very nice game, so dont blame Blizzard Ent...

thanks that you get what i meant in my confusing question.. ?,

[B]Scragar[/B]

thanks for the help also, it gives me some of ideas in the code you've shared. but id rather used switch case cause it is much easier to use. but i appreciate the help.

[B]webgovernor[/B]

thanks also for the help... i scan the post you've shared.. i understand it now tru the help of the warcraft boy.. ?

THANKS TO ALL...

[B]thread is closed[/B] but any more postings will gladly appreciated..

God bless you all pips..
×

Success!

Help @ne3ro0 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...