This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
[closed] Error - URLS are being Appended with double // at end
Started 17 years ago by mpivon | 10 posts |
-
Hi,
First off, pretty slick app. Some good stuff here.
Now, for a quick bugfix? Seems like in some instances forms are loading up with a normal url (i.e. http://www.Domain.com/) and in other instances domains are loading with a double // at the end when files are loading. (i.e.: http://www.Domain.com//index.php)
This poses a problem if a user presses the "submit" on a form that has error checking. What happens is the url defaults back to the stuff after the //, and so we get http://index.php -- y'see?
I'm thinking it has something to do with the code where it says:
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/manage_form.php");
Should this actually read:
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."manage_form.php");
i.e.: no "/" before the
manage_form.php
See code index.php line 18, 24 and 44 - as well as elsewhere in the source.
Does this exist elsewhere?
I can show you on my install, if you wish.
Posted 17 years ago # -
Hmm.. that's odd.
The code
dirname($_SERVER['PHP_SELF'])
actually should get current directory name without any trailing slash.What version of PHP do you use? also are you using Linux or Windows server?
Also.. I've just replied back to your email.
MachForm Founder
Posted 17 years ago # -
PHP 4 on Linux
Posted 17 years ago # -
Just a note. Problem solved.
MachForm Founder
Posted 17 years ago # -
Hi,
Just bought your product and I have the same problem. How can I get rid of it?
I downloaded the version on the link provided bu the link of the purchase.
Regards.
Posted 17 years ago # -
Hi,
Are you installing MachForm under root folder?
I suggest not to put MachForm under root folder, as MachForm currently having a small bug with it. This should be fixed for the next version. What's your MachForm URL?
If you don't feel comfortable posting it here. Feel free to mail me at customer.service [at] appnitro.com
Thanks
MachForm Founder
Posted 17 years ago # -
Hello,
No problem to post here (by now :) ). It's a subdomain, so its something like forms.domain.com.
The machform runs under a intranet so I can't give you a public URL, sorry. If you want I can give you my order details.
Posted 17 years ago # -
Ahh..okay so it runs under document root of a subdomain?
Like this: http://forms.domain.com/view.php?id=1
I suggest to move it under new folder. So it would become:
http://forms.domain.com/form/view.php?id=1That should solve the problem. Is that possible for you?
Otherwise we will need to modify the code a bit.Thanks
MachForm Founder
Posted 17 years ago # -
Hello Yuniar,
Unfortunately I can't move it as it's already published on the intranet and will be easier for me to mod the code.
If you tell me what to do it will be fine.
I look forward to your reply.
Posted 17 years ago # -
Hi,
Ok, let's do the modification. In this case, the quick fix being said by mpivon above is the easy way to solve this issue.
Search for code similar as below:
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/manage_form.php");
and remove the slash, so it would be:
header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."manage_form.php");
There are few codes similar as above. And they are all scattered among these files:
1) index.php
2) edit_entry.php
3) includes/check-session.php
4) logout.phpMake sure you check those files. That should fix the issue.
Sorry for this inconvenience.MachForm Founder
Posted 17 years ago #
Topic Closed
This topic has been closed to new replies.