You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 51 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - text fields [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Kiss_My_Rifle
Nuke Soldier
Nuke Soldier


Joined: Mar 04, 2003
Posts: 27


PostPosted: Mon Aug 02, 2004 12:43 pm Reply with quoteBack to top

I want to put a text field bo and I want to be able to take that data to send it to mysql. I know how to do the quiery bit but the how to get the text from the box. thanks
Find all posts by Kiss_My_RifleView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Mon Aug 02, 2004 7:59 pm Reply with quoteBack to top

Normally it is just
Code:

$var = $_POST['textfieldname']';

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Kiss_My_Rifle
Nuke Soldier
Nuke Soldier


Joined: Mar 04, 2003
Posts: 27


PostPosted: Tue Aug 03, 2004 10:06 am Reply with quoteBack to top

I am a complete n00b to all this I have out this and as u prob can see it don't work.
Quote:
$var = $_POST['name'];
echo "<form action=\"admin.php\" method=\"post\">
<table border=\"0\">"
."<td><input type=\"text\" name=".name." size=\"30\" maxlength=\"25\"></td></tr>";
echo "</td></tr></table></form>";

could u please post like the bit for it to work. I am after about 5 input boxes to be there. Thanks
Find all posts by Kiss_My_RifleView user's profileSend private messageVisit poster's website
movieman
Lieutenant
Lieutenant


Joined: Feb 29, 2004
Posts: 297

Location: New York

PostPosted: Tue Aug 03, 2004 11:02 am Reply with quoteBack to top

your missing a comma in the post part $var = $_POST['name'];
should be $var = $_POST['textfieldname']';, but besides that it is much more involed than that, you need a sql table to start, if you want to add things to a database.

_________________
http://www.powhost.com
Find all posts by moviemanView user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressMSN Messenger
Kiss_My_Rifle
Nuke Soldier
Nuke Soldier


Joined: Mar 04, 2003
Posts: 27


PostPosted: Tue Aug 03, 2004 11:40 am Reply with quoteBack to top

yes I have setup MySql and I have it connecting to the server and selecting the database. I have change the code a bit to get
Quote:
define("_NAME","User Name");
define("_NOUSERYET","You are not Regesterd");
define("_HOMEPAGE","Your Websight");
define("_EMAIL","E-Mail");
define("_PASSWORD","Password");
define("_SUBMIT","Submit");
$var = $_POST['textfieldname'];
echo "<center><b>"._NOUSERYET."</b></center><br><br>"
."<form action=\"login.php\" method=\"post\">"
."<table border=\"0\">"
."<tr><td><b>"._NAME.":</b></td><td><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"25\"></td></tr>"
."<tr><td><b>"._HOMEPAGE.":</b></td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"255\" value=\"http://\"></td></tr>"
."<tr><td><b>"._EMAIL.":</b></td><td><input type=\"text\" name=\"email\" size=\"30\" maxlength=\"255\"></td></tr>"
."<tr><td><b>"._PASSWORD.":</b></td><td><input type=\"password\" name=\"pwd\" size=\"11\" maxlength=\"10\"></td></tr>"
."<tr><td><input type=\"hidden\" name=\"fop\" value=\"create_first\">"
."<input type=\"submit\" value=\""._SUBMIT."\">"
."</td></tr></table></form>";

When I run this everything works but I get this problem
Quote:
Notice: Undefined index: textfieldname in D:\F1racers\login.php on line 13
what does this mean
Find all posts by Kiss_My_RifleView user's profileSend private messageVisit poster's website
bretonmage
Captain
Captain


Joined: Feb 21, 2004
Posts: 421


PostPosted: Tue Aug 03, 2004 12:35 pm Reply with quoteBack to top

Evaders99 wrote:
Normally it is just
Code:

$var = $_POST['textfieldname']';


That's funny... I've never needed this, the name= part of the text field stores the var fine, so
Code:
<input type=\"text\" name=\"url\" size=\"30\">

will store the var $url.
Find all posts by bretonmageView user's profileSend private message
Kiss_My_Rifle
Nuke Soldier
Nuke Soldier


Joined: Mar 04, 2003
Posts: 27


PostPosted: Tue Aug 03, 2004 12:41 pm Reply with quoteBack to top

when I put that etra ' after the braket I get this error
Quote:
Parse error: parse error, unexpected ''' in D:\F1racers\login.php on line 14

I have put the name = so that I can adventualy put languege files in
Find all posts by Kiss_My_RifleView user's profileSend private messageVisit poster's website
Kiss_My_Rifle
Nuke Soldier
Nuke Soldier


Joined: Mar 04, 2003
Posts: 27


PostPosted: Tue Aug 03, 2004 12:43 pm Reply with quoteBack to top

damm I get it lol so I don't need that var line I only need to use the textbos name and put a $ infont
Find all posts by Kiss_My_RifleView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12383


PostPosted: Tue Aug 03, 2004 12:50 pm Reply with quoteBack to top

If you are using register globals, you can access the variables directly by their name, $textfieldname

For security reasons, I would still use the $_POST and $_GET variables instead.

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Kiss_My_Rifle
Nuke Soldier
Nuke Soldier


Joined: Mar 04, 2003
Posts: 27


PostPosted: Tue Aug 03, 2004 1:19 pm Reply with quoteBack to top

I am really confused now so what do I need to do. if I put , after those brekts like above I get that error above but then if I don't put the var line in when I run
Quote:
echo $nname;

I get this error
Quote:
Notice: Undefined variable: nname in D:\F1racers\login.php on line 31

I am confused nothing said to do has worked for me
Find all posts by Kiss_My_RifleView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 1.040 Seconds - 433 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::