jpratt Posted November 4, 2006 Share Posted November 4, 2006 I have the following code:[code]<?php //ini variables and get values $fname = $_POST['fname']; $minitial = $_POST['minitial']; $lname = $_POST['lname']; $email = $_POST['email']; $phone = $_POST['phone']; $altphone = $_POST['altphone']; $address = $_POST['adress']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $country = $_POST['country']; $interested = $_POST['interested']; $experience = $_POST['experience']; $teaching = $_POST['teaching']; $lessonhubexp = $_POST['lessonhubexp']; $bio = $_POST['bio']; $personalinfo = $_POST['personalinfo']; $webconference = $_POST['webconference']; $contact = $_POST['contact']; $hoursmonth = $_POST['hoursmonth']; $felony = $_POST['felony']; $felonyexp = $_POST['felonyexp']; $inetconnection = $_POST['inetconnection']; $webcam = $_POST['webcam']; $computer = $_POST['computer']; $sound = $_POST['sound']; $terms = $_POST['terms']; $errors = array(); //do serverside validation of required fields for those that have javascript turned off if ($fname = "") { $errors[] = "First Name"; } elseif ($lname = "") { $errors[] = "Last Name"; } elseif ($email = "") { $errors[] = "Email Address"; } elseif ($phone = "") { $errors[] = "Phone Number"; } elseif ($address = "") { $errors[] = "Address"; } elseif ($city = "") { $errors[] = "City"; } elseif ($state = "") { errors[] = "State"; } elseif ($zip = "") { errors[] = "Zip/Postal Code"; } elseif ($country = "") { errors[] = "Country"; } elseif ($interested = "") { errors[] = "Your Teaching Interests"; } elseif ($bio = "") { errors[] = "Biography"; } elseif ($personalinfo = "") { errors[] = "Personal Information"; } $size = sizeof($errors); if ($size == 0) { //connect to db and insert values mysql_select_db("lessonhub", $linkID); $insert = "INSERT INTO Instructor (FName, MI, LName, Address1, City, StateProvidence, PostCode, Phone1, Phone2, Country, Bio, Email, TeachInterest, YearExperience, WorkForLH, YearofTeach, InterestLH, WebInterview, ContactInt, TenHour, Felony, FelExplain, IntSpeed, webcam, goodComputer, soundCard, terms) VALUES ($fname, $minitial, $lname, $address, $city, $state, $zip, $phone, $altphone, $country, $bio, $email, $interested, $experience, $lessonhubexp, $teaching, $personalinfo, $webconference, $contact, $hoursmonth, $felony, $felonyexp, $inetconnection, $webcam, $computer, $sound, $terms)"; if (mysql_query($insert, $linkID)) { print "Your application has been sent sucessfully. We will contact you shortly to complete the process."; } else { print "There was an error sending your application. Please go back and submit your information again."; } } else { print "Please go back and fill out the following items:<br>"; foreach ($errors as $value) { print "$value<br>"; } } ?>[/code]It gives me a blank screen with no errors. Anyone see where I am going wrong? Quote Link to comment https://forums.phpfreaks.com/topic/26161-blank-screen/ Share on other sites More sharing options...
almightyegg Posted November 4, 2006 Share Posted November 4, 2006 are the squares meant to be there??? eg [][]if(blah) Quote Link to comment https://forums.phpfreaks.com/topic/26161-blank-screen/#findComment-119630 Share on other sites More sharing options...
Zane Posted November 4, 2006 Share Posted November 4, 2006 from the looks of ityou haven't even connected to you MySQL server yetyou need mysql_connect() somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/26161-blank-screen/#findComment-119635 Share on other sites More sharing options...
wildteen88 Posted November 4, 2006 Share Posted November 4, 2006 One problem I found is you started to use $error[] = 'Your error message here';then you went to error[] = 'Your error message here'; (note the lack of the dollar sign before error[])You start to do the above from line 53 and onwards:[code]elseif ($state = "") { errors[] = "State"; } elseif ($zip = "") { errors[] = "Zip/Postal Code"; } elseif ($country = "") { errors[] = "Country"; } elseif ($interested = "") { errors[] = "Your Teaching Interests"; } elseif ($bio = "") { errors[] = "Biography"; } elseif ($personalinfo = "") { errors[] = "Personal Information"; }[/code]that's your problem! Quote Link to comment https://forums.phpfreaks.com/topic/26161-blank-screen/#findComment-119637 Share on other sites More sharing options...
Zane Posted November 4, 2006 Share Posted November 4, 2006 nevermind wildteen got itI see you referencing a $linkID in thereso I'm wrong Quote Link to comment https://forums.phpfreaks.com/topic/26161-blank-screen/#findComment-119638 Share on other sites More sharing options...
jpratt Posted November 4, 2006 Author Share Posted November 4, 2006 My mysql_connect() is in my external file i included at the top of my file, so that is not the problem. That is where $linkID comes from. But yes I left the $ in front of my array on those lines. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/26161-blank-screen/#findComment-119640 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.