Jump to content

where is this button coming from


BigD
 Share

Recommended Posts

In attached screen 1, there is a "Browse" button showed up in a wrong place. At one time It was next to the "PICTURE" row. after some modifications it ended up here. In attached screen 2, I have another PHP script coded in the same sytle but the "Browse" button is correctly placed on screen.I did not code this 2 buttons. I checked my codes, they are kind of the same. I did view source and did not see them coming from anywhere. Here is part of my code. what generated the buttons and what decided their locations? screen 1: echo "<tr><td>Last name</td><td><input type=\"text\" size=\"40\" name=\"lastname\"></td></tr>\n"; echo "<tr><td>First name</td><td><input type=\"text\" size=\"20\" name=\"firstname\"></td></tr>\n"; echo "<tr><td>Gender(M,F)</td><td><input type=\"text\" size=\"2\" name=\"gender\">"; echo " S S N(xxx-xx-xxxx)<input type=\"text\" size=\"11\" name=\"ssn\"></td></tr>\n"; echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1024000\">\n"; echo "<tr><td>Picture</td><input type=\"file\" name=\"picture\"></td></tr>\n"; echo "<tr><td>Date of Birth (yyyy-mm-dd)</td><td><input type=\"text\" size=\"10\" name=\"dob\"></td</tr>\n"; echo "<tr><td>Address</td><td><input type=\"text\" size=\"25\" name=\"address\">"; echo " City<input type=\"text\" size=\"18\" name=\"city\">"; screen 2: echo "<tr><td>Last name</td><td><input type=\"text\" size=\"40\" name=\"lastname\"></td></tr>\n"; echo "<tr><td>First name</td><td><input type=\"text\" size=\"20\" name=\"firstname\"></td></tr>\n"; echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1024000\">\n"; echo "<tr><td>Picture</td><td><input type=\"file\" name=\"picture\"></td></tr>\n"; echo "<tr><td>Address</td><td><input type=\"text\" size=\"30\" name=\"address\"></td</tr>\n"; echo "<tr><td>City</td><td><input type=\"text\" size=\"20\" name=\"city\"></td</tr>\n";

Link to comment
Share on other sites

That is not it. in screen1 coding after last line I have echo " State<input type=\"text\" size=\"2\" name=\"state\"> ZIP<input type=\"text\" size=\"5\" name=\"zip\"></td></tr> "; I want to put address, city, state, zip all in one table detail element.

Link to comment
Share on other sites

I mis read dsonesuk's post, he was refering to screen 2 coding.Yes it should be coded as he suggested, but the mistake did not cause any problem. PHP interpreter is pretty smart to correct my error and produced a nice web page..

Link to comment
Share on other sites

PHP may interpret the error correctly, but html will not especially with tables, such a mistake throws out table layout all over the place, as other cells use colspan and rowspan to determine where they should position themselves, they do not always follow a set stack order as you would get using div elements.

Link to comment
Share on other sites

php interepter has nothing to do with produced html and it cant fixed html thing (unless used with library like 'Tidy' or any other). your page is still broken. if you use any validator you can see that. if it is the last line of html page it may not create any visible trouble but if it is middle of something it can collapse whole page,css styling even js implementetion.

Edited by birbal
Link to comment
Share on other sites

I corrected the wrong </td> tags, the Browse button is still in the wrong place. Sorry it is long, here is the code: <?phpif (!isset($_SESSION['store_admin'])){ echo "<h2>Sorry, you have not logged into the system</h2>\n"; echo "<a href=\"admin.php\">Please login</a>\n";} else{ $userid = $_SESSION['store_admin']; echo "<form enctype=\"multipart/form-data\" action=\"admin.php\" method=\"post\">\n"; echo "<h2>Enter Student Information</h2><br>\n"; echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td>Class</td>\n"; echo "<td><select name=\"cat\">\n"; $query="SELECT classid,classname from class where classstatus = 'open'"; $result=mysql_query($query); while($row=mysql_fetch_array($result,MYSQL_ASSOC)) { $classid = $row['classid']; $classname = $row['classname']; echo "<option value=\"$classid\">$classname</option>\n"; } echo "</select></td></tr>\n"; echo "<tr><td>Last name</td><td><input type=\"text\" size=\"40\" name=\"lastname\"></td></tr>\n"; echo "<tr><td>First name</td><td><input type=\"text\" size=\"20\" name=\"firstname\"></td></tr>\n"; echo "<tr><td>Gender(M,F)</td><td><input type=\"text\" size=\"2\" name=\"gender\">"; echo " S S N(xxx-xx-xxxx)<input type=\"text\" size=\"11\" name=\"ssn\"></td></tr>\n"; echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1024000\">\n"; echo "<tr><td>Picture</td><input type=\"file\" name=\"picture\"></td></tr>\n"; echo "<tr><td>Date of Birth (yyyy-mm-dd)</td><td><input type=\"text\" size=\"10\" name=\"dob\"></td></tr>\n"; echo "<tr><td>Address</td><td><input type=\"text\" size=\"25\" name=\"address\">"; echo " City<input type=\"text\" size=\"18\" name=\"city\">"; echo " State<input type=\"text\" size=\"2\" name=\"state\">"; echo " Zip<input type=\"text\" size=\"5\" name=\"zip\"></td></tr>\n"; echo "<tr><td>Phone xxx-xxx-xxxx</td><td><input type=\"text\" size=\"15\" name=\"phone\">"; echo " Alternate Phone<input type=\"text\" size=\"15\" name=\"altphone\"></td></tr>\n"; echo "<tr><td>Email address</td><td><input type=\"text\" size=\"45\" name=\"email\"></td></tr>\n"; echo "<tr><td>Tuition</td><td>Fee's<input type=\"text\" size=\"8\" name=\"fee\">"; echo " Waiver<input type=\"text\" size=\"8\" name=\"waiver\">"; echo " Payment<input type=\"text\" size=\"8\" name=\"payment\"></td></tr>\n"; echo "<tr><td>Lock Box #</td><td><input type=\"text\" size=\"4\" name=\"lboxname\">"; echo " Lock Box Deposit<input type=\"text\" size=\"5\" name=\"lbdeposit\"></td></tr>\n"; echo "<tr><td>Note</td><td>Currently Tuition Fee is $4960. Lock Box Deposit is $15</td></tr>\n"; echo "</table>\n"; echo "<input type=\"submit\" value=\"Submit\">\n"; echo "<input type=\"hidden\" name=\"content\" value=\"addstudent\">\n"; echo "</form>\n";}?>

Link to comment
Share on other sites

echo "<tr><td>Picture</td><input type=\"file\" name=\"picture\"></td></tr>\n"; should be echo "<tr><td>Picture</td><td><input type=\"file\" name=\"picture\"></td></tr>\n"; if you look at table cells and the inner cell border is missing it usually means you have missed <tr></tr> or <td></td> at that location.

Edited by dsonesuk
Link to comment
Share on other sites

so that you know using table is not suitable for page layout you should use newer cleaner "box model" approach. http://w3schools.com/css/css_boxmodel.asp table should be limited to show tabular data. not page layouts.

Edited by birbal
Link to comment
Share on other sites

you have opening table rows and table division but they arent close either, so double check your code for opening and unclose table rows and table divisions

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...