FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » echo outputs null why?
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
echo outputs null why? [message #180649] Thu, 07 March 2013 20:13 Go to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
http://mroldies.net/urltest.php?rank=1

<?php

$rank=$_GET["rank"];

echo $rank;

if ($rank==1) {
$atitle="A Summer Place";
$cover="1960-001.jpg";
};

echo $atitle;
echo "<img src='http://mroldies.net/covers/$cover'>";

?>

I do not understand why $atitle is not being shown as it should be.

This is just an experiment.
Re: echo outputs null why? [message #180652 is a reply to message #180649] Thu, 07 March 2013 21:35 Go to previous messageGo to next message
David Robley is currently offline  David Robley
Messages: 23
Registered: March 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
richard wrote:

> http://mroldies.net/urltest.php?rank=1
>
> <?php
>
> $rank=$_GET["rank"];
>
> echo $rank;
>
> if ($rank==1) {
> $atitle="A Summer Place";
> $cover="1960-001.jpg";
> };
>
> echo $atitle;
> echo "<img src='http://mroldies.net/covers/$cover'>";
>
> ?>
>
> I do not understand why $atitle is not being shown as it should be.
>
> This is just an experiment.

var_dump($_GET);

To see what is there.

--
Cheers
David Robley

Help stamp out, eliminate, and abolish redundancy!
Re: echo outputs null why? [message #180658 is a reply to message #180649] Thu, 07 March 2013 23:36 Go to previous messageGo to next message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On Thu, 7 Mar 2013 20:13:48 -0500, richard wrote:

> http://mroldies.net/urltest.php?rank=1
>
> <?php
>
> $rank=$_GET["rank"];
>
> echo $rank;
>
> if ($rank==1) {
> $atitle="A Summer Place";
> $cover="1960-001.jpg";
> };
>
> echo $atitle;
> echo "<img src='http://mroldies.net/covers/$cover'>";
>
> ?>
>
> I do not understand why $atitle is not being shown as it should be.
>
> This is just an experiment.

figured it out.
I've figured out another way of handling my massive data problem and it is
so simple it's pathetic.
No array needed.
The page has a very small footprint compared to one with a large array.
Re: echo outputs null why? [message #180708 is a reply to message #180649] Wed, 13 March 2013 10:11 Go to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
On Thu, 07 Mar 2013 20:13:48 -0500, richard wrote:

> I do not understand why $atitle is not being shown as it should be.

Because $rank which is $_GET["rank"] is not ==1

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: In php applying the KISS rule wins every time
Next Topic: Re: Cloud Computing with PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Dec 18 13:45:03 EST 2017

Total time taken to generate the page: 0.00675 seconds