Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-22-2006, 11:30 AM   #1 (permalink)
ELJ
Registered User
 
Join Date: Sep 2006
Posts: 5
ELJ is on a distinguished road
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!
ELJ is offline   Reply With Quote
Old 09-22-2006, 11:36 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 09-22-2006, 11:48 AM   #3 (permalink)
ELJ
Registered User
 
Join Date: Sep 2006
Posts: 5
ELJ is on a distinguished road
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!
ELJ is offline   Reply With Quote
Old 09-22-2006, 08:01 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
the example i provided above should work.
__________________
Mike
sde is offline   Reply With Quote
Old 09-23-2006, 01:33 AM   #5 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
In the login page you could fill in some "redirect after login" instructions from the HTTP_REFERER variable.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 09-23-2006, 06:43 AM   #6 (permalink)
ELJ
Registered User
 
Join Date: Sep 2006
Posts: 5
ELJ is on a distinguished road
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="
javascriptdocument.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.
ELJ is offline   Reply With Quote
Old 09-23-2006, 08:34 AM   #7 (permalink)
ELJ
Registered User
 
Join Date: Sep 2006
Posts: 5
ELJ is on a distinguished road
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....
ELJ is offline   Reply With Quote
Old 09-23-2006, 09:57 AM   #8 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,139
Belisarius is on a distinguished road
You failed to close the first form tag.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 09-23-2006, 09:57 AM   #9 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
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.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 09-23-2006, 08:42 PM   #10 (permalink)
ELJ
Registered User
 
Join Date: Sep 2006
Posts: 5
ELJ is on a distinguished road
Adding a Link

To all,

Thank you so much for all your help....I think I got it going!!

Thanks again,
ELJ
ELJ is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jump to a sub Function from a link???? NevadaSam HTML, XML, Javascript, AJAX 0 05-05-2006 05:49 PM
hide target link rivers9 HTML, XML, Javascript, AJAX 8 08-25-2005 12:05 PM
copy a directory link with -Rs sde Linux / BSD / OS X 3 02-15-2005 05:34 PM


All times are GMT -8. The time now is 05:46 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting