I've got all my pages in a subdirectory. When I click on the submit button on my forms it tries to load the next page from the root directory and, of course, can't find it. The only way I can it to work is by putting the absolute address in the "action" field.
Form Action relative address problem
by the root directory you mean the root of your hosting?
Outside the public_html directory?
If it's the case, then it's natural that you can't access it by relative path.
Because the "root" directory for the webserver is "public_html"
Is it what you meant?
Hope this helps
Outside the public_html directory?
If it's the case, then it's natural that you can't access it by relative path.
Because the "root" directory for the webserver is "public_html"
Is it what you meant?
Hope this helps
cafefort - sorry, I should have been more specific.
I'm developing on my PC at home under JSAS.
When addressing my pages in the browser I use
http://localhost:85/beaverlandv4/pagename.php
The form tries to load from http://programname.php
All the pages are in the same directory (beaverlandv4) so for the "action" I specify simply pagename.php
I'm developing on my PC at home under JSAS.
When addressing my pages in the browser I use
http://localhost:85/beaverlandv4/pagename.php
The form tries to load from http://programname.php
All the pages are in the same directory (beaverlandv4) so for the "action" I specify simply pagename.php
Try using
This may help.
| Code: |
| action="./beaverlandv4/pagename.php" |
This may help.
Thanks Nyizsa. I had considered that, but I really want to get the relative addressing working if possible. Relative has worked fine whenever I've used it with HTML forms on HTML pages. I don't know whether this being a Javascript form on an HTML/php page makes any difference.
I should work... you haven't stuck an extra / in there have you?
as in "/page.php" instead of "page.php"?
as in "/page.php" instead of "page.php"?
Aftershock - No, I haven't. That was the 1st thing I checked.
It's not stopping me from developing my site, it's just an annoying little nag that I can't figure out a reason for and causes me a bit more work.
It's not stopping me from developing my site, it's just an annoying little nag that I can't figure out a reason for and causes me a bit more work.
is the page in the same directory if so then if you use
this is the code i use for pages in the same directory as to when i dont put a DOT in front of the forward slash it doesn't seem to point me to my page.
| Code: |
| action = "./pagename.php" |
this is the code i use for pages in the same directory as to when i dont put a DOT in front of the forward slash it doesn't seem to point me to my page.
Hi doc,
you mean: http://localhost:85/beaverland4/programname.php ? isn't it?
Have you tried
That should work
P.S. A little bit curious: why don't you just put programname.php in the
/beaverland4 directory?
| Quote: |
| When addressing my pages in the browser I use
http://localhost:85/beaverlandv4/pagename.php The form tries to load from http://programname.php |
you mean: http://localhost:85/beaverland4/programname.php ? isn't it?
Have you tried
| Code: |
| action="../pagename.php" |
That should work
P.S. A little bit curious: why don't you just put programname.php in the
/beaverland4 directory?
| asiddle423 wrote: | ||
is the page in the same directory if so then if you use
this is the code i use for pages in the same directory as to when i dont put a DOT in front of the forward slash it doesn't seem to point me to my page. |
Thanks. I never thought of doing that. D'OH @ me!
glad to help
we all forget the smallest and easiest bits of coding
we all forget the smallest and easiest bits of coding
