8, September 2008

Newbie to php; help with what the different fields mean - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Newbie to php; help with what the different fields mean
« previous next »
Pages: [1] Print

Author Topic: Newbie to php; help with what the different fields mean  (Read 393 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Feb 21, 2007, 07:47:38 AM »

Okay, I really need quite a bit of help -- this is my first ever attempt at a form (much less a php form!)....

I read some other help topics.  I found examples of code.  I am really trying to figure out what the particular values mean.  This is what I have so far:

<?php
echo '<form method="get" action="' . $_SERVER['PHP_SELF'] . '">
<table border="0">
<tr>
<td>User name:</td>
<td><input type="text" name="User name"></td>
</tr>
</table>
<hr>
<b>Amount of sleep:</b><br>
<table border="0" cellspacing="10px">
<td><input type="radio" name="> 10 hours" value="Print_W"> >10 hours</td>
<td><input type="radio" name="8 to 10 hours" value="Web_WO"> 8 to 10 hours</td>
<td><input type="radio" name="6 to 8 hours" value="Print_W"> 6 to 8 hours</td>
<td><input type="radio" name="4 to 6 hours" value="Web_WO"> 4 to 6 hours</td>
<td><input type="radio" name="2 to 4 hours" value="Print_W"> 2 to 4 hours</td>
<td><input type="radio" name="Less than hours" value="Web_WO"> Less than 2 hours</td>
</tr>
</table>


For example, echo '<form method="get" action="' . $_SERVER['PHP_SELF'] is part of the code example I was using.  Could someone please tell me what that exactly means so I can make sure I am using the correct values?

Also, in the radio buttons coding, first you enter a name, then value, and then from what I can understand, the last field is how it will display?  What exactly does the value mean?  (again, that's from example code)  Should the name and the display text be the same?

I'm sorry I'm so clueless.  Don't be afraid to talk to me as if I were the village idiot.  I just really want to learn! Any help would be GREATLY appreciated.

Thanks a ton!
« Last Edit: Feb 21, 2007, 07:50:18 AM by Llally »
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #1 on: Feb 21, 2007, 09:16:09 AM »

First of all, welcome aboard Wink

I will try to answer some of your questions :

Quote
For example, echo '<form method="get" action="' . $_SERVER['PHP_SELF'] is part of the code example I was using.  Could someone please tell me what that exactly means so I can make sure I am using the correct values?

From the manual :

The filename of the currently executing script, relative to the document root. For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar Visit through proxy  would be /test.php/foo.bar. The __FILE__  constant contains the full path and filename of the current (i.e. included) file.

If PHP is running as a command-line processor this variable contains the script name since PHP 4.3.0. Previously it was not available.

Quote
Also, in the radio buttons coding, first you enter a name, then value, and then from what I can understand, the last field is how it will display?  What exactly does the value mean?  (again, that's from example code)  Should the name and the display text be the same?

Name is the name of the $_GET value, value is the value that this variable will get if you select this radio button, and the last is what you will display. The name and the display text can be different.

BTW check also this thread :

http://www.webdigity.com/index.php/topic,5992.0.PHP+forms+-+a+few+questions.html Visit through proxy

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #2 on: Feb 21, 2007, 09:32:03 AM »

Nikolas!  So nice to see someone responding so fast! 

So, I've just been blindly writing this php form flying by the seat of my pants hoping someone would respond!  Thank you for the reply.

If only you had some idea how much learning I have to do from you all!  Smiley

Next set of questions:  I was setting up the new table after setting up the database for this form.  It was asking me all SORTS of things I had no clue what to put.  The fields read as follows:
Field     TypeDocumentation     Length/Values*     Attributes     Null     Default**     Extra

Could someone help me out with what to put in these?  I've never had to set up a table in MySQL before.

In the above reply, you said 'value' is the value that this variable will get if you select this radio button.  Does that mean that in my table there must be a field/value for each value on my form?

I know this is most certainly remedial stuff for you guys but I really appreciate any 'schooling you can give me.

Thanks!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8037
41179 credits
Members referred : 3



« Reply #3 on: Feb 21, 2007, 10:33:05 AM »

I don't want to disappoint you but mySql is not something that you can learn from forums. Even if we help you somehow - which I don't think is so possible - you would end up with a very slow and security problematic application.

I would suggest you to look for a book regarding mysql.

Until then use something more automated, a CMS/blog system or something that gives you the ability to do what you want without writing much code.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6060
Tags : help php Newbie Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Newbie to php; help with what the different fields mean
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Sep 08, 2008, 03:32:11 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.302
Total Topics: 7.479
Total Members: 3.907
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: phpprofit

14 Guests, 2 Users online :

6 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.