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.





Execute A Windows Program From An Anchor Tag


I believe I am close but I have spent several hours investigating this and
can't understand why it won't work. I have tried exec, system, and settled
on popen from reading various notes on the subject. I am wanting to launch
a file editor when I click on a link. This is strictly an internal
application so I don't need to worry about escaping shell/args. This is
what seems as if it should work, however it doesn't. This is on XP, latest
Apache 1.3.29 and PHP. The logic makes it into the "if" test and the file
exists. Thanks.

if (chdir("C:Program FilesTextPad 4")) {
$cmd = "start "textpad.exe" x:webprogram.php";
pclose(popen($cmd, "r"));
}




View Complete Forum Thread with Replies

Related Forum Messages:
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 !
How To Execute .php Code From C++ Program?
I can launch .html file by ShellExecute to lunch IE for viewing.
However the .php has no effect in the same way. I can read the .php
page through the input on FireFox browser.

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 !
Could Not Execute Mail Delivery Program '/usr/sbin/sendmail -t -i'
how to use the mail() function and all but for some reason, I'm getting errors ONLY SOMETIMES from this new host I have. i created a test mail() just to test it. The error only happens about 1 out of 10 times. Code:

View Replies !
Does Anyone Know Of Any Program That Would Be To Windows What CRON Is To Unix.
Does anyone know of any program that would be to Windows what CRON is to Unix.

I Run Apache on XP with PHP 4--and am hoping that I can find something like described above.

View Replies !
Windows Program Command Exists
I can do this so easily in Unix: PHP Code:

$msg = exec('whatis convert 2>&1');
echo $msg;

However, in Windows using MS-DOS, I'm utterly lost. I am having to find out if ImageMagick is installed on a system for a function to operate (ImageMagick is required), and since this is a portable web application, you simply can't install ImageMagick everywhere you go.

Therefore I need to know if the system home has ImageMagick or not, and in Unix, I simply do a "whatis convert" and I can tell, but since MS-DOS has no equivalent to "whatis" I can't figure it out, and just running the "convert" command within a recursive function onto thousands of images is just not a good idea.

View Replies !
Php Session Problems When Working With A Windows Client Program
I am currently involved in a project that involves a windows client
program written in delphi and a web application written in php. I
have made several php pages for the delphi program to do requests via
the http component from INDY. the problems I am having are:

1) the first request from delphi app to php web app is the
authenication. In which user sends username + password to the php app.
If authenication is valid, a session is started and the sid is
returned to the client. All subsequent requests from delphi app to
php web app will have this sid as one of the arguments in the POST
form request (this is one of the function in the INDY component for
delphi). Even the sid is passed to the subsequent pages, the session
global array is still undefined. However if I open up a web browser
and create my own string request to the login page then the next page,
the global array would be defined (using var_dump + echo to see the
array) what is the problem?

2) does the above problem has anything to do with the http referer
field?

3) this problem that I am having has been asked before on google
group, but somehow the person who asked it didnt' put down the
solution for it. (this only involves the web only) when I login on a
page and return with a session id, then I log out.. the user is
redirected to the login page again. However if the user login again
(with a different login account), he would be presented with the same
session ID as before. a different sesson id is presented only if the
user restart the browser. why is that happening?

View Replies !
Mail(): Could Not Execute Mail Delivery Program
I have been sending mails from ym server for ages but all of a sudden i get "Warning: mail(): Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/needsite/public_html/includes.php on line 8"

I dont think iv changed anything... any ideas?

View Replies !
Give Time To Execute Something, If It Doesn't Execute, Do Something Else
How can I give time to execute something, if it doesn't execute, do something else?

For example, the code tries to connect to a server, if it doesn't connect it stops the code.

How can I make it so that it tries to connect for 10 seconds, if it doesn't connect it goes on to do something else?

I saw a code doing this somewhere some time ago, but now I can't seem to find it

View Replies !
Anchor Tag Help W/PHP
I'm using PHP and while this is an HTML question, I'm looking for a
PHP answer please - I've got several anchors similar to the one shown
below - I'm calling a dispatcher.php script and I need to be able to
determine which anchor was clicked on even tho they will all call the
same dispatcher.php script - in PHP can I detect which anchor was
clicked on once I'm in the dispatcher script?

<A HREF="dispatcher.php">2</A>

View Replies !
Redirect With Anchor Tag In IE
The following PHP code snippet works in Firefox and Opera but NOT
Internet Explorer (I'm using IE v 6.0.2xxx)

$url =
"http://www.theredirectsite.com/testpage.php?IDa=162&IDb=19909#AT2";
header("Location: " . $url); /* Redirect browser */
exit;

The Anchor Tag: "#AT2" generates a 505 error in Explorer. When the
Anchor Tag [#AT2] is removed from the URL everything works fine.
Any thoughts on a workaround?

View Replies !
Anchor Position
Could anyone teach me how to set anchor for a php link?

Is the following right?
www.test.com?abc=1#anchor_name

Or the following?
www.test.com#anchor_name?abc=1

Or both are wrong?

Besides, could I go to anchor position by PHP command?

View Replies !
Extracting Anchor From Url
I have a page with a bunch of anchor tags. eg:

<a name="tag1">
some text
<a name="tag2">
some more text

(In case you didn't know what anchor tags looked like!)What I want to do is write to the database when a particular anchor is requested. So for Code: <a href="page.php#tag1">
We just go to the tag. But for Code:

View Replies !
Linking To A Named Anchor
I've got a PHP script for a very basic CMS which links a page to itself when a "Submit" button is clicked in a form, at the same time a variable "Number" is sent, telling the script which particular "Submit" button was clicked. The following script takes place in a PHP loop using the counting variable $i: Code:

View Replies !
Anchor Tags And PHPSESSID
Trying to pass anchor tags and the PHPSESSID together.

echo "<a href=page.phtml#".$classinfo2["cla_ins_id"]."?$sUrlSession>"

The only browser this works in is NS 4.79

View Replies !
Jumping To Anchor After Submit
i have a form with lots of data, and when they click on a button it
calls some javascript which sets values in hidden fields then posts to
itself (usual stuff)

now the problem is that i would like to bring the page back to the
same spot after the submit (as its very long)

Ive added anchors to each button but if i add a the anchor tag to the
action part of the form, im always one click behind, ie it jumps to
the one I clicked on before. ive tried using location header etc
calling itself and appending #anchorname to the end of the url, but
then i lose the data in the form, as no $_requests have data any more.

so what i need is when you hit a button, sumit the page && go to the
correct anchor. is this possible

View Replies !
Preg_replace - Replace Something With An Anchor Tag
I dont think I'll ever understand regular expressions ... I need to do th
efollowing and I just don't know where to start:

$haystack = "How much wood would a wood chuck chuck if a woodchuck could
chuck wood?";
$needles = ("wood","chuck","wood chuck");

I want to replace every needle with an anchor tag like this:

<a href="def.html?word=wood">wood</a>
<a href="def.html?word=chuck">chuck</a>
<a href="def.html?word=wood%20chuck">wood chuck</a>

How do I do this?

View Replies !
Pull Information Off An Anchor ID
I have a bunch of links that ref is the same page.  Is there any way on that second page I can tell which link was clicked if my links are structured as:

<html>
<a href="page.php" id="link1">Link 1</a>
<a href="page.php" id="link2">Link 2</a>
<a href="page.php" id="link3">Link 3</a>
<a href="page.php" id="link4">Link 4</a>

View Replies !
Anchor And Form Submit
I need an anchor on a form action to get my page to locate properly in the browser. (I do a select lookup and propogate another select). Now that I have added the anchor:

SimpleSearch.php#StateSelect
my form only reloads and doesn't perform the right action:
isset($_POST['Submit'])

is not working properly with the anchor. Does someone know how to work with anchors and not mess up the php?

View Replies !
Search Page For An Anchor
I would like to add a search to a single page. It would be a text entry box which when the submit button is pressed it will search for an anchor on the page with the name entered in the search box. Ideas or code examples?

View Replies !
Dynamic Anchor Based On Last Name
I have a MySQL database that hold the list of employees. I display the page using PHP. All of this works great, I sort by last name ascending so the list is A-Z.

Here is what I want to do.

At the top of the page I want to list each letter of the alphabet and have it as a link. From that link (lets say "G") when I click on G it jumps to the first employee that has a last name that starts with G (staying on the same page)

Is there some way to create a dynamic anchor that would jump to a specific areas based on how the alphabet link was coded?

View Replies !
Tracking The Clicked Anchor Text
I want to fetch the anchor text clicked by a user. Can it done with php.

Deailed description: I want to create a dictionary kind of thing. Every word in the paragraph will have a link and a value which will be the cliked word will be passed to the next page that will fetch the meaning of that word from the database.

View Replies !
Eregi (html Anchor Tags)
I need to get all the html anchor tags from a string. heres my eregi line: PHP Code:

View Replies !
Change The Color Of An Text Anchor
Rollovers that work. I'm looking for at class that will let me change the color of an text anchor <a> when I move the mouse over an image. So far I have only been able to find some horrible Java-script examples. IE is easy enough but Netscape seems to be a pain in the a.. when it comes to rollovers.

View Replies !
Getting File Type From A String Into Anchor
I'm pulling out links from a database, some of them are images, some are movies, some are URLs and some are just download files. I need a way to differentiate each of the to be printed in the anchor tag this is what I'm doing: Code:

View Replies !
Question About Encapsulating PHP Script Inside An Anchor
Here's an interesting problem -

On one of my pages, I have a place where a user can download a
ZIP file by clicking on the phrase "Click to download". I want
to call a logging function that I use to show that the file was
downloaded. The file being downloaded is called file1.zip.

What I now do is the following:

<a href= "....downloadsfile1.zip">
<?php logvisitor('file1.zip'); ?>Click to download.</a>

which produces the following HTML

<a href = "....downloadsfile1.zip" >Click to download.</a>

So far so good.

But -- here's the problem -- the function logvisitor() is
always called even if the user didn't click on the link.
By placing the PHP function inside the anchor, I had assumed
it too would only be called if the user clicked.

I've also tried the following:

<a href="<?php logvisitor('file1.zip');
echo '....downloadsfile1.zip' ?> >
Click here to download.</a>

and get the same result, namely, that the PHP function is
always called.

View Replies !
Want To Make A Link Anchor Call A Script
In a certain PHP document at my site, I have a link to a Word version of the
same document. If the user downloads it, I want to log that s/he has done this.
Data logging isn't the issue. Calling a PHP script is.

So what I have is something like:

<a href=http://my-web-site.com/documents/mydoc.doc>Click here</a> to
download a Word version of this document.

Of course the <a> anchor exists only on the client side and the PHP script
exists only on the server. But since clicking the anchor sends a message to the
server, there ought to be a linkage that can be exploited to enable a PHP call.
I just can't think of one.

View Replies !
Regular Expressions :: Extract Href Links With Anchor (if Possible)
In short, I have tonnes of HTML which I need to extract "href" links from complete with anchor text (if applicable).

I need a preg_match_all function regex that can give me an array of 1) The entire HTML <A> tag (e.g. <a href='http:www.example.com'>Example link</a> 2) Just the URL (full URL, not just domain) and 3) Anchor text

I've only seen a few suggested expressions, all of which havent worked on searches.

The regex needs to be able to take care of <a> tag anomalies where the <a is separated from the 'href' through 'onclick's etc.

View Replies !
How Do You Spider A Page And Search For A Specific Anchor Text
I've scoured the net for some simple code and my regex experience is nill. I find the darn thing totally confusing. Anyone have some snippet of code that will grab a url, skip the headers, pull out all links in the body and provide anchor text to the link?

View Replies !
Cant Execute Commands With Execute()
I am trying to do the following:

exec("cat filename.txt | /usr/sbin/sendmail -v chandakme@yahoo.com");

It is supposed to mail the contents of the filename.txt to the email adress. If i run this command from the shell , contents of the file are emailed. but if run it from php using exec, i get an email but without any contents . i have already done chmod 777 filename.txt

For some weird reasons, i cant use mail() function of php...so i have to run this command somehow.

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 !
Is It Possible To Authenticate Users Running Apache On MacOS X (with PHP 4) And An Active Directory On Windows 2000 Or Windows XP?
From a PHP webpage, is it possible to authenticate users running Apache on MacOS X (with PHP 4) and an active directory on Windows 2000 or Windows XP?

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 !
Using Preg_match_all To Locate HTML Anchor Link BUT Only If The Link Is A .pdf File
The subject line describes what I'm trying to do, (and after thinking about it for a day or so and trying different things; searching around for similar questions on the board,) but I still haven't found a proper regular expression.

I am trying to use preg_match_all to locate HTML Anchor link BUT only if the link is a .pdf file within text from a database table. It actually was working just fine until I recently made a change regarding new lines () and (<br />) in the text that is to be searched. But after making changes regarding the new lines and things, my previous regexp doesn't work correctly. Here is the regexp I am trying to use:

preg_match_all('/<a href="(.*)">(.*)</a>/U', $entry->Record['e_entry'], $res_output, PREG_PATTERN_ORDER);

That regexp does find each occurance of an <a href="">something here</a> link... but I need it to only find occurances of an anchor link if it is a PDF file link (ex: <a href="../something.pdf">something</a>). So I tried changing the regexp to something like this:

preg_match_all('/<a href="(.*).pdf">(.*)</a>/U', $entry->Record['e_entry'], $res_output, PREG_PATTERN_ORDER);

But in the preg_match_all results array ($res_output) a regular <a href="">something here</a> link is ALSO found as well as the .pdf links... I am trying to only find links that contain .pdf at the end of the file name. Sorry that this is written kind of strangely, if you need more info let me know. Does anyone know what I need to change in the regexp to ONLY find HTML anchor links that contain .pdf at the end of the HREF?

View Replies !
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 Replies !
Execute Exe In Php
Im trying to execute a visual basic program that i have compiled and i want to execute it in php. (The vb program takes data out of a mysql database and writes it into an excel spreadsheet).

View Replies !
How To Execute PHP
I know how I can get a PHP script to execute by having a
form with a post method in my regular HTML file. So far so good.

Now I just want to run a PHP scrip from an HTML file to insert a text
file, but how do I execute the PHP without the form + post?

(The text file is a club member list and I want the web page to always
display the updated list)

View Replies !
How To Execute
We installed a third party "ghostscripts" in server (linux). This is to make html to pdf. The question is how can the PHP execute the file

and the application installed in this path
usr/local/share/ghostscript

and my php script installed in this
www.mydomain.com/files/execute.php

View Replies !
Execute Php
i have a base page, which acts as a template, called index.php. when called with parameters (GET) the php code inside this page load an external HTML file and writes its contents into a specific location within the index.php page.

View Replies !
Execute Gpg From Php
The following code works for executing 'ls', but not gpg.

$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read
from
1 => array("pipe", "w"), // stdout is a pipe that the child will write
to
2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to
write to
);

//LINE BELOW DOESN'T WORK
//$process = proc_open(gpg --output encmail.txt --recipient
someone@domain.com --always-trust --armor --yes --encrypt mail.txt",
$descriptorspec, $pipes);.

View Replies !
System Execute In Php
The same set of command in linux prompts and if call by php program, it does not work. I do not know why. The set of command is already chmod +x and ./what what ,it works.

View Replies !
Execute Php File
I'm working on a search engine. The idea is simple user types a keyword in the text box and then I my program searches for all files (.html, .htm, .txt, php) that have a match.

But I nedd to search the output of php file not the code.

View Replies !
Execute Ph Script
I need to execute a php script in my shell so :

touch test.php
chmod +x test.php
edited the file, inserted the following lines :

#! /usr/bin/php -q
$a = 0;
echo $a;

../test.php

Gives me the following output :

$a = 0;
echo $a;

View Replies !
PHP Slow To Execute
I have some PHP pages at.. which is exhibiting
some strange slowness. It is hosted by secureserver.net (bad?).

When I time how long it takes to load the main web page from the
server
it averages 7 seconds, but often goes to 15.

When I store the main page on my hard drive, the load time is 1
second.

I've tried removing PHP code that might slow things down
but that only brings the load time down to 5.5 seconds best case.

I have other PHP pages on the same server that seem to execute
faster. The key difference between the slow main page and the faster
pages is the faster pages do not use "include" to execute code in
other
PHP files.

However with out "include" and the modularity it affords, my PHP code
would be harder to maintain. What to do?

View Replies !
Execute PHP In A CSS File?
On Apache with PHP is there any way to execute PHP code inside of a CSS file? This is assuming AddType application/x-httpd-php does not list CSS as an extension. I would like to serve my stylesheets as CSS but also dynamically construct the CSS for various browsers (and ultimately hope to keep the number of served stylesheets to one).

View Replies !
Could Not Execute Query
I have a db that I am trying to poulate using an online form but every time I press the submit button it givesm me this error:

Could not execute query : INSERT INTO register (id, name, phone, email, interest, other, type, comments, update) VALUES ('', 'Tom', '0000000', 'abc@abc.com.au', 'Music Performer', 'other things', 'painting', 'none really', 'Y').You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update) VALUES ('', 'Tom', '0000000', 'abc@abc.com.au', 'Music

I am not sure what the problem is.  Can someone have a look and tell me what I need to fix to make this work. Code:

View Replies !
Execute String
I would like to load a string with PHP code and execute it. Is there a command that will let me do that? Maybe something like
php_exec(). I suppose I could always use some sort of shell_exec("php.exe...") trickery but would prefer something more graceful.

View Replies !
Execute Ssh Command Via Php?
I'm trying to make a web interface for my music server. Basically what it's going to do is list all the music files in a directory. Then when a song is clicked PHP executes a shell command, for example "sudo play /var/www/music/System Of A Down - BYOB.mp3" and my server plays the song. So far I've been trying system() and exec() but it do doesn’t seem to work.

View Replies !
How To Execute A Link In PHP ?
I have the following piece of code:

If TRUE {do this;} else {go to this page;}

In the else clause, is there a function in PHP that I can pass in an URL and make it automatically go to that particular page ? The only PHP function I know for this purpose is the "header" function but it does not always work.

View Replies !
Execute As Root
Is there a way to execute commands as root using sudo? If yes, how to use it, if no, how can I get around.

View Replies !
Execute Another Php File
Is their a way to execute another PHP file from a PHP file? for example, say I want to check if a User's Authority level is equal to 3, by using a If statement, and if the User's Authority level is equal to 3, execute another PHP file which executes a function within the file.

How can I do this? if it is at all possible? (your probably wondering why I want to know how to do this, lets just say PayPal isnt very flexible)

View Replies !
Execute A Command
I need to execute a command if either one of the variables is set.

if (!isset($k1) || !isset($k1n)) {...

What is wrong with this statement? It works if I put just one, but cann't seem to get through when I write the statement above. what am I doing wrong?

View Replies !

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