Jump to content

Php Variable Posting to Another Php Code Which Is at Different Directory


Must_ba

Recommended Posts

Hello guys ;

 

I want to send my arguments from  ; /usr/share/index.php  

In the ınsıde of this code I have variables like  $arg1,$arg2 and etc... so I need to post this $arg1 and $arg2 varible or which values that these arguments hold to another php code  

 

for example ; /home/root/helping.php 

 

I make some research but I didnt see the clear results or helping instructions about that . Is there any way to copy or post this $arg1 and $arg2 variables to the  helping.php ?

Can you help me about that ...

 

Thanks ..

 

Best Regards 

 

Must_ba 

Link to comment
Share on other sites

Your vague description doesn't help; show the concrete code.

 

And why on earth do your put your PHP scripts into the home directory of the root user? Are you running them as root?

Hello Jacques1 ;

 

index.php;

 

 
<?php
 
$arg1 = $_POST['input'];
$arg2 = $_POST['input2'];
echo exec("python /var/www/html/index.php.py ");
 
?>
 

helping.php ;

 

<?php 
$abc = ` echo '\x08\x08\xab' > /dev/ttymxc0 `;
echo $abc ;
 
?>
 

index.php at /usr/share/apache2/htdocs   path

 

helping.php is at  /home/root    path 

 

I'm taking for values when the zoom button is pressed , according to these values I m sending some data to serial port with helping.php .

 

But I need to send my arg1 (which is zoom ) values to the helping.php , because of doing this at root directory is : I can only send data to serial port from the root directory 

 

in other directories  it does not give the permission 

 

Do you have any suggestion ? 

 

Best Regards 

 

Must_ba

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.