Jump to content


Photo

posting to a script in a different dir


  • Please log in to reply
7 replies to this topic

#1 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 12 June 2006 - 07:10 PM

okay so i have a login form that is in /public_html/themes/login.php

and in it i have a simple little form like so:
<form action='/home/blah/functions/authenticate.php' method='post'>
   Email <input name='User_Email' type="text" size="3" class="login"> 
   Pw <input name='User_Pw' type="password" size="3" class="login"> 
   <input type="submit" value=">>">
</form>

so as you can see by the action i'm trying to post the variables to a file that is not in /public_html/...

however, when i click on the submit button, i get a 404 error. Now I know that the file really is there and it is spelled correctly, etc.. so what i need to know is if I am simply not using the correct path (and if not, then how do i do it right) or if it is even possible to post data like this?




Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 12 June 2006 - 07:14 PM

It's all relative ... whenever I want to quickly get the .. and the / sorted out, I use the feature in my editor to let me link to another script and navigate there. Once I have the right relative link to the file I want, it's obvious how to use it.
Legend has it that reading the manual never killed anyone.
My site

#3 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 12 June 2006 - 07:17 PM

When in doubt, use a full URL.

They'll work even if it's a different domain ;)
~ D Kuang

#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 12 June 2006 - 07:24 PM

problem is that it's not in the www or public_html directories. it is like this:

/home/blah/public_html/themes/login.php

wants to post to this:

/home/blah/functions/authenticate.php
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#5 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 12 June 2006 - 07:29 PM

If you want to check to see whether you're path is correct or not I suggest trying to echo $_SERVER['DOCUMENT_ROOT'] which will let you know what you need. If you're in the right path but it still isn't working check for the files ownership, I think in this case it needs to be accessible by nobody. Finally it might be worth talking to your host if you haven't done this before because I don't think I can run files outside of my public_html, at least last attempt ended in failure...

One more thing, it may not be worth using a function outside your public in this case becaues you'll be revealing to anyone who wants to "view code" your page what your directory structure looks like.
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#6 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 12 June 2006 - 07:34 PM

i can include the file no problem. i include files in this exact manner. in fact, that's why i used that path in my action, because i can include the file using that path, and it works. so i thought i could post to it just the same. obviously i can't. so what i need to know is, if there is some alternate path i must use to post to it, or if it is not possible to do this at all.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#7 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 12 June 2006 - 07:39 PM

Why not post to a dummy page, something like form_data.html in your public directory, thereby avoiding the problem of giving snooping users a glimpse of your structure and then have that page grab the post data and set it to a session or something, then redirect or include the page you really want?
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#8 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 12 June 2006 - 07:57 PM

well i figured out the answer. The answer is no, you cannot post to a file that is on the same level or under the public_html directory.

p.s.- i already had a workaround for it i was just curious if it was possible.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users