NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Please help clarify logistics

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-22-2005, 12:48 PM THREAD STARTER               #1 (permalink)
NamePros Member
 
SquireQuack's Avatar
Join Date: Aug 2005
Posts: 125
SquireQuack is on a distinguished road
 



Please help clarify logistics


I'm scripting a form in HTML and PHP. I need to have a link that adds extra fields , named inputX when when click.

My problem is, how do display all fields using $_POST['inputX']?
__________________
upload² |AIMForum.com - Ready, AIM, Chat!|Google Talk Forum - Where the world talks about Google!
Forum Elves - Quality Forum Posting At Affordable Prices! -|Order A Package|PaidPosts.com Help Boost Your Forum|BannerManage.com Sell direct advertisements on your website effortlessly!
SquireQuack is offline  
Old 10-22-2005, 01:10 PM   #2 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
The name of the field should be like this:

<input name="inputX[]">

PHP will automatically create an array and you can use it when you process it. Be warned that if a user skips a field (e.g. leaves one blank), and goes to fill out the next one, it will IGNORE the empty fields, meaning it won't even make them part of the array.
mholt is offline  
Old 10-22-2005, 01:14 PM THREAD STARTER               #3 (permalink)
NamePros Member
 
SquireQuack's Avatar
Join Date: Aug 2005
Posts: 125
SquireQuack is on a distinguished road
 



Thanks for the help!

Got a another question.

What's the best way to add more fields?
I'm a little unfamiliar with using the "?act" in /doc.php?act=action or do=action

how does that exactly work? How do I define what it does?
__________________
upload² |AIMForum.com - Ready, AIM, Chat!|Google Talk Forum - Where the world talks about Google!
Forum Elves - Quality Forum Posting At Affordable Prices! -|Order A Package|PaidPosts.com Help Boost Your Forum|BannerManage.com Sell direct advertisements on your website effortlessly!
SquireQuack is offline  
Old 10-22-2005, 01:22 PM   #4 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
In a URL, any text after a ? character is declaring variables.

file.php?variable=value&variable2=another_value

Use it as sparingly as you can as it presents security problems. You can then retrieve the variables in PHP like this:

$variable = $_GET['variable'];


Otherwise, the best way to add more fields is to use JavaScript, which would be instant as soon as you click a link or button. Or, you could use PHP and reload the page, but you need to find a way to keep the values. I recommend javascript.
mholt is offline  
Old 10-23-2005, 12:37 AM   #5 (permalink)
NamePros Member
Join Date: Oct 2005
Location: USA
Posts: 196
ralxz is an unknown quantity at this point
 



As compuXP said, I also reccomend JavaScript to add fields instantly. The only problem I see, though, is if javascript is disabled. Although it doesn't seem likely, a lot of users actually have javascript disabled (either manually, by an antivirus program, etc).

Maybe if you could detect if javascript is enabled on the client's computer, and then display the preffered way.
__________________
Freelance Graphic Designer for Hire
Portfolio

Contact info here.
ralxz is offline  
Old 10-23-2005, 07:00 AM   #6 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
At least display a notice that Javascript is required... if you really want compatibility make it detect if it's enabled - if not then do it slowly by a PHP reload.
mholt is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prescreening.com espllc Domain Appraisals 13 04-11-2005 08:13 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:28 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger