Jump to content

Xenia

Members
  • Posts

    13
  • Joined

  • Last visited

Xenia's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Actually the code has most of it html code just it some points I am including PHP code to display information from the database.I have create a table with 5 columns and 4 rows and the dimensions for every cell is width:154, height :66. In the first column I have merge the cells in order to put one image with dimensions width:77,height:264(66x4(rows)). At the second column in the first row I have put an image(width:154,height:66).In the second row inside the cell I have put a table with two rows and two columns. I have merge the two rows from the first column and I have put php code which displays an image from the database.This image has a form as it redirect to another page. At the other two rows I am displaying information from the database. The same I have done with the two remain rows.(Actually the problem is that when I put the page live and I browse from Internet explorer it displays it as it is higher the cell from the specific height of 66.)At the third column I have merge the 3 rows and I have out an image taken from the database.The last row is just empty.The forth column displays other info from the database,the same have with the cell of the second row.The last 3 and 4 cells have been merged and include another table with 3 rows. The table has two drop down menus and one button with a form and hidden fields.The last column I have also merge the cells and I have insert another table with 4 rows.Before the table starts I have put a form which includes three drop down menus in the first cell, a button in the second cell, another image hyperlink in the third cell and at the fourt cell another image hyperlink.At the end of the table I close the form.When I put the php code it mess the design and make the cells of the second columnbigger than the height I want.Do you think that php might push the height of a cell?Thank you,Xenia
  2. Ηι,I have problem with the design of a page as in internet expoler it doesn't display it correct on contrast with the Mozilla Firefox.Please I would appreciate if you could have a look to my code and make any suggestions. <table width="637" height="287" border="0" align="center" cellpadding="0" cellspacing="4"> <tr> <td width="77" height="276" rowspan="4"> </td> <td width="154" height="66" valign="top" class="generalborder"><img src=".boycheckout.jpg" width="154" height="66" ></td> <!-- start to display the details of the specifc info--> <? $sqlcolour = "Select * from Items,Brands,Kids,Categories where Brands.brandID=Items.brandID and Items.kidID=Kids.kidID and Items.categoryID=Categories.categoryID and Items.itemID='$itemID'"; $rscolour=mysql_query($sqlcolour); $num=mysql_num_rows($rscolour); $c=0; while ($c<$num){ $itemID=mysql_result($rscolour,$c,"itemID"); $brand=mysql_result($rscolour,$c,"brand_name"); $colour=mysql_result($rscolour,$c,"colour"); $category=mysql_result($rscolour,$c,"categoryname"); $size=mysql_result($rscolour,$c,"size"); $price=mysql_result($rscolour,$c,"price"); $image=mysql_result($rscolour,$c,"image_small"); $image_large=mysql_result($rscolour,$c,"image_large"); $matching1=mysql_result($rscolour,$c,"matching1"); $matching2=mysql_result($rscolour,$c,"matching2"); $matching3=mysql_result($rscolour,$c,"matching3"); $descr=mysql_result($rscolour,$c,"description"); $ref=mysql_result($rscolour,$c,"ref"); ?> <td width="154" height="66" rowspan="3" valign="top"><? $c++; }?> <img src="/large_<? echo $image_large; ?>" align="top" ></td> <td width="154" height="66" valign="top"><span><? echo $brand; ?></span><span class="generalfont"><? echo $descr; ?></span></td> <td width="154" height="276" valign="top" rowspan="4" > <form name="search" method="post" action="../Xenia2/test.php"> <table width="154" height="276" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="154" height="19" valign="top" > <select name="kids" > <option selected value="kids"> Kids</option> <? $querykids="select DISTINCT Kids.kid_category from Items,Kids where Kids.kidID=Items.kidID"; $rskids=mysql_query($querykids); while ($rowkids=mysql_fetch_array($rskids)){ echo "<option>$rowkids[kid_category]</option>"; } ?> </select></td> </tr> <tr> <td height="5"></td> </tr> <tr> <td height="19" valign="top"><select name="brands" > <option selected value="brands">Brands</option> <? $querybrands="select DISTINCT Brands.brand_name from Items,Brands where Brands.brandID=Items.brandID "; $rsbrands=mysql_query($querybrands); while ($rowbrands=mysql_fetch_array($rsbrands)){ echo "<option>$rowbrands[brand_name]</option>"; } ?> </select></td> </tr> <tr> <td height="4"></td> </tr> <tr> <td height="19" valign="top"><select name="category" > <option selected value="category">Category</option> <? $querycategory="select DISTINCT Categories.categoryname from Items, Categories where Items.categoryID=Categories.categoryID and Items.kidID='4'"; $rscategory=mysql_query($querycategory); while ($rowcategory=mysql_fetch_array($rscategory)){ echo "<option>$rowcategory[categoryname]</option>"; } ?> </select></td> </tr> <tr> <td height="7"></td> </tr> <tr> <td height="66" class="generalborder"><input name="submit" type="image" id="submit" src="boycheckout.jpg" align="top" width="154" height="66"></td> </tr> <tr> <td height="4" valign="top"></td> </tr> <tr><td height="66" class="generalborder"><a href="/checkout.php" ><img src=".boycheckout.jpg" alt="checkout" width="154" height="66" border="0" align="top"></a></td> </tr> <tr> <td height="4" valign="top"></td> </tr><tr> <td height="66" class="generalborder"><a href="Xenia2/test.php" ><img src="boyback.jpg" width="154" height="66" border="0" align="top" onclic"history.go(-1)"></a></td> </tr> </table> </form></td> </tr> <tr> <td height="66" valign="top" class="generalborder"> <form action=".matching_items.php" method="get"> <table width="154" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="78" valign="top" rowspan="2"><input name="submit" type="image" id="submit" src="/small_<? echo $matching1; ?>" alt="matching one" align="top" /> <input name="matchingID" type="hidden" value="<? echo $row1['itemID']; ?>"/> </td> <td width="76"><span class="generalfont"><? echo $brand; ?></span></td> </tr> <tr> <td><span class="generalfont">£<? echo $price; ?></span></td> </tr> </table> </form></td> <td height="66" valign="top"><span class="generalfont"><? echo $size; ?></span><span class="generalfont"><? echo $colour; ?></span><span class="generalfont"><? echo $category; ?></span></td> </tr> <tr> <td height="66" valign="top" class="generalborder"> <form action=".matching_items.php" method="get"> <table width="154" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="78" rowspan="2"><input name="submit2" type="image" id="submit2" src="images/../small_<? echo $matching2; ?>" alt="matching two" align="top" /> <input name="matchingID" type="hidden" value="<? echo $row1['itemID']; ?>" /></td> <td width="76"><span class="generalfont"><? echo $brand; ?></span></td> </tr> <tr> <td><span class="generalfont">£<? echo $price; ?></span></td> </tr> </table> </form></td> <td width="120" height="75" rowspan="2" valign="top"> <form action="/addtobasket.php" method="post"> <table width="120" height="75" border="0" cellpadding="0" cellspacing="0" valign="top" > <tr> <td width="119" height="25" valign="top"><label class="generalfont">SIZE</label> <select name="size" class="selectcriteria"> <? $querysizeselect="select DISTINCT Items.size from Items where Items.ref='$ref'"; $rssizeselect=mysql_query($querysizeselect); while ($rowsizeselect=mysql_fetch_array($rssizeselect)){ echo "<option>$rowsizeselect[size]</option>"; } ?> </select> <input name="colourdetails" type="hidden" value="<? echo $colour; ?>" /> <input name="descrdetails" type="hidden" value="<? echo $descr; ?>" /> <input name="categorydetails" type="hidden" value="<? echo $category; ?>" /> <input name="imagedetails" type="hidden" value="<? echo $image; ?>" /> <input name="branddetails" type="hidden" value="<? echo $brand; ?>" /></td> </tr> <tr> <td height="25" valign="top"><label class="generalfont">QTY</label> <select name="qty" class="selectcriteria"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> </select> <input name="itemIDdetails" type="hidden" value="<? echo $itemID; ?>" /> <input name="refdetails" type="hidden" value="<? echo $ref; ?>" /></td> </tr> <tr><td height="25" valign="top" ><input name="Submit" type="submit" class="selectcriteria" value="add to basket" /></td> </table> </form> </td> </tr> <tr> <td height="36" valign="top" class="generalborder"> <form action="./matching_items.php" method="get"> <table width="154" valign="top" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="78" rowspan="2"><input name="submit22" type="image" id="submit22" src="/small_<? echo $matching3; ?>" alt="matching three" align="top" /> <input name="matchingID2" type="hidden" value="<? echo $row1['itemID']; ?>" /></td> <td width="76"><span class="generalfont"><? echo $brand; ?></span></td> </tr> <tr> <td><span class="generalfont">£<? echo $price; ?></span></td> </tr> </table> </form></td> <td height="66"><!-- the add item code will be inserted--></td> </tr> </table> Thanks,Xenia
  3. Do you think that i can connect two tables without including their foreign keys?MySQL supports the Alter command which add a foreign key?I would be very gretful if you could you please answer my questions?Thank you very much,Xenia
  4. I tried to add data to the table but the value for the foreign key didn't display it.Normally when i was adding data tis column would have taken the value from the parent table.Is that right?So because it doesn't do that i supposed that the foreign key was not created
  5. I have already created the column but again it doesn't work
  6. Thank you aspnetguy,But again nothing happen, the problem is that when i run the command it doesn'tdisplay any error just in the table i cannot see it.Any other suggestions please?
  7. Hello everyone,I have created a database and i want to add a foreign key to one of my tables.I am using the following command but doesn't work Alter TABLE SC_Orders ADD FOREIGN KEY (StocklistID) REFERENCES SC_stocklist(StocklistID); Does anyone know what might be the error and suggest anything?Thank you in advance,Xenia
  8. Actually i manage to solve part of the problem.I manage to let users to login to the website by changing the following part of the code "check_login" and instead of "require" i put "include" //How it was beforeheader("Location: http://www.domain.com/Staff/check_login.php"); //How i change itinclude("check_login.php"); Now i am trying to put this code to all the pages in order to include the appropriate menu.I manage to do it for only two pages the rest doesn't let me change it. if($_SESSION['username']){ echo "Welcome ".$_SESSION['username']."!". "Logon time is: ".Date("m/d/Y"); include($_SESSION['isAdmin']?'logoffheaderAdmin.php':'logoffheader.php'); More specific I will display an example of the code that i want the menu to appear: <?include "../dbconnect.php";//This is the new code i add to check if the user is admin or notsession_start();if($_SESSION['username']){echo "Welcome ".$_SESSION['username']."!". "Logon time is: ".Date("m/d/Y"); include($_SESSION['isAdmin']?'logoffheaderAdmin.php':'logoffheader.php');?><form action="search1.php" method="get" name="Searchform"><table width="100%" height="100%" border="0" bordercolor="#DCCA23" bgcolor="#DCCA23"><tr bordercolor="#DCCA23" bgcolor="#DCCA23"><td height="10%" colspan="2"><font size="4" face="Perpetua"><h3><strong>Search Form </strong></h3></td></tr><tr bordercolor="#DCCA23" bgcolor="#DCCA23"><td height="10%" colspan="2"> <size="2" face="Perpetua"><h4>Search:<input name="searchval" type="text" id="searchval" size="40"><input type="submit" name="Search" value="Search"></h4></td></tr><tr><td><a href="advancesearch.php">Advanced Search</a></td></tr></table></form><?}else{header("Location:http://www.domain.com/Staff"); die();};?> Does anyone knows what migh be the problem?I can't find any problem.I would really appriciate your help.Thank you in advance,Xenia Kalogeropoulou
  9. Hi everyone,I have a problem with the login of the users.The first page of my website have a form where the user has to write his/her username and password(loginform.php). When the user clicks the submit button the user is being redirected to the page where the user being authenticated(password_input.php). The user might be either administrator or regular user.If the administrator logins the pages will include a specific navigation menu(logoffheaderAdmin.php).if a regular user logins then another navigation menu appears(logoffheader.php). In order the system to know which menu to display will check with the page check_login.php. The problem now is that the user cannot login.When the user enters the correct details it just appears a blank page.if the user enters wrong details it just display that "Your password is not correct. Please log on again!".I think that the problem might be in the "password_input.php" page and specially with the "header()" function. The strange thing is that if i put the correct details and click submit the blank page will appear but if i add in the url the address "http://www.domain.com/Staff/check_login.php" and manually redirect, it displays the correct menu. I will display the code that i have written and i would realy appreciate any help and suggestions.This is the code from the page "loginform.php" <? session_start(); if($_SESSION['username']){ echo $username.". You have logged on!"; require($_SESSION['isAdmin']?'logoffheaderAdmin.php':'logoffheader.php'); }else{ ?><form action="password_input.php" method="POST" name = "login"><table align="center" bgcolor="#FFCC66"> <tr> <td align="center" colspan="2">Log On</td> </tr> <tr> <td>Username:</td> <td><input type="text" name="uname"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="passwd"></td> </tr> <tr> <td></td> <td><input type="submit" value="Log in" name="submit"><input type="reset" value="Reset" name="reset"></td> </tr></table></form><? }?> This is the code for the page "password_input" <? session_start(); include "dbconnect.php"; if(empty($_POST['uname'])||empty($_POST['passwd'])){ include("loginform.php"); exit; } $uname= $_POST['uname']; $query = "SELECT * FROM Webusers WHERE username='$uname'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $encrypted_password = md5($_POST['passwd']); if($encrypted_password!=$row['password']){ echo "<h3>Your password is not correct. Please log on again!</h3>"; include("loginform.php"); }else{ $_SESSION['username']=$uname; $_SESSION['isAdmin']=$row['admin']=='yes'; header("Location:http://www.domain.com/Staff/check_login.php"); }//var_dump($_SESSION);?> This is the code for page "check_login.php" <? session_start(); if (isset($_SESSION['username'])==FALSE) { header("Location:http://www.domain.com/Staff/loginform.php"); exit; } echo "Welcome ".$_SESSION['username']."!". "Logon time is: ".Date("m/d/Y"); require($_SESSION['isAdmin']?'logoffheaderAdmin.php':'logoffheader.php'); ?> Could please anyone suggest something?Thank you in advance,Xenia
  10. This is the form site.php<html><?$mgr=$_POST['sitemgr'];$const=$_POST['construction'];$location=$_POST['location'];$info=$_POST['info'];?><body><br><table width="100%" border="1"><tr><td><form action="check.php" method="POST" name="csite" > <table width="100%" border="0" align="center" > <tr> <td>Site mgr</td> <td> <input type="text" name="sitemgr"></td> </tr> <tr> <td>Construction Co</td> <td><input type="text" name="construction"></td> </tr> <tr> <td>Location</td> <td><input type="text" name="location"></td> </tr> <tr> <td>Other information</td> <td><input type="text" name="info"></td> </tr> <tr> <table align="center"> <tr> <td><input type="submit" value="Submit" name="submit"></td> <td><input type="reset" value="Clear"></td> </tr> </tr> </form> </table></td></tr></table></body></html>This form by clicking the submit redirect to the following form check.php<?$mgr=$_POST['sitemgr'];$const=$_POST['construction'];$location=$_POST['location'];$info=$_POST['info'];?><html><body><br><table width="100%" border="1" > <tr> <td> <form name="changeCSite" method="POST" action="CSite.php" > <table width="100%" border="1" aligh="center"> <tr> <td>Site mgr</td> <td><? echo $_REQUEST['sitemgr'];?> </td> </tr> <tr> <td>Construction Co</td> <td><? echo $_REQUEST ['construction'];?></td> </tr> <td>Location</td> <td><? echo $_REQUEST['location'];?></td> </tr> <tr> <td>Other information</td> <td><? echo $_REQUEST['info'];?></td> </tr> <tr> <td></td> <td><input type="submit" value="Change" name="change"</form> </table> </form> </td> </tr></table></body></html>This is the code for the two forms,i hope this can help and suggest a solution.Thanks
  11. Do you think that if i was displayed the code this would help,as i have seen many users are visiting my question but no one reply.Thanks,Xenia
  12. Hi,I have created a form where the user has to fill in 4 field(site.php). When the user clicks on the submit button,he/she redirected in another form(check.php) which displays the data that the user has put in the previous form.The current form has two buttons,the submit(insert the data into the database)and the change. The change returns back to the previous form(site.php) in order the user to change what he/she has put.I want the form(site.php) to keep the data when the user click the change button.Please can anyone help me, any suggestion because it is important?Thank you in advance,Xenia
  13. Hi,I have created a form where the user has to fill in 4 field(site.php). When the user clicks on the submit button,he/she redirected in another form(check.php) which displays the data that the user has put in the previous form.The current form has two buttons,the submit(insert the data into the database)and the change. The change returns back to the previous form(site.php) in order the user to change what he/she has put.I want the form(site.php) to keep the data when the user click the change button.Please can anyone help me, any suggestion because it is important?Thank you in advance,Xenia
×
×
  • Create New...