Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Sessions? External Program / External Program


I am trying ac ouple of days now to learn some things on SESSIONS,but I think I am not getting it very clearly. I have a PHP page tha contains a form.

Users enter data in the form, which are then written in a file (the file is created at the time a user enters some data) The file is then given as an input to an external program The external program runs and gives some results which are then stored in another file (that is created when the external program finishes) What I want to do is to somehow create these files and, when the user exits from the browser, then both files that refer to this user, will be deleted. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
External Program Via PHP
I need to execute a command-line program through PHP. I have a form which includes a textarea, where the user writes his data. These data will be used as input for the commend-line program. Will I go something like:

$data = $_GET['info'];

Which function shall I use? System, exec, shell_exec, passthru? I can't choose which one is the correct. By the way, the command which I use when I write the script in the command line is :

program_name [argument1 -> A database file] [argument2 -> info supplied by user]

So, in the function that will be used, the data supplied by the user will be passed as my second argument (the 1st argument is a file in my hard disk). And, lastly, do I need to change any global settings for PHP in order to perform such actions, ie running scripts via PHP programs?

View Replies !
How To Run External Program
i would like to use php to run external program in window environment like open a macro program to let it run at window background.

I try to use exec to run the window command, it works, but when i try to use exec to
run other program, like this..

exec("run xxxx.ttl") // xxx.ttl is a macro

the php will hang... anyone has sample on how to use php to run external program in window environment??

View Replies !
Opening An External Program
I was wondering if there was a way to be able to create a PHP program that when you click on a link or image on a webpage that it would automatically open up an application in the client's computer.

I have a webpage that is sort of an 'engineering catalog'. Each item on that catalog is linked to a downloadable file. When a user clicks on this item, it should be able to open an engineering application, and pass the downloadable engineering file from the webpage into the engineering software application. Any ideas?

View Replies !
How To Launch External Program
somebody know how to lauch external program? for example: i will open my browser, click one image of that web page and then the application (i.e media player )of my local pc will pop up and ready to use.

View Replies !
Execute External Program
I need to execute a command-line program through PHP. I have a form which includes a textarea, where the user writes his data. These data will be used as input for the commend-line program. Will I go something like: Code:

View Replies !
Exec() Call To External Program
We are trying to use the exec() or system() calls in a php script. The program we are trying to call takes 1 parameter in the form of: email@domain.com[usercode]

There are no spaces in the parameter at all and we have tried placing quotes around just to see if it mattered. We have also modified the parameter just to send it hello. Here is what we get: With no parameters the php script executes the program where it displays the error message from the program stating that not enough parameters were supplied. We then add the word "hello" to the end after a space so the command looks like this: command "hello" and the program no longer executes at all. No matter what we do, if we supply an argument to the command the php code will not execute the program.

View Replies !
How Do I Make Sure That An External Program Does Actually Exists?
web host said there is a program /usr/bin/convert I can use to convert image files, after I call it in my code, it does not seemed to be doing anything. I'm sure the command line is right because I echo the commandline to make sure. How do I make sure that an external program does actually exists? I use if (file_exists "/usr/bin/convert")), is there any othe way? Or am I doing something wrong that the system call is not working? For example:

//convert test.jpg to converted.jpg
$command = "/usr/bin/convert "test.jpg" "converted.jpg"";

echo $command;

system($command);

View Replies !
Start External Program (winamp)
I have my own PHP/apache/mySQL server at home with public IP address and I have my personal page there. I wan't to have a button (input type button) and a PHP function -> onClick start external program and end srcipt. I've tried do it with Exec and fopen functions but it freezed and didn't run the program Code:

View Replies !
Problem Calling External Program
have a little problem with exec/passthru or similar. I need to open an email-client from php to send an email. One would now ask why not use a normal phpmailer.

It is only for use on my personal computer, and if needed I need to be able to change some input before sending the mail. The Client is KMail on SUSE 9.1. Code:

View Replies !
Exec() - Running An External Program From Inside PHP.
I'm having difficulties running an external program from inside PHP. I'm trying to create thumbnails using ImageMagick's convert utility using the following program: PHP Code:

View Replies !
Call Exec To Run An External Program Through A Form
I have problem with "Exec" function in PHP5. When I call Exec to run an external program through a form, it fails but when I run my PHP page by PHP interpreter like: PHP MyPHP.php it just works fine and external program executes successfully.

View Replies !
Two Sessions: Session A By A Program Destroys Session B By A Program
I have two separate programs that I want to use together on a website
Program A starts first and calls session_start(). Program B is started by the user clicking on a link and it also calls session_start(). The session started by program B blows away the session started by program...

View Replies !
PHP Running Exec() Windows Program Very Slow In Comparison To UNIX Equivalent Program
Does anyone have an explanation or solution for the following.
I have a PHP script that uses exec() to call a program to do certain
calculations.

The UNIX version of this program I call runs in about 4 to 5 seconds.
When I run the same PHP script using exec() to call the Windows equivalent
of this same program on my Windows desktop, it takes about 32 seconds....

View Replies !
Problem With Sessions / External Javascript Files In IE6 Only
I have a very frustrating problem. I have been trying to make it more
difficult to access external javascript files by using PHP sessions.

This works beautifully locally (both in IE6 and IE7) and online in IE7,
but frustratingly, online in IE6, the javascript does not render on the
page, unless you refresh the page.

Is there something different about the way IE6 handles sessions? Why
would it work locally but not online?

View Replies !
How To Call *.exe Program From Php Program
I have a php program, and from that program I wanna call C program that counts number of visitors on my page.

This is a piece of my program:

View Replies !
External Url
I have tried to make a script, that checks the external url from a popup, but i just get permission denied in javascript. But can this be done in php?

View Replies !
Getting External Ip...
how would I get the External IP of the computer running the php script, and store it in a var named curIP?

View Replies !
External RSS
I am using PHP to parse some RSS feeds that appear on my home page. The problem is, if one of these feeds hosts is slow, it slows down my page load time. Is there a way to set a time out, so if that RSS feed isn't loaded within a certain it can be skipped.

View Replies !
Loading External Dll
I extract the php-4.0.4pl1-Win32 into my local PC C:php directory. I follow all the instruction in install file and find that the php script work. Then i go to uncomment the entension for external dll that needed in win.ini and also change the path extension_dir=C:phpextensions.

the problem is each time i load the php script, it will prompt out the error message "unable to load dynamic library "c:extensionsphp_oracle.dll". can some one help me to resolve this problem?

View Replies !
External DOMEntity's
I have a question about PHP5's DOM, but I found the docs on this section are either incomplete or incorrect (e.g. wrong return types for several functions). How can external entities, or entities in general, be added to a DOMDocument? (I'm not asking about adding entity references because DOMDocument->createEntityReference works like a
charm.)

I should probably state the details around the problem: I am working on a templating engine that utilizes PHP5's DOM interface (http://xire.forizon.com for details) so for caching purposes if I can make the output document include cached versions of other templates via external entities (XInclude is already used, but not it isn't supported
very well on the client side), then any client-side caching can also be utilized.

View Replies !
External PDF File
Is there a way for me to be able to fetch a PDF from another site and display it on my website without having to open up Adobe Reader?

In other words, I would like to have this PDF document: http://flightaware.com/resources/airport/ASE/APD/AIRPORT+DIAGRAM/pdf

to be displayed on a page when a user opens a page on my website.

View Replies !
OO External Template
I am trying to figure out how to make an external .tpl file with all the HTML and call it from the Object. Code:

View Replies !
Url In An External Php File
Situation: I have an external php file with a function in it that returns a value with document.write like this:

<?php
Header("content-type: application/x-javascript");

function myfunction()
{
return $something;
}

$some_variable=$something;

echo "document.write("Some_Text: " . $some_variable . "")";
?>

When called remotely by javaScript, the php function behaves perfectly returning the desired variable:

<script> type="text/javascript" src="http://www.mydomain.com/remote.php"></script>

The Problem:

I would like to display the "Some_text:" part with an active link as in
<a href="http://www.yourdomain.com/">Some_text</a>

So that when executed, the JavaScript displays the link with an anchor text. How can I write this code into the echo document.write function?

View Replies !
External JavaScript
I am using phpBB and wanted to display latest poll in phpBB to my home page. My home page is html extention and want to use java to call it and display it. I am stuck with these codes;

php codes;
<? php
SOME, SOME....
{
echo "document.write('$poll['options'][$i]['vote_option_text']');";
} ?>

if ['options'] then will not print anything, if I remove ' ' then print something. However if I put all 4 items ('$poll['options'][$i]['vote_option_text']');"; without ' ' inside of [ ] it will print like;

Array[0][vote_option_text]Array[1][vote_option_text]Array[2][vote_option_text]Array[3][vote_option_text]Array[4][vote_option_text]Array[5][vote_option_text]

What is correct syntax?

View Replies !
Getting External Data
I am logged in to Yahoo with my Yahoo ID, and I visit:

http://baseball.fantasysports.yahoo.com with my browser, it will tell me which Fantasy Baseball leagues I am in, and allow me to click on one to enter the league page.

I figured therefore, that if I were already logged in, that the following code, would display the same page (i.e. I would be able to see which leagues I am in):

$remotefile=fopen('http://baseball.fantasysports.yahoo.com/','r');
while (!feof ($remotefile)) {
$line = fgets($remotefile);
echo($line);
}

Unfortunately, the resulting page asks me to sign in, and doesn't display the desired leagues. But I AM still logged in to Yahoo. If I were to try to visit:

http://baseball.fantasysports.yahoo.com again in my broswer, it knows I'm still logged in and displays my leagues.

View Replies !
External Banner
we are building a large agency website and are looking for a php code that a agency can copy to their website to display our banner so they get their free account, in our admin panel we want it to automatically check our code is on their site and as soon as it is removed it changes status. Maybe in admin it shows green button when it is on and when it is removed changes to red, as we have far to many to manually check daily.

View Replies !
External Programs
I have just installed my first Linux distribution (SUSE 10.0). Everything is compiled as far as Apache, Mysql & PHP is concerned. But, I have this problem: I call system commands through PHP using system, shell_exec etc The thing is that PHP responds OK when it comes to 'ls' or 'grep' or 'wget', but, in another program, not UNIX-native, there is no response. I am sure that the program is set up in the PATH, because, if I open a terminal, I can call it from everywhere and it works fine.

View Replies !
External Variables
It's probably not called an external variable... but this is what i need. I have a new design that uses a template... so it works like this:

call up index.php (containing variables like content), this includes the template.php (includes the "backbone"). Now the template also calls up a few other pages (like the header, sides and bottom) but I need it to call up something else.. Code:

View Replies !
External Script
I have a script which reads a data file, reads the characters one by one and if a certain character is meet it does something else, at the moment it echos the fact that it meet a certain character. I need it to take the characters it has read up to that point and present them to a database field thats forms part of a set of fields that will be updated at once. Then it will continue to read the remainder of the file and
repeat the process until it reaches eof. Is there something similar to goto or gosub, I did some checking and was laughed at, as you can probably tell I'm a newbie. Maybe I should be calling an external script.

View Replies !
Output As External XML
the following code runs a query on a database and outputs the results as XML within its self. I have attempted to get the php page to create a file called rss.xml but have failled.

I have tried using $file= fopen("rss.xml" , "w"); but my knowlege of PHP wouldn't be the best or anyway near to the level of being able to modify the below page to do as i wish, would someone be able to take a peep at the page Code:

View Replies !
PHP Used As A CGI Program
Manual for odbc_pconnect states: "Persistent connections have no effect if PHP is used as a CGI program." As I have just installed PHP on a PC with an Apache server, how does one tell if it is used as a CGI program, and if so, how does one confiure it not to be?

View Replies !
C Program And PHP
I have written this function in a C program, using Visual Studio. The
PHP script executes fine, but the output is not displayed. I have
been racking my brains for hours trying to figure this one out. The
output from the php program should print to a file called 'out.txt'.
The file is successfully created, but with no content. I am pretty
sure it's the way PHP returns the results. Does anyone have any
ideas? Any help would be most appreciated.

int passCode(void)
{
FILE *phpFile, *out;
size_t len;
char buffer[1000];

phpFile = popen("php -f testing1.php", "r");
if (phpFile)
{
out = fopen("out.txt", "w");
len = fread(buffer, 1, sizeof(buffer), phpFile);
fprintf(out, buffer);
fclose(out);

pclose(phpFile);

return 1;
}
else
{
return 0;
}
}

View Replies !
How To Use ? And : In A Program
in the program below, what is the meaning/use of
the question mark (?gcd) and the colon (:$a) after the return statement?

<?
$x=32;
$y=80;
function gcd($a, $b)
{ return ($b>0)?gcd($b,$a%$b):$a;}
$val=gcd($x, $y);
print "The greatest common denominator of $x and $y is $val";
?>

This recursive program is used to find the greatest common denominator of 2
numbers.

View Replies !
How To Program OOP
I use OOP for a PHP Application Framework I am programming. I have one base class which includes all the necessary functions and variables which all the other classes use. So what I originally did was that I made an instance of the base class and passed it to the other classes. Now someone insisted that this is not the way to do it.

so I used 'extends base' to make the base class available to the other classes. Afterwards it worked fine, but it didn't make the code smaller nor did it result in faster speed. I used the benchmarking script from PEAR. So I wonder whats the difference between those two solutions, both work fine. Are there some tools to analyse how much memory a script uses?

View Replies !
Run A Program.
I am using

system('GPA.exe ' . $filename);

to run a program GPA.exe

this program do the following things. ../GPA.exe filename.txt and will generate another file. HOWEVER, the problem is, there is no new file generated and I doesn't get an exception. I don't know why. Can somebody give me a clue?

View Replies !
Sig Program
I ran across a very cool little program today that I think I can reproduce for something I need on my site using PHP.

http://www.danasoft.com/customsig.php

How do they give the URL a .jpg extension and still be able to have it run a PHP script and send a JPG back to the browser?

View Replies !
Non-PHP-program To PHP/cgi
I read a POST-request from a Web-client over a socket and will pass this request to a PHP/cgi-Modul, to get PHP's generated HTML-stream. The request contains formular parameter and the data from an uploaded file. I copy the parameter-names and the values and pass them to PHP. This works fine, but I don't know how to tell PHP, it may read the data from the uploaded file.

View Replies !
PHP Program
I have a client that pretty much needs an admin program for their site. They are a local radio station. They want to be able to create forms within their website admin so they don't have to copy and paste code. They have no programming experience. NONE. They also want to be able to access their database to view content submitted. They send out birthday e-cards and all that junk. So does anyone know of a program that can do this?  They have a thing like this in iHTML, but it's gettin spammed all to hell and they want a more secure route.

View Replies !
An External Checker(-script) For A CMS???
I am looking for a way to check all external links on a website on deadends.

View Replies !
How To Make Sure External URL Is Reachable?
Is there any simple method in php to determine if a url from a website is reachable?

This is so that if your website has to load content from another URL, is there a failsafe method for the other parts of your website to load even if that one part is down?

View Replies !
XML Form Post To External URL
I'm far enough along in PHP to know how to create input forms, grab the form input as $_POST variables, do some basic validation checks and present the errors to the user for resubmit if needed. For the life of me I can't understand why I can't post data as an XML document to one of my advertisers.

For example, a lead form is complete with Name, Address, Phone, and so on. I capture the form data and submit as an XML document. This particular advertiser will only accept data as an "External XML Post." I tried using Javascript and PHP with cURL, but I'm going in circles trying snippets of other people's code -- it's been a week. At this point all I want to do is assume IE7 (nothing else!) and no data checks, just "here's the XML, here's the external URL" and show me that HTTP POST actually works. Right now I'm thinking it's a bunch of junk :-) Someone please help.

Here's my server info:

PHP Verion 4.4.4
Apache/2.0.46 (Red Hat)
CURL support enabled
CURL Information libcurl/7.15.4
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20510
HTML Support enabled
XPath Support enabled
XPointer Support enabled
XML Support active
XML Namespace Support active

Here's a sample of XML, let's call it "data.xml"

<?xml version="1.0" encoding="UTF-8"?>
<DataFormSubmit>
<individual id="12345">
<FirstName></FirstName>
<LastName></LastName>
<Address></Address>
<Phone></Phone>
</individual>
</DataFormSubmit>

POST XML document to URL on an external website for example:
http://www.example.com/othersite/xml.aspx

Response XML is equally simple. There is no mention of MethodCall, MethodResponse and Params like the books say, so please don't use those elements in your reply to me. There is mention of field requirements like "Text field" "255 character max" "Numeric" but I think this can be handled by the input validation scripts. I'm just trying to POST and get a response.

I've received errors refering to "permission denied" "access denied" "object expected" but at this point I've edited my code so many times I don't know what's right or wrong any more. Here's one of my failed cURL examples:

<?php
// XML data as string
$request = '<?xml version="1.0" encoding="UTF-8"?>'
$request .= '<DataFormSubmit>'
$request .= '<individual id="12345">'
$request .= '<FirstName></FirstName>'
$request .= '<LastName></LastName>'
$request .= '<Address></Address>'
$request .= '<Phone></Phone>'
$request .= '</individual>'
$request .= '</DataFormSubmit>'

// Create Headers
$header[] = "Host: www.example.com";
$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($request) . "
";
$header[] = $request;

// Send using CURL
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, "http://www.example.com/othersite/xml.aspx"); // URL to post
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); // return into a variable
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header ); // headers from above
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' ); // special POST with specified Content-type
$result = curl_exec( $ch ); // runs the post
curl_close($ch);

echo $result; // echo reply response
?>

And I tried a Javascript variations using code like
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") but I'll save that for a followup post since this is getting long.

Anyone out there doing external XML form post?

View Replies !
Is There A Way To Interact With External Webpages
I don't know if this can be done using php (I'm hoping). I need to
automate passing a variable from a text file to an external webapge
(that is not mine). Basically, simulate a user entering a number into
a textbox and then activate the submit button.

The webpage in question has a textbox named 'serial_number' and a
button named 'submit'. I would like to pass a numeric value to the
serial_number textbox and then activate the submit button. Can this
be done uisng php? If not, does anyone know of any method to do this?

View Replies !
Formating External Text
I have a quick question about the formatting of external text files.

I am trying to make a webpage for a local church that will display what
is on in the coming weeks. I have done this using an external text file
so that the future users will never have to modifiy the page itself.

If left as plain text, it shows on the page in default format. I know I
can format the text within the text file using standard HTML, but is
there a way of formatting regular text outside of the text file? Kind
of post processing it? The file format will always be something like

Monday 19th
09:00 Add event here
12:00 Add event here

Tuesday 20th
09:00 Add event here
10:00 Add event here
13:00 Add event here

etc...

The number of events on each day is variable, and not every day may
feature (could be monday events then thursday events). I would like to
make the Day and date bold, the times italic...well you get the idea!

I have an idea that I will need to impose a structure on the file,
however I am unsure of how to do this. If this is the case, then I
would appreciate it if someone could post a link to a decent tutorial
or guide so I can learn it!

View Replies !
Read External Webpage
I made the folowing script. It works in most cases but not in the one below. I tried several solutions, but I still don't get the content of that website.

<?php
$url="http://www.example.nl/";
aspxerrorpath=/Default.aspx";
$arr =file_get_contents($url);
print($arr);
readfile($url);
$array = file($url);
print count($array);
?>

Who can help?

View Replies !
Calling External File
I am fairly new to PHP programming, and I'm trying to get my head around
this one...

I have a form that I am doing validation on via PHP within the same page, so
if there is an error, a message will show to the user above the form. If all
goes well, I would like to call a processing script that I have already set
up and working to format the users response and send it out to a specified
e-mail... I'll call it processing.php

Is there a way that I can, if the form is filled out correctly, make a call
to processing.php, that will totally leave the control of form.php and do
it's processing?

View Replies !
Including External File
I have two sites that I am trying to get to "talk" to each other.

I have one site that contains a PHP file that basically outputs an XML formatted list depending on the file structure in that directory.

The other site needs this XML formatted data to complete the PHP generated XML file that I am trying to put together. (Much like syndicating my content from one site to another)

I have tried using readfile, include and header(Location:) and none of them seem to be working. What I need is for the calling file to somehow include the output of the remote file. (The same stuff you see if you view the source) What happens is that I can 'readfile' my index page on that site, but not the one that puts out the XML data that I need. Could it be that the XML file doesn't actually create any visual content on the page? or doesn't have 'head' and 'body' tags?

It would be great if I could do all of this in PHP so that the final source would not include anything that would disrupt the final XML output.

View Replies !
Executing External Programs
I know all the different functions that allow me to execute an external progam, however I have come across and interesting problem that I need to fix if it is at all possible.

Is there a way that I can use the php functions and execute an external program by some other user other then who ever owns the apache process?

View Replies !
Use PHP To Delete An External File?
Is there any way to use PHP to delete an external file?

View Replies !
Open External File
Is it possible (how?) to open a file that is located on another server? I need to open the file so that I get the HTML code (so that I can parse information form it).

View Replies !
How To... Validate Some External .jpg Exists By Url?
.... validate some external .jpg exists by url?

func. file_exists(http://url_to_navigate.jpg), doesn't work, and I need
something like this.

------------------------------------
if(--validate http://something.jpg exists--){

//show picture

}else{

//show default picture

}
------------------------------------

View Replies !
Can I Execute PHP From External/different Server?
Hopefully there are some experts out there that can help with this - I've done a bit of searching here but haven't found an answer yet.

The problem is, the site where I'm hosting a set of html files does not support PHP. I have another host which does support PHP. I need to have my html files located on the server which does not support PHP.

Is there some way I can execute my PHP scripts within a regular HTML file? I've seen references to using Javascript for this but no working examples (and none I could make work).

Unfortunately I can't get PHP on the site where I need it without redirecting my domain (among other things). If there is a way to execute the PHP remotely, that would be the preference..

View Replies !
How To Invoke External Php Script ?
when a web request comes to my index.php, i would like index.php to execute
a php script stored in an external file and capture the external script's
output to a variable.

i am doing this because the external script can read the database and can
emit xml that i want to use. index.php (or whatever) wants to grab this xml
and pass it through an xslt.

i know that if the external php script had a function declared, and the
function returned a string value with the xml contents, then i could use
"require" or a similar construct and call the function. the question that i
am trying to answer is what to do if the external script uses echo() to
output the results? how to capture its output during request processing?
besides, i do not like spawning another process for that and piping to it.
it might not scale well. ;-)

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved