inputs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

inputs

Post by hob_goblin »

im wondering how I could have a user type in a number and that many input fields pop up with a number corresponding to it...like

i would type in 5, press submit, and

1. <input field>
2. <input field>
3. <input field>
4. <input field>
5. <input field>

would come up...
User avatar
chiefmonkey
Forum Commoner
Posts: 25
Joined: Sat Apr 20, 2002 5:21 am
Location: Glasgow UK

Post by chiefmonkey »

Try something like

<?php

$num=5;

for($i=0; $i < $num ; $i++) {

print("<input type>");

}

?>

HTH

George
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

let me explain a little more, ok i want to make a little template that contains the set of my links...so i dont have to keep editing the big file,

i want to be able to write out each link to a file, so the file has every single link in it, and i want to be able to add to it whenver i feel like it, or take a link away from it
dusty
Forum Contributor
Posts: 122
Joined: Sun Apr 28, 2002 9:52 pm
Location: Portsmouth, VA

Post by dusty »

you might want to look into using a real database rather than flat files, you'll find in the long run it's a lot easier.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

i dont know practically anything about mysql though :oops:
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

hob_goblin wrote:i dont know practically anything about mysql though :oops:
SQL Tutorial online
http://www.sqlcourse.com

PHP & MySQL
http://www.newbienetwork.net/content.php?id=3

And I will have another tutorial up shortly. And there are many on the net for PHP and MySQL.

Trust me, spend the time to learn it now, and you will be so glad you did.
Post Reply