Help!! with php code

Started on the old forum in June 2010 · view the original in the archive · old links redirect here

8 replies · 355 views · started 16 years ago · 1 min read

4 participants
hoyme Junior · 15 posts #1

Any 1 knows how to make pages lyke page.php?page=1&id=1&act=yes

Shifty Junior · 33 posts #3

really, use get method and your forms have to take names like parameters at get-query... or... use links 😉

CreativityKills Lead · 833 posts #4
<?php
$page = $_GET['page'];
$id = (int) $_GET['id'];
$act = $_GET['act'];

/// Use this block of if...else statements
if($page == 'about')
{
 echo 'about page';
}
elseif($page == 'sh!t')
{
 echo 'sh!t page lol';
}
else
{
 echo 'default landing page';
}

// ...or use this block of switch...case statement
switch($page)
{
case 'about':
echo 'about page';
break;
case 'sh!t':
echo 'sh!t page lmao';
break;
default:
echo 'default landing page';
break;
}
?>

that easy.

hoyme Junior · 15 posts #9

Thanks mobileGIGS, how will link it in d url

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close