You are here: Submit form with variable for action? « PHP Programming Language « IT news, forums, messages
Submit form with variable for action?

Posted by tencip on 09/25/05 22:30

Hi everyone,

So, i've got a form that is very simple. It hold three elements:
username, password, and domain. The goal here is to have the form
submit the login to an administrative section depending on which domain
someone has chosen.

For instance, let's say we have three administrative sites, that all
have different URLs, but we want this one form to handle logging into
any of them. So, the form itself needs to have a dynamic action
element.

Here's an example:

Code:

<form action="http://www.mysite.com/admin/index.php" method="post"
name="login" id="login" >
<input name="usrname" type="text">
<input name="pass" type="password">
<input name="domain" type="text">
<input name="submit" type="submit" value="Login">
</form>

Now, the issue is, instead of the action I have now, I need the action
to change based on what is typed by the user in the domain field. So in
the case above, if the user types "bobsite.com" in the domain field,
the action needs to point to "http://www.bobsite.com/admin/index.php".

I have looked near and far for a solution for this. Using PHP, so have
some flexibility, and javascript is okay if we have to use it.

Best,
Ryan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация