Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Trouble passing JS parameter to PHP program /or/ executing the PHP (http://www.velocityreviews.com/forums/t880063-trouble-passing-js-parameter-to-php-program-or-executing-the-php.html)

Nautilus 10-13-2004 04:22 AM

Trouble passing JS parameter to PHP program /or/ executing the PHP
 

Taken from a couple very similar samples on the net, I'm having
trouble passing a parameter to a PHP file.

Here's all the JS code ... it creates an image object and modifies
it's src to make a 'call' to the PHP file:
var myobj = new Image();
myobj.src = 'http://www.mypage.com/my.php?url=' + 'anything_here';

The process seems to recognize that the file URL ends at the "?", and
system logs show that the GET of the PHP file was successful.
However, it doesn't seem to execute the PHP (internal debug logging
does not occur).

The PHP code itself works, if I go in through SSH and enter this:
php ./my.php url=anything_here
then the PHP uses $_GET['url'] and parses/logs the param just fine.

If I replace the "?" with a space (like the SSH command line) then the
server seems to think the whole line (or at least up to the '=' sign)
is the file's URL and I get a 404 error (file not found).

Any suggestions / debugging ideas?

THANKS!


kaeli 10-13-2004 02:41 PM

Re: Trouble passing JS parameter to PHP program /or/ executing the PHP
 
In article <-5OdnRVRkPNyMfHcRVn-pQ@comcast.com>,
reply_in_newsgroup_thanks@example.com enlightened us with...
>
> The PHP code itself works, if I go in through SSH and enter this:
> php ./my.php url=anything_here
> then the PHP uses $_GET['url'] and parses/logs the param just fine.
>
> If I replace the "?" with a space (like the SSH command line) then the
> server seems to think the whole line (or at least up to the '=' sign)
> is the file's URL and I get a 404 error (file not found).
>
> Any suggestions / debugging ideas?
>


What happens when you access it through a normal browser link (not SSH)?
What happens during SSH tells you nothing about what will happen when a
browser requests the file, which is what the javascript is essentially doing.

The server settings may not be set up properly. SSH wouldn't catch that.

--
--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


Nautilus 10-13-2004 09:55 PM

Re: Trouble passing JS parameter to PHP program /or/ executing the PHP
 
On Wed, 13 Oct 2004 09:41:05 -0500, kaeli
<tiny_one@NOSPAM.comcast.net> wrote:

>In article <-5OdnRVRkPNyMfHcRVn-pQ@comcast.com>,
>reply_in_newsgroup_thanks@example.com enlightened us with...
>>
>> The PHP code itself works, if I go in through SSH and enter this:
>> php ./my.php url=anything_here
>> then the PHP uses $_GET['url'] and parses/logs the param just fine.
>>
>> If I replace the "?" with a space (like the SSH command line) then the
>> server seems to think the whole line (or at least up to the '=' sign)
>> is the file's URL and I get a 404 error (file not found).
>>
>> Any suggestions / debugging ideas?
>>

>
>What happens when you access it through a normal browser link (not SSH)?
>What happens during SSH tells you nothing about what will happen when a
>browser requests the file, which is what the javascript is essentially doing.


Doh! I should have thought of making a normal link. Found out the
web user doesn't have write permissions in that directory... made
another dir and I'm all set. Thanks!



All times are GMT. The time now is 10:49 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.