New to php, index.php?func=blahh
Moderator: General Moderators
New to php, index.php?func=blahh
posting.php?mode=newtopic&f=1&sid=2c0ec ... 75fa3d11c5
^
posting.php?mode=newtopic
how do you do that? like the ?something=function part
Thanks =)
^
posting.php?mode=newtopic
how do you do that? like the ?something=function part
Thanks =)
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
?
The ?mode=something means that in the file.php code there will be a variable:
$_GET['mode']
whoch will have a value of "something". It lets you feed data into your scripts.
http://www.php.net/tut -> PHP tutorials
Wohoo! 1000 posts
Code: Select all
<a href="e;/dir/file.php?mode=something"e;>link</a>$_GET['mode']
whoch will have a value of "something". It lets you feed data into your scripts.
http://www.php.net/tut -> PHP tutorials
Wohoo! 1000 posts
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
The link I posted above. It goes through a whole tutorial on PHP starting from very basic writing "Hello World!" in PHP to using forms to process data and using $_GET (which is the question you asked - even if you don't see it just yetsoul814 wrote:Searching on google about that, but I dont get it, I just started to learn about php can you give me a small sample code?
PHP.net will be your biggest source of help for PHP. Next, there's the guys here
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Example code:
I have a file called script.php....
and I go to this URL:
and the output is
Test it (edit the URL here to be whatever word you like):
http://www.chriscorbyn.co.uk/phpdn/words.php?word=Hello!
I have a file called script.php....
Code: Select all
<?php
$word = $_GETї'word']; //Gets the word from the URL
echo $word; //Writes the word to the page
?>Code: Select all
http://mysite.com/script.php?word=Hello!I've put a script up for you (containing that exact code above).Hello!
Test it (edit the URL here to be whatever word you like):
http://www.chriscorbyn.co.uk/phpdn/words.php?word=Hello!
ohh so if i want to run a function i would do something like
Code: Select all
<?php
$func = $_GET['func'];
if($func == "loadDB")
{
loadDB();
}
function loadDB()
{
// code
}
?>- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
http://www.securiteam.com/securityrevie ... 1P76E.html
looks complex but how would they modify my $_GET?
i was planning to do it something like this
looks complex but how would they modify my $_GET?
Code: Select all
function sendInfo(){
$firstName = $_POST['fname'];
$lastName = $_POST['lname'];
// db command
}some hints if you want communication between php and flash 
http://www.amfphp.org/
http://ghostwire.com/resources/phpobject/
http://www.amfphp.org/
http://ghostwire.com/resources/phpobject/