473,669 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_he re
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!

Jul 23 '05 #1
2 1537
In article <-5************** ******@comcast. com>,
re************* **********@exam ple.com enlightened us with...

The PHP code itself works, if I go in through SSH and enter this:
php ./my.php url=anything_he re
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

Jul 23 '05 #2
On Wed, 13 Oct 2004 09:41:05 -0500, kaeli
<ti******@NOSPA M.comcast.net> wrote:
In article <-5************** ******@comcast. com>,
re************ ***********@exa mple.com enlightened us with...

The PHP code itself works, if I go in through SSH and enter this:
php ./my.php url=anything_he re
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!

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4951
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
7
3308
by: | last post by:
I fail to understand why that the memory allocated in the void create(int **matrix) does not remain. I passed the address of matrix so shouldn't it still have the allocated memory when it returns to main. The problem i am having is understanding why the printf statement in the code below gives the value. I would have expected it to be 123 which is the value I set it to in the create. Thanx in advance. void create(int **matrix); int...
6
2789
by: Catherine Jones | last post by:
Hi all, we need urgent help in a matter. We are trying to pass a COM object from the client to server and are facing some problems in the same. We've our client in C# as well as the Server in C# and we're using remoting for client to server communication.
3
1847
by: spacehopper_man | last post by:
hi - I am "apostrophe in sql" problems ;) I am executing a stored procedure on SQL Server - and passing in a string parameter. the string has a single apostrophe in it. the call is failing with an "Incorrect syntax" message.
7
9558
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a subroutine Let's say theres a sub that creates buttons and I want it to receive as a parameter the address of the sub that handles the OnClick event for the button being created How do I pass such a parameter Thanks in advance Richar
2
1611
by: Simon Harvey | last post by:
Hi everyone, I'm having a really simple problem - I can't seem to insert a null value into the database. When I do it tells me that the procedure expects the parameter and that I'm not providing it. Well, I am, its just a null value! The code is: con.Open();
6
1684
by: dew | last post by:
I am using sql to modify data, using parameters. However, if I set the datatime to any other than a varchar, it bombs if the user enters a null value. How am I supposed to handle this. Set param.Value to ??? param=cmd.parameters.add("@DueDate", sqldbtype.smalldatetime) param.Value = txtDueDate.text Thanks for your help.
1
2751
TMS
by: TMS | last post by:
I'm trying to write an address book that is based on a binary tree. I'm devloping in Visual C++ (I blew up my Ubuntu with the new dist, so no EMACS), starting with the basics: #ifndef binarySearchTree_h #define binarySearchTree_h #include <string> #include <iostream> using namespace std;
10
8149
by: Hendri Adriaens | last post by:
Hi, I'm trying to automate the creation of an excel file via COM. I copied my code below. I read many articles about how to release the COM objects that I create. The code below runs just fine and excel is closed. But there are some commented lines: //xlSeries.XValues = xlWs.get_Range("B2", "B4"); // makes com objects, but which...
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7405
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.