Search found 8 matches

by JohnPringle83
Fri Jan 13, 2012 4:08 pm
Forum: PHP coding => General
Topic: session_wont_start();
Replies: 1
Views: 359

session_wont_start();

Hello, I am having trouble starting a session. I have tried 2 different things and here is the code for both of them. The first one I just get a blank page when I am expecting to see my name: <!doctype html> <html> <head> <title>Sessions</title> </head> <body> <?php session_start(); $_SESSION['name'...
by JohnPringle83
Tue May 03, 2011 5:35 pm
Forum: mySQL & php coding
Topic: database doesn't update record
Replies: 1
Views: 375

Re: database doesn't update record

I have fixed this problem I had forgotten to run the mysql_query() function on the query and then instead of testing the query if it was true, I should've tested to see if the result was true. so inbetween these two lines of code: $query = "UPDATE users SET password='$codedpassword' WHERE email='$em...
by JohnPringle83
Tue May 03, 2011 4:59 pm
Forum: mySQL & php coding
Topic: database doesn't update record
Replies: 1
Views: 375

database doesn't update record

Hello, I have created a page where users can request a new password using just their e-mail address. The if($query) must be true because I do not get the error message associated with it and a new password is generated and displayed on screen along with the username. However, when I check my databas...
by JohnPringle83
Tue May 03, 2011 12:47 pm
Forum: HTML Basics
Topic: <select> <option> using php - Help needed
Replies: 3
Views: 1740

<select> <option> using php - Help needed

hello, I am trying to create a drop down list where users can select their title Mr, Mrs etc and I have the code below: <select name="title"> <?php $titlevalue=array(0,'Mr','Mrs','Miss','Ms'); $titleoption=array('Please Select','Mr','Mrs','Miss','Ms'); for($i=0;$i<=4;$i++){ echo "<option value=\"".$...
by JohnPringle83
Tue May 03, 2011 11:56 am
Forum: HTML Basics
Topic: setting a value in html select option using php
Replies: 4
Views: 1963

Re: setting a value in html select option using php

I have also now managed to do the Year which is the same as the code for day apart from a few minor changes. I started the loop from the value below the option I wanted to start from which is 1950, so I started the loop at 1949. I set the value 1949 to my default option of "year". I also changed whe...
by JohnPringle83
Tue May 03, 2011 11:38 am
Forum: HTML Basics
Topic: setting a value in html select option using php
Replies: 4
Views: 1963

Re: setting a value in html select option using php

Here is another update to my progress so far: I have also managed to make the months sticky but as I wanted to have the options displayed as words to the users, I had to tackle it a little differently. I used and array to store the names of the months including the default option and used the array ...
by JohnPringle83
Tue May 03, 2011 11:07 am
Forum: HTML Basics
Topic: setting a value in html select option using php
Replies: 4
Views: 1963

Re: setting a value in html select option using php

Hello, Thank you for responding so quickly. As I do not know javascript I couldn't really understand what to do there. I have how ever solved part of my problem and used a for loop to generate the options as you will see in the code below. <select name="day"> <?php for($i=0;$i<=31;$i++){ echo "<opti...
by JohnPringle83
Tue May 03, 2011 6:09 am
Forum: HTML Basics
Topic: setting a value in html select option using php
Replies: 4
Views: 1963

setting a value in html select option using php

Hello I am creating a user registration form and I have a section where they state their date of birth. I am trying to make it so that if there is an error somewhere in the form that the values in the select option do not reset to their default. This is the code I have tried, I hope you can see what...