|
 |
|
 |
09-22-2006, 11:30 AM
|
#1 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 5
|
Adding a Link
I have a page that already has a "submit" button and I would like to offer an additional link to another page...
I have put the <form> into the template...but nothing happens...
Is there something else I should be adding to this template?
Thanks for any help!
|
|
|
09-22-2006, 11:36 AM
|
#2 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,503
|
since there are many ways to code forms and links, it would probably help if you posted a small sample of the area in your code that is in question.
this way, the answer will apply to your situation.
question: does this link need to submit the form data? or just re-direct the browser to another page?
if it's the latter, then here is the html code for a link:
HTML Code:
<a href="mypage.html">My Link</a>
__________________
Mike
|
|
|
09-22-2006, 11:48 AM
|
#3 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 5
|
Adding a Link
The site is a wholesale site...as such, prices are not posted.
To see the prices, you are prompted to login...and this link brings you to the login page.
Once you login...you hit the "submit" button...and it brings you to the main page of the site.
I want to offer an additional button that would give the viewer the option to "return to the page I was viewing."
...so...I guess it would be a redirect to the previous page...
I hope this makes sense....
Thanks for your help!
|
|
|
09-22-2006, 08:01 PM
|
#4 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,503
|
the example i provided above should work.
__________________
Mike
|
|
|
09-23-2006, 01:33 AM
|
#5 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
|
In the login page you could fill in some "redirect after login" instructions from the HTTP_REFERER variable.
|
|
|
09-23-2006, 06:43 AM
|
#6 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 5
|
Adding a Link
Here is the script for the page...I know there must be something missing...I'm just not sure I wrote this correctly...I'm not sure I wrote the variable correctly...thanks for the help!
PHP Code:
<form action="{loginURL}" method="POST" name="login_form">
<input IF="!target=#login#" type="hidden" name="returnUrl" value="{url}"/>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td>
<FONT class="SidebarItems">E-mail</FONT><br>
<input type="text" name="login" value="{login:r}" size="20" maxlength="128"><br>
<FONT class="SidebarItems">Password</FONT><br>
<input type="password" name="password" value="" size="20" maxlength="128"><br>
<input type="hidden" name="target" value="login">
<input type="hidden" name="action" value="login">
</td>
</tr>
<tr>
<td>
<a href="javascript: document.login_form.submit()" class="SidebarItems"><input type="image" src="http://codenewbie.com/forum/images/go.gif" width="13" height="13" border="0" align="absmiddle"> Submit</a><br>
<a href="cart.php?target=profile&mode=register" class="SidebarItems"><img src="http://codenewbie.com/forum/images/go.gif" width="13" height="13" border="0" align="absmiddle"> Register</a>
</td>
<form action="{prev URL}" method="LINK" name="login_form">
<input IF="!target=#login#" type="hidden" name="Prev Url" value="Return to Page I was viewing"/>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td>
<FONT class="SidebarItems">E-mail</FONT><br>
<input type="text" name="login" value="{login:r}" size="20" maxlength="128"><br>
<FONT class="SidebarItems">Password</FONT><br>
<input type="password" name="password" value="" size="20" maxlength="128"><br>
<input type="hidden" name="target" value="login">
<input type="hidden" name="action" value="login">
</td>
</tr>
<tr>
<td>
<a href="cart.php?target=prev page><Return to Page I was viewing></a>
<a href="javascript: document.login_form.submit()" class="SidebarItems"><input type="image" src="http://codenewbie.com/forum/images/go.gif" width="13" height="13" border="0" align="absmiddle"> Returm to Page I was viewing</a><br>
<a href="cart.php?target=profile&mode=register" class="SidebarItems"><img src="http://codenewbie.com/forum/images/go.gif" width="13" height="13" border="0" align="absmiddle"> Register</a>
</td>
</tr>
</table>
</form>
Last edited by redhead; 09-23-2006 at 07:59 AM.
|
|
|
09-23-2006, 08:34 AM
|
#7 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 5
|
Adding a Link
Dear Redhead,
Thank you for the input...but for some reason....it only reads the first <form>...It seems to stop there...and doesn't read the next <form>....???
Again...thanks for trying....it must be something inherent in the software....
|
|
|
09-23-2006, 09:57 AM
|
#8 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,166
|
You failed to close the first form tag.
|
|
|
09-23-2006, 09:57 AM
|
#9 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
|
I didn't change a thing in your orriginal post, I just embedded the code within [php] tags, to make it more readable for sde, myself and others..
What I was thinking in my first post, was in the login-form have a hidden field, which would contain the HTTP_REFERER value, and uppon submitting determain if it has a value which is acceptable, if so, display a "you're beeing redirected" page, and redirect to that value, if not, just say "thanx for logging in" and redirect to the frontpage...
Thats basicaly the way most login systems handle it these days.
|
|
|
09-23-2006, 08:42 PM
|
#10 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 5
|
Adding a Link
To all,
Thank you so much for all your help....I think I got it going!!
Thanks again,
ELJ
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 06:18 AM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|