Hi All! What is return arrey ? Am I can this from this function ? This is php code <?php echo '<table>'; echo '</table'; $done = 'Saved'; echo $done; ?> PHP: I want that $done String Will Show On Top On Table; Like This, <?php echo $done; echo '<table>'; echo '</table'; $done = 'Saved'; ?> PHP: Please Help Me
Its A Code <?php include ('header.php'); echo '<form> <input name="GMF" /> <input /> </form>'; if ($_GET['GMF'] == "php") { $test = 'Testing'; } PHP: Now I Want tO Show $test Message Above <form> <input name="GMF" /> <input /> </form> Code (markup): Let C, <?php include ('header.php'); echo $test; echo '<form> <input name="GMF" /> <input /> </form>'; if ($_GET['GMF'] == "php") { $test = 'Testing'; } PHP: But Nothing Shown
You need to echo $test at some point I'ts good practice to process your $_GET variables at the beginning of the script and then echo out the variables afterwards.
Of course there is, I don't totally understand what you are trying to do but I hope I've pointed you in the right direction. It might pay to look up some beginner php tutorials and follow them through just to get some skills before writing your own scripts.
include ('header.php'); if ($_GET['GMF'] == "php") { $test = 'Testing'; } echo $test; echo '<form> <input name="GMF" /> <input /> </form>'; PHP: Whatever this is, you have misunderstood something.
remember that php code by default is procedural, and is read from left to right top to bottom. $test is unset from where you want it
I Have Already Done That, That Confusion Was In My Mind, I Post That Here, As bartolay13 Said, Php Read Top tO Bottom, Now I Understand ..
Yeah everything needs to be in order. You can't echo $test until you set it first. I would echo it inside your if statement though because the variable is not set if $_GET['GMF'] does not equal "php"
include ('header.php'); $GMF = (isset($_GET['GMF']) ? $_GET['GMF'] : ""; if (isset($_GET['GMF'])) { if ($_GET['GMF'] == "php") $test = 'Testing'; } echo $test; echo '<form> <input name="GMF" /> <input /> </form>'; PHP: or include ('header.php'); if (isset($_GET['GMF'])) if ($_GET['GMF'] == "php") echo 'Testing'; echo '<form> <input name="GMF" /> <input /> </form>'; PHP: or include ('header.php'); $GMF = (isset($_GET['GMF']) ? $_GET['GMF'] : ""); if ($GMF == "php") echo 'Testing'; echo '<form> <input name="GMF" /> <input /> </form>'; PHP:
xxxize, no need for the short writing and and then making another if clause. if you use the shorthands, write it all in one include ('header.php'); $test = (isset($_GET['GMF']) && $_GET['GMF'] == "php") ? 'testing' : ''; echo $test; echo '<form> <input name="GMF" /> <input /> </form>'; PHP:
Yes, you have right.. this was my first view. But he check if GMF is "PHP" and printing "testing".. not the same value.