Call PHP Functions with a HTTP request?
#1

Hey,
I am not really experienced with the function "HTTP" but I did get it working some time ago, using a PHP file.

Now, I wanna try it again, but in this case I want to call a specific function inside a PHP file. Is that possible?

PHP Code:
<?php
    
function f1() {
        ....
Something here
    
}
    
    function 
f2() {
        ... and 
something here
    
}
?>
Would it be possible to call a single function with sending a threaded HTTP Request?

Thanks.
Reply
#2

PHP Code:
<?php
    
function f1() {
        ....
Something here
    
}
    
    function 
f2() {
        ... and 
something here
    
}
if( 
$_GET['func'] == )
{
function 
f1();
}
else if( 
$_GET['func'] == )
{
function 
f2();
}
?>
So for example, if php file was called samp.php

If you called samp.php?func=1 the first function would be called etc.

Quote:

This forum requires that you wait 120 seconds between posts.

Reply
#3

Quote:
Originally Posted by Limex
View Post
PHP Code:
<?php
    
function f1() {
        ....
Something here
    
}
    
    function 
f2() {
        ... and 
something here
    
}
if( 
$_GET['func'] == )
{
function 
f1();
}
else if( 
$_GET['func'] == )
{
function 
f2();
}
?>
So for example, if php file was called samp.php

If you called samp.php?func=1 the first function would be called etc.
Ah thanks a lot! That's exactly what I've meant.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)