Jump to content


Photo

URL adone


  • Please log in to reply
5 replies to this topic

#1 smardy

smardy
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 11 February 2005 - 10:19 PM

How do get something that like when you click say a link that takes you to test.php and will say HI on the page. But Iv seen stuff on sites where you go to a link to that test.php exept its test.php?test and the page would say HI HOW ARE YOU insted of HI... How do you do that?

#2 ashoogy

ashoogy
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 13 February 2005 - 02:26 PM

Hi there,
can you be more specific? I understand nothing

I can not help you if you don't clarify things?

regards,
Ashoogy

#3 dEcade

dEcade
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 March 2005 - 05:57 PM

How do get something that like when you click say a link that takes you to test.php and will say HI on the page.  But Iv seen stuff on sites where you go to a link to that test.php exept its test.php?test and the page would say HI HOW ARE YOU insted of HI... How do you do that?

View Post



<?
if(!$test){
echo 'hi';
}
if($test == php){
echo 'welcome to PHP!';
}
?>
Hope that helped

#4 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 23 March 2005 - 10:20 PM

1) This question is not related to Dreamweaver.
2) Read the FAQ, a book, or php.net.
3) dEcades code will not work.

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 25 March 2005 - 02:59 PM

<?
if(!$test){
echo 'hi';
}
if($test == php){
echo 'welcome to PHP!';
}
?>

Yes this won't as you haven't defined any _POST or _GET variables. Or your PHP configuartion has register_globals on.

<?php
if(isset($_GET['test']) == "hi")
{
    echo "hi, how are your?";
}
else
{
    echo '<a href="'.$_SERVER['PHP_SELF'].'?test=hi">Click to see a message</a>';
}
?>


#6 smardy

smardy
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 March 2005 - 04:24 PM

I have got it figured out but now I am wondering how do you get it so that in your browser it will be something like calendar.php?cal=2005&month=feb I can get it to do that except if I have echo on the variable cal=2005 then it will show up when I put the cal=2005&month=feb plus the text that I want to echo back when you type that it so how can I get it so that cal=2005 will echo back as say calender and cal=2005&month=feb will just echo back with other next nothing that is on the cal=2005

here is my script
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]
if( !$cal )
{
    echo \"Calender\";
}
if( $cal == 2005 )
{
    echo \"Choose a month\";
}
if( $cal == \'2005\' && $month == \'jan\' )
{
    echo \"January\";
}
[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users