Sponsored Content
Top Forums Shell Programming and Scripting Running php index.php as shell in webpage Post 302983132 by Akshay Hegde on Thursday 6th of October 2016 05:06:32 PM
Old 10-06-2016
PHP Code:
<?php
// in your index.php

$get=escapeshellarg(serialize($_GET));
$post=escapeshellarg(serialize($_POST));

// execute like this
exec("php /tmp/test.php  '$get'  '$post' 2>&1"$out$return);


?>
PHP Code:
<?php
// In your script

$get_array unserialize($argv[1]);

$post_array unserialize($argv[2]);
?>
---------- Post updated at 03:36 AM ---------- Previous update was at 03:13 AM ----------

It may be difficult for you to rewrite code for form and user management for example file upload,session,cookie etc, if you can explain your aim, there can be some simple solution for the same.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PHP: problem with index.php

iam geting a error with this index script. heres the error Parse error: parse error in c:\phpdev\www\dev\compulearn\in work\index.php on line 39 Whats wrong?? ------------------------ <?php //display header and left bars include ('header.php'); include ('left.php'); //connect... (13 Replies)
Discussion started by: perleo
13 Replies

2. UNIX for Advanced & Expert Users

which access right should set in my webpage index.html ?

I have a webpage, http://my.dns.com/~zp523/index.html, I want all people to have read and execute privileges. I want to extend it with execute privilege. Which command should be used in chmod? is it only give read(r) & execute(x) parameter in 'chmod ??? index.html' thk a lot!! (1 Reply)
Discussion started by: zp523444
1 Replies

3. Shell Programming and Scripting

Calling an Expect script from a Webpage using PHP

I have a webpage that is in HTML and PHP. In PHP I have tried using exec, system, shell_exec and passthru functions to call an Expect Script file (temp.exp). This Expect file spawns a telnet session that uses "expect/send" commands to retrieve information from an environmental unit (not a normal... (0 Replies)
Discussion started by: CCUSmith
0 Replies

4. Web Development

php script + not displaying webpage

Hi guys Im in the process of designing a website for my company which does the following 1) Daily execution a perl script. The perl script's output is diverted to a .html file. 2) The .html file generated from 1) sets up a centralised webpage showing options as radio buttons (the radio... (1 Reply)
Discussion started by: JamesGoh
1 Replies

5. Web Development

I can't open my index.php page after insert php code

Hello guys, Does anyone can help me? I've just made my simple index.php without any code, but after insert session code to check if any user is authenticated, my index.php doesn't work anymore. Any fresh eyes could help me to see what and where the code is wrong? <? if... (6 Replies)
Discussion started by: metalfreakbr
6 Replies

6. Web Development

[php] webpage with login & mysql-db

Hi all, What I was looking for before was a multi-user password manager, web-based! The offer of free or cheap tools of this kind is very pover. Or they are too complex (or too expensive) I'm not a web programmer but I now decided to set up a (php) website with login and based on this login... (1 Reply)
Discussion started by: thibautp
1 Replies

7. UNIX for Advanced & Expert Users

Running multiple php scripts into one php only, cron mail alert problem...

hi, while separated they produce the usual mail alert and i can see the output... if i write into the php script: <?php system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script1.php'); system('php -f /var/www/vhosts/domain.com/httpdocs/folder/script2.php'); system('php -f... (0 Replies)
Discussion started by: 7stars
0 Replies

8. UNIX for Dummies Questions & Answers

How to submit form on an php webpage from command line?

Hello, i have page domain.com/form.php the form fields on form.php are named: name=ipaddress name=port and submit button is named: submit i want to ask how the linux command will look like to submit the form filled with: ipaddress: 127.0.0.1 port: 80 I tried various curl and... (5 Replies)
Discussion started by: postcd
5 Replies

9. Shell Programming and Scripting

Executing Shell Script from PHP Webpage

Hello , I am trying to execute a small shell script from a PHP Webpage. Below is the shell script : 1.sh $ cat /home/oracle/rahul/1.sh #!/bin/ksh echo "`date` : Report generation in progress" > /home/oracle/rahul/report.txt echo "Run successfully script"; Below is the PHP... (1 Reply)
Discussion started by: rahul2662
1 Replies

10. Web Development

Display received sms on webpage - php

Hello, Scenario: Send sms from putty and display it on webpage. I have rented an short message service from a company and set callback url to my vps. PHP is installed in my vps . my mobile phone is: ********85** receipent mobile phone is: 49********* callback url is redirected to... (0 Replies)
Discussion started by: baris35
0 Replies
APACHE_LOOKUP_URI(3)							 1						      APACHE_LOOKUP_URI(3)

apache_lookup_uri - Perform a partial request for the specified URI and return all info about it

SYNOPSIS
object apache_lookup_uri (string $filename) DESCRIPTION
This performs a partial request for a URI. It goes just far enough to obtain all the important information about the given resource. This function is supported when PHP is installed as an Apache module or by the NSAPI server module in Netscape/iPlanet/SunONE webservers. PARAMETERS
o $filename - The filename (URI) that's being requested. RETURN VALUES
An object of related URI information. The properties of this object are: ostatus othe_request ostatus_line omethod ocontent_type ohandler ouri ofilename opath_info oargs oboundary ono_cache ono_local_copy oallowed osend_bodyct obytes_sent obyterange oclength ounparsed_uri omtime orequest_time EXAMPLES
Example #1 apache_lookup_uri(3) example <?php $info = apache_lookup_uri('index.php?var=value'); print_r($info); if (file_exists($info->filename)) { echo 'file exists!'; } ?> The above example will output something similar to: stdClass Object ( [status] => 200 [the_request] => GET /dir/file.php HTTP/1.1 [method] => GET [mtime] => 0 [clength] => 0 [chunked] => 0 [content_type] => application/x-httpd-php [no_cache] => 0 [no_local_copy] => 1 [unparsed_uri] => /dir/index.php?var=value [uri] => /dir/index.php [filename] => /home/htdocs/dir/index.php [args] => var=value [allowed] => 0 [sent_bodyct] => 0 [bytes_sent] => 0 [request_time] => 1074282764 ) file exists! PHP Documentation Group APACHE_LOOKUP_URI(3)
All times are GMT -4. The time now is 11:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy