Frequently Asked Questions: script questions: page: 13
Page 13 of 17 · <1 ... 12 13 14 ... 17 >
-
1
When I try to look at index.php?section, it prompts me to download the file instead of opening it. Is it just something that I will have to upload to make it work, or did I do something wrong?
Yes, you have to upload it to your server for it work. In fact, that goes for all .php pages — you can’t see them before uploading, because all PHP files must be parsed by the server before they can return HTML to the browser (unless of course, you have PHP installed on your computer, but that’s usually not the case).
May 21, 2004 |
By Sasha |
Filed under FAQ, NL-ConvertToPHP, Scripts
-
2
I can’t get the variables to show up in the file I included it in. What can I do?
Check if you are using a full URL to the file in the include (something like http://www.yourdomain.com/folder/file.php). If that’s the case, try changing it to either a relative url:
include '../file.php';
or to the absolute path:
include '/home/yoursite/public_html/requirements.php';
That should solve any problems.
May 21, 2004 |
By Sasha |
Filed under FAQ, NL-GenericPages, Scripts
-
3
Help! I don’t know how to set up an HTML email form!
Setting up a form is quite easy. You can find a tutorial about this here.
May 21, 2004 |
By Louise |
Filed under FAQ, NL-PHPMail, Scripts
-
4
How can a have one of those check lists where the person can select one answer only (radio buttons)?
Radio buttons allow the user to choose only one of a number of options. When you choose one option, any previously selected option is unselected. Radio buttons are grouped together by assigning them all the same NAME (but different VALUES).
<p>Which one of these old TV Shows do you miss the most? <br /><input type="radio" name="oldtv" value="madaboutyou" />Mad About You <br /><input type="radio" name="oldtv" value="fullhouse" />Full House <br /><input type="radio" name="oldtv" value="stepbystep" />Step by Step <br /><input type="radio" name="oldtv" value="partyof5" />Party of Five <br /><input type="radio" name="oldtv" value="dawsonscreek" />Dawson's Creek <br /><input type="radio" name="oldtv" value="buffy" />Buffy, the Vampire Slayer</p>
Like checkboxes, you can define a radio button to be checked by default, but unlike checkboxes you should only have one radio button in a group initially checked.
<p>Which one of these old TV Shows do you miss the most? <br /><input type="radio" name="oldtv" value="madaboutyou" checked="checked" />Mad About You <br /><input type="radio" name="oldtv" value="fullhouse" />Full House <br /><input type="radio" name="oldtv" value="stepbystep" />Step by Step <br /><input type="radio" name="oldtv" value="partyof5" />Party of Five <br /><input type="radio" name="oldtv" value="dawsonscreek" />Dawson's Creek <br /><input type="radio" name="oldtv" value="buffy" />Buffy, the Vampire Slayer</p>
Now you have Mad About You checked and set as default.
Remember: all the radio buttons in a group must have identical names (like in the example above - the name is set to "oldtv" for each option).
May 21, 2004 |
By Louise |
Filed under FAQ, NL-PHPMail, PHP, Scripts
-
5
How can I make a question with checkboxes to choose the answers?
Checkboxes are used to allow the user to select more than one item from a list. Here’s an example:
<p>Which of the following TV shows do you watch? (choose any combination) <br /><input type="checkbox" name="friends" value="Y" />Friends <br /><input type="checkbox" name="er" value="Y" />ER <br /><input type="checkbox" name="willandgrace" value="Y" />Will&Grace <br /><input type="checkbox" name="gilmoregirls" value="Y" />Gilmore Girls <br /><input type="checkbox" name="that70sshow" value="Y" />That 70's Show</p>
Now, the inital value of a checkbox can be defined to be checked or not. If you want any box to be already checked by default, you have to add ‘checked=”checked”‘ in their form definition, like so:
<p>Which of the following TV shows do you watch? (choose any combination) <br /><input type="checkbox" name="friends" value="Y" checked="checked" />Friends <br /><input type="checkbox" name="er" value="Y" />ER <br /><input type="checkbox" name="willandgrace" value="Y" />Will&Grace <br /><input type="checkbox" name="gilmoregirls" value="Y" checked="checked" />Gilmore Girls <br /><input type="checkbox" name="that70sshow" value="Y" />That 70's Show</p>
Now you have both Friends and Gilmore Girls checked as default.
May 21, 2004 |
By Louise |
Filed under FAQ, NL-PHPMail, Scripts