Jump to content

$_GET stuff


Ph0enix

Recommended Posts

Hi, im still learning PHP and iv just started to learn about the $_GET thing.

To test it i used this:

[code]<?php
print $_GET["test"];
?>[/code]

So then if i typed in my address bar

[a href=\"http://localhost/stuff/page.php?test=hello\" target=\"_blank\"]http://localhost/stuff/page.php?test=hello[/a]

Then i would get a page that displays "hello".

But i want to know how do i call a function.

So if i used this code for example.


[code]
function square_number($number) {
  
  $square= $number * $number;
  return $square;
}
[/code]

How would i call this function, so on the page it would show the result of this function.
Thanks.
Link to comment
https://forums.phpfreaks.com/topic/12864-_get-stuff/
Share on other sites

Ok thanks.
But erm isnt there somthing i could write in the address bar to veiw the result of the function like..

[a href=\"http://localhost/stuff/page.php?test=function(sqare_number)\" target=\"_blank\"]http://localhost/stuff/page.php?test=function(sqare_number)[/a]
(i know this is wrong)

Cause on Postnuke you have to do something like this to display a function
Link to comment
https://forums.phpfreaks.com/topic/12864-_get-stuff/#findComment-49358
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.