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 07-10-2002, 11:57 AM   #1 (permalink)
rockyracoon
Registered User
 
Join Date: Jun 2002
Posts: 10
rockyracoon is on a distinguished road
PHP - Hidden Fields and HREF's

How do I store and retrieve data using a hidden field and an HREF. Thanx for any help!
rockyracoon is offline   Reply With Quote
Old 07-10-2002, 12:21 PM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
Set the <form> action to be get instead of post
That will parse all your field values into the HREF url, instead of sending them hidden.

Or if you have something else in mind, the $field_name in PHP will allways hold the value of the given field, no matter if its hidden or displayed.

Else if its JavaScript, you just need to:
Code:
document.form_name.field_name.value = "what ever you want";
that'll set the value of any field, no matter if it's hidden or wahtever.
In order to get some info from the HREF, you can make some parsing of the document.href and split it up, with the use of document.href.indexOf("some_field_name=") and then search for the next & or end of url line. and that'll be the value assigned to that field hidden in the HREF.
Altho its URL-encoded it'll be quite easy to convert back.
__________________
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 07-10-2002, 01:09 PM   #3 (permalink)
rockyracoon
Registered User
 
Join Date: Jun 2002
Posts: 10
rockyracoon is on a distinguished road
someone rocks

thanks dude!
rockyracoon is offline   Reply With Quote
Old 07-10-2002, 01:42 PM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,693
redhead is on a distinguished road
Re: someone rocks

Quote:
Originally posted by rockyracoon
Someone rocks
Without the 'rocks' the stream would lose its song...
__________________
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 07-11-2002, 10:33 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
does redhead know everything??? it seems so
sde 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



All times are GMT -8. The time now is 02:09 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