-
Hi from a Peterborough UK designer
Have to say i wasn't that particularly bothered before the adverts. But now Yuri is my God (No not Yuri from COD!!) Just goes to show how 60 seconds on an advert can propel you to international stardom!!
-
Newy but oldy
Hiya mate, have to say i really like your site!
-
Hello WDF members!
Welcome Lady Shiraz. have fun!
-
Database advice needed!
Thanks for all the advice guys, its much appreciated. I've actually got it all working now!! i know its only really simple but its a big achievement for me! Now going to look at making the validation more thorough but at least now its at the lowest acceptable level! this is the code i used for anyones future reference - hopefully this will help someone else out someday, its took me 7 bloody hours!!! <?php $con = mysql_connect("localhost","*****","*****"); if (!$con) { die('Could not connect: ' . mysql_error()); } $fullname=$_POST['fullname']; $email=$_POST['email']; //if no fullname entered and no email entered print an error if (empty($fullname) && empty($email)){ print "No email address and no name was entered.<br>Please include a name and email address."; } //if no name entered send print an error elseif (empty($fullname)){ print "No name was entered.<br>Please include a name."; } //if no email entered send print an error elseif (empty($email)){ print "No email address was entered.<br>Please include your email."; } //if the form has both an email and a message elseif (!empty($fullname) && !empty($email)) { mysql_select_db("*****", $con); if(mysql_query("INSERT INTO email_list (fullname, email) VALUES ('$fullname', '$email')")) echo "Your email has been added to our list!"; } mysql_close($con); ?>
-
-
Database advice needed!
Thanks Kensha, I have variables in the INSERT table now. The rest of what you put went straight over my head haha!! But as 'isset ()' returns a boolean value wouldnt i have to have some other php code somewhere to say what to output depending on boolean value? I really need to learn this stuff quick!!! anyway here is what i have so far. <?php $con = mysql_connect("localhost","*****","*******"); if (!$con) { die('Could not connect: ' . mysql_error()); } $fullname=$_POST['fullname']; $email=$_POST['email']; mysql_select_db("********", $con); if(mysql_query("INSERT INTO email_list (fullname, email) VALUES ('$fullname', '$email')")) if (empty($fullname) && empty($email)){ print "No email address and no name was entered.<br>"; } elseif (empty($fullname)){ print "No name was entered.<br>Please include a name.<br>"; } elseif (empty($email)){ print "No email address was entered.<br>Please include your email."; } else { echo "Your email has been added to our list!"; } mysql_close($con); ?> I can understand why its submitting the form first and then displaying the relevant error message, but if i put the INSERT INTO bit at the end of the code it doesnt work at all!!
-
Database advice needed!
Thanks Adam, Yeah i have created variables now im trying to write a code to validate the form before its submitted. Struggling a bit here though! The form is submitting regardless of whether a/all field is empty, but still displaying the correct error message! This PHP lark is going to be a steep learning curve!!
-
-
-
-
-
Database advice needed!
what a tail i really am, in the HTML i had < form action='submit.php' action='POST'> POST is meant to be method='' Well i say im a tail, i hardly know any php/mysql and i got this off of a blog! very amateurish!! Thanks for all your help though mate!!
-
Database advice needed!
Yeah using 'id' didn't make a difference
-
Database advice needed!
I did try id's but i'll try again anyway and try both static/dynamic too
-
Database advice needed!
Arrrghhhhh I'm starting to hate php/mysql already!!!!! i've spent all morning on this, and looks like i'll be spending all day on it!! Tried as much as i could think of but it just wont work with the dynamic parts!
-
Database advice needed!
Ok using Static Values Worked, i'll try mess around with it a little more but its doing my bloody head in today lol!
-
Database advice needed!
Table is called email_list i have id, fullname and email columns
-
Database advice needed!
Hi Guys, Ok i've made a simple Form for my website, code as follows; <form action='submit.php' action='POST'> <p><input type='text' name='fullname' />Full name </p> <p><input type='text' name='email' />Email</p> <input type='submit' value='Sign Up!' /> </form> I have created a table in my database on my host. here is my submit.php code; <?php $con = mysql_connect("localhost","*****","*******"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("********", $con); if(mysql_query("INSERT INTO email_list (fullname, email) VALUES ('".$_POST['fullname']."', '".$_POST['email']."')")) { echo "Your email has been added to our list!"; } else { echo "There was an error adding your email to our list. Please try again."; } mysql_close($con); ?> Ok so here is the problem, i uploaded everything to the host and filled out the form a few times to make sure it worked. and i got the message "your email has been added to our list" all 3 times. When i went to my table on phpmyadmin the table showed there were 3 records, but the 'name' and 'email' fields were blank......???! Any one have any idea why? You can probably guess im kinda new to php/mysql but trying my bloody best to learn!
-
Responsive Horizontal Nav bar
Hi guys, Currently my site has a vertical nav menu on the left of every page. I have coded a Horizontal Nav bar to be Just under the Header area of the page but i'm having trouble making it responsive. I have a margin of 5% set left and right to slightly center the whole content. And due to length of some titles in the nav bar have set width to 85px for the border of each menu item. How the hell do i make this responsive? When viewing the new horizontal menu bar on different size screen it puts the whole page all over the place!!
-
301 Redirect Help
Ok scrap this post, think i've done it now! Seems to be working fine anyway! Heres the code i used (i decided on redirecting all to the non www site) RewriteEngine On RewriteCond %{HTTP_HOST} ^www.buyforyourboyfriend.co.uk [nocase] RewriteRule ^(.*) http://buyforyourboyfriend.co.uk/$1 [last,redirect=301] If anyone knows if thats 100% right or not would still be greatful!