chrometweaks.org

Which is the best and cheap iPage web hosting provider?

Click Here To View All Answers...


First question I have is Which is the best and cheap iPage web hosting provider? Thanks in advance for any answer. Second question of mine... I have several different webpages that combines php and html. Some of the pages validate and others don't. The ones that don't validate basically are form submit pages with embedded PHP. The validator seems to come to the start tags and can't get past due to the PHP in between.



<!<?php php in here?>>.

Some more html..

<!<?php some more php?>>.

Etc..

Here is my page that won't validate....

<?php.

// DEFINE VARIABLES.

$homeid = $_POST['homeid'];.

$user = $_POST['user'];.

$password = $_POST['password'];.

$submit = $_POST['homesubmit'];.

If (isset($submit)) {.

//CONNECT TO DATABASE HOMESUBMIT.

$DBhost = "localhost";.

$DBuser = "****";.

$DBpass = "****";.

$DBname = "homesubmit";.

$table = "sellersinfo";.

Mysql_connect($DBhost, $DBuser, $DBpass) or die ("Unable to connect to database.");.

Mysql_select_db("$DBname") or die ("Unable to select database.");.

$qselec = mysql_query("SELECT * FROM $table WHERE homeid = '$homeid' AND password = '$password'");.

If (mysql_num_rows($qselec)) {.

While($r=mysql_fetch_array($qselec)) {.

$homeid = $r['homeid'];.

$user = $r['user'];.

$password = $r['password'];.

$date = $r['date'];.

$forsaleby = $r['forsaleby'];.

$first = $r['first'];.

$last = $r['last'];.

$email = $r['email'];.

$phone = $r['phone'];.

$county = $r['county'];.

$city = $r['city'];.

$lotsize = $r['lotsize'];.

$squarefeet = $r['squarefeet'];.

$bedrooms = $r['bedrooms'];.

$baths = $r['baths'];.

$utilities = $r['utilities'];.

$citytaxes = $r['citytaxes'];.

$price = $r['price'];.

$comments = $r['comments'];.

$photoname = $r['photoname'];.

$termsofagree = $r['termsofagree'];.

$ip = $r['ip'];.

Mysql_close();.

//SHOW FORM WITH USERS DATA.

?>.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">.

<html>.

<head>.

<title>Triad Friendly Homes-Update Your Home Listing.</title>.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">.

<link rel="stylesheet" type="text/css" href="../triadfriendlyhomes.css">.

</head>.

<body>.

<table class="white" align="center" cellpadding="15" cellspacing="20">.

<tr>.

<td><fieldset><legend>Update Your Home Listing</legend><form name="homesubmit" method="post" action="update.php" enctype="multipart/form-data">.

<span class="red"> All required fields are denoted as : &nbsp; *</span><br><br>.

Home ID#:<input type="text" name="homeid" value="<?php echo"$homeid"?>"><br><br>.

<input type="hidden" name="user" value="<? echo "$user"?>">.

<input type="hidden" name="password" value="<?echo "$password"?>">.

<hr width="100%" size="1">.

For Sale By /img/avatar3.jpg<input type="radio" name="forsaleby" value="fsbo" <?.

If($forsaleby=="fsbo"){.

Echo "checked";.

}.

?>.

> &nbsp; &nbsp;.

Realtor or Broker<input type="radio" name="forsaleby" value="realtor"<?.

If($forsaleby=="realtor"){.

Echo "checked";.

}.

?>.

><br><br>.

First Name &nbsp;<input type="text" name="first" value="<? echo "$first"?>"> &nbsp; Last Name &nbsp;<input type="text" name="last" value="<? echo "$last"?>"><br><br>.

E-mail Address &nbsp; <input type="text" name="email" value="<?echo "$email"?>"> &nbsp; <span class="red">*</span><br><br>.

Phone Number &nbsp; <input type="text" name="phone" value="<? echo "$phone"?>"><br><br>.

<hr width="100%" size="1">.

Location of Home:<br><br>.

County &nbsp; <select name="county">.

<option value="Alamance" <?php.

If($county=="Alamance"){.

Echo "selected";.

}.

?>>Alamance.

<option value="Caswell" <?php.

If($county=="Caswell"){.

Echo "selected";.

}.

?>>Caswell.

<option value="Davidson" <?php.

If($county=="Davidson"){.

Echo "selected";.

}.

?>>Davidson.

<option value="Davie" <?php.

If($county=="Davie"){.

Echo "selected";.

}.

?>>Davie.

<option value="Forsyth" <?php.

If($county=="Forsyth"){.

Echo "selected";.

}.

?>>Forsyth.

<option value="Guilford" <?php.

If($county=="Guilford"){.

Echo "selected";.

}.

?>>Guilford.

<option value="Montgomery" <?php.

If($county=="Montgomery"){.

Echo "selected";.

}.

?>>Montgomery.

<option value="Randolph" <?php.

If($county=="Randolph"){.

Echo "selected";.

}.

?>>Randolph.

<option value="Rockingham" <?php.

If($county=="Rockingham"){.

Echo "selected";.

}.

?>>Rockingham.

<option value="Stokes" <?php.

If($county=="Stokes"){.

Echo "selected";.

}.

?>>Stokes.

<option value="Surry" <?php.

If($county=="Surry"){.

Echo "selected";.

}.

?>>Surry.

<option value="Yadkin" <?php.

If($county=="Yadkin"){.

Echo "selected";.

}.

?>>Yadkin.

</select><br><br>.

City or Locale &nbsp; <input type="text" name="city" value="<? echo "$city"?>"><br><br>.

<hr width="100%" size="1">.

Lot Size &nbsp; <input type="text" name="lotsize" value="<? echo "$lotsize"?>"><br><br>.

Square Feet of Home &nbsp;<input type="text" name="squarefeet" value="<? echo "$squarefeet"?>"><br><br>.

Number of Bedrooms &nbsp; <input type="text" name="bedrooms" value="<? echo "$bedrooms"?>"><br><br>.

Number of Baths &nbsp; <input type="text" name="baths" value="<? echo "$baths"?>"><br><br>.

City Utilities (sewer & water)&nbsp; yes <input type="radio" name="utilities" value="yes" <?.

If($utilities == "yes"){.

Echo "checked";.

}.

?>>&nbsp; no <input type="radio" name="utilities" value="no" <?.

If($utilities == "no"){.

Echo "checked";.

}.

?>><br><br>.

City Taxes &nbsp; yes <input type="radio" name="taxes" value="yes" <?.

If($citytaxes == "yes"){.

Echo "checked";.

}.

?>> &nbsp; no <input type="radio" name="taxes" value="no" <?.

If($citytaxes == "no"){.

Echo "checked";.

}.

?>><br><br>.

Price &nbsp; <input type="text" name="price" value="<? echo "$price"?>"><br><br>.

Comments About Home:<br>.

<textarea rows="10" cols="50" name="comments"><? echo "$comments"?></textarea>.

<input type="hidden" name="photo" value="<? echo "$originalphotoname"?>">.

<input type="hidden" name="ip" value="<? echo "$ip" ?>">.

<hr width="100%" size="1">.

Yes, I have read the terms of agreement.<input type="checkbox" name="termsofagree" value="yes"> &nbsp; <span class="red">*</span><br><br>.

<input type="submit" name="submitform" value="Click To Submit">.

</form></fieldset></td>.

</tr>.

<tr>.

<td><fieldset><legend>Update your photo.</legend>.

<form method="post" action="changephoto.php" enctype="multipart/form-data">.

<input type="hidden" name="homeid" value="<? echo "$homeid" ?>">.

<input type="hidden" name="first" value="<? echo "$first" ?>">.

<input type="hidden" name="last" value="<? echo "$last" ?>">.

<input type="hidden" name="photoname" value="<? echo "$photoname" ?>">.

<input type="hidden" name="ip" value="<?echo "$ip" ?>">.

Upload your new photo..

<!FILE UPLOAD>.

<input type="file" name="usersphoto"><br><br>.

<!END FILE UPLOAD>.

<input type="submit" name="upload" value="Upload">.

</form></fieldset></td>.

</table>.

</body>.

</html>.

<?.

}.

} else {.

Echo "Please check to be sure your Username, Password, and Home ID# are correct.";.

}.

}.

?>.

BTW, I checked to make sure all php and html tags were open and closed properly. Thanks for having a look...

Comments (8)

Hmm... I need to find out myself. I don't know what is the answer to your question. I'll do some Googling and get back to you if I find an answer. You should email the people at iPage as they probably can help you..

Comment #1

Hmm, I see what you mean. I have an idea or two, but they may be wrong..

This looks like a job for.

Scoutt.

I think...

Comment #2

I just realized something. You have to go to this page and fill in the short form before the editlisting.php page(the one that won't validate) will even display. If you go directly to editlisting.php it will just show a blank page. I opened "view source" and heres all it shows....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">.

<HTML><HEAD>.

<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>.

<BODY></BODY></HTML>.

And I didn't write any of it..

Maybe this is just a page that will not validate properly by it's own nature. If you use the first form to get to it then it will display properly and show the correct html code, and also validate. You can use this form to get to editlisting....

Http://www.triadfriendlyhomes.com/edit.html.

Use these to fill in the form....

Homeid - 1.

Username - derek02.

Password - boomerang.

Hit submit and it will display the editlisting.php page properly. Now that I think about it, this is more of a php issue than a validation/html issue. How about it you php guys, will this form ever be able to validate as is?..

Comment #3

I can hear scoutt now-"Oh no, not another php question."..

Comment #4

Yes, it's php related. I just found the problem. I had the form html inside an "if" statement. This caused the php to not parse the html when the first login page was not used to access the form. A simple cut and paste fixed the problem- I just moved the php stuff from the bottom to just above the start of the form. Sorry to have put you on the spot giz. I've been asking so many questions in the php forum that I hoped I could give scoutt a break for tonight...

Comment #5

No problem. Glad you spotted it..

I am glad for you, that you take the time to check your pages out for "silly errors" like that as there is no knowing what untold woe that could cause in someones browser. If it validates, you now have a page that will work in the widest range of browsers possible..

Too many people take the attitude that they just throw some code together, upload it, and if it looks good in their browser then they do no further checking of it all.... and those same people probably complain about buggy software, but they are usualy the ones writing buggy webpages and not caring about that...

Comment #6

Oh yeah, and stuff like that would probably confuse search engine spiders so much, such that they abandon indexing your site. Yet another good reason why you spent time fixing it!..

Comment #7

I really hate what I have to say but I have to agree with giz on that one..

Don't worry about asking php questions, I love them, keep them coming..

Just remember one thing, php is dynamic and html isn't. so if you can keep the html seperate from you php, well to a point that is, you will be better off. don't do what you just did and put it in a condition so if that condition is meet then the html runs..

Php will write headers if the page doesn't do anything, like you have seen. your result page is from php and you said you didn't write anything, well php does that, but never rely on it if you want the validator to validate...

Comment #8

Lesson # 12348324374373743737:.

Don't use html inside php if statements if you want it to validate...

Comment #9


This question was taken from a support group/message board and re-posted here so others can learn from it.