0

hello,

can somebody tell me why when i use a link on <form action="http://www.mysite.com/login.php" method="POST"> the login script won't work :(

first i used only action="login.php" but now i need to use the link because i want other login forms on diferent pages (directory) like http://www.mysite.com/news/
and i can't put on every directory the script login.php !

in IE works fine but in netscape firefox or chrome sometimes don't work i don't know why in firefox without the www. works better :| i made a javascript to change the action="" link but don't work for some users..

ps: all the datas are get in php from $_POST

any suggestion?! thanks :)

3
Contributors
12
Replies
13
Views
7 Years
Discussion Span
Last Post by almostbob
Featured Replies
  • [icode] <form action='/login.php' method='post'> [/icode] relative link on your site work? Read More

  • 1

    As bob stated, but '../login.php' if your in the directory above. You need to change the session.cookie_domain from the default of "" to ".yourdomain.com" You can do this with session_set_cookie_params before you call session_start. [url]http://us2.php.net/manual/en/function.session-set-cookie-params.php[/url] Read More

  • subdomain persistence cookes: try: [url]http://www.15seconds.com/issue/971108.htm[/url] Read More

  • just the format of the code to put in the cookie too leave off the www and make the cookie refer to .mysite. let me open up my notes, probably the next link is the php one edit: yep, subdomain cookies at php.net [url]http://php.net/manual/en/function.setcookie.php[/url] [quote=php.net]domain The domain that the cookie … Read More

1

<form action='/login.php' method='post'> relative link on your site work?

Edited by almostbob: n/a

0

thanks for your reply almosbob

in this case don't work.. i have diferent problems with firefox and google chrome.. when i use subdomains to make links shorter the login session is gone and the users in that page is not loged in.. my (session remember) in php is based on "cookies" in IE works fine..

how can i make cookie works for subdomains to like http://sub.mysite.com/ ? (ps: on http://mysite.com/sub/ works) maybe this is the problem for my login script..

0

infomation that wasnt in the first post,
sub1.mysite.com and sub2.mysite.com have the same path from the server root so
try <form action='<?php echo $_SERVER['DOCUMENT_ROOT'];?>/login.php' method='post'> if sub1.mysite.com is directed to www.mysite.com/subfolder1/subfolder2 then relative links ..(up one) will work even if they lead above the root of the subdomain <form action='../../login.php' method='post'> (demo: up two) it may be enough to count the folders back to the www root

both methods work, the first one on a site where subdomains all point to folders one level below the wwww root(planned in advance), the second on a site where the original work was built (hashed together) over years and many generations of code, (and is still patched when problems occur instead of being rewritten properly(aarrrgh time there is never enuf))

Edited by almostbob: n/a

0

in chrome works with /login.php , yes omol but using / is better cz it goes to the site root directory where is located login.php , damm this browsers we need to work on each browser to make a website run... in firefox don't want to work...

0

thanks for the link bob but asp is not an options for me cz i don't know it, other ppl said i have a problem with php cz there is an option to save cookie for all entire website subdomains too.. but why in IE works :-?? if i don't used that option.

i need to search that cookie share script in javascript.. jquery .. or php, thanks again

2

just the format of the code to put in the cookie too leave off the www and make the cookie refer to .mysite. let me open up my notes, probably the next link is the php one

edit: yep, subdomain cookies at php.net http://php.net/manual/en/function.setcookie.php

domain
The domain that the cookie is available. To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers. Setting it to www.example.com will make the cookie only available in the www subdomain. Refer to tail matching in the ยป spec for details

in 'parameters' at the top of the page

Edited by almostbob: n/a

Votes + Comments
Compasation for previous mistake
0

solved!!! thanks a lot bob & omol your post was very usefull! and yes the php was bad coded :D i set that option and now works fine. have a nice day, night, boys.

0

not bad, just drawn that way :jessica_rabbit:
a learning experience,
learn from mistakes, we have already learnt have therefore made more mistakes,
NOT the best way to build an Abomb though, Dos V'danye

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.