Jump to content

mikebyrne

Members
  • Posts

    780
  • Joined

  • Last visited

Everything posted by mikebyrne

  1. LOL sorry. Doing two things at once here I want everything underneath each other at the moment the two drop down list are on the left hand side Username Age Location Position applying for (listbox) Why Do you work for a chatsite (listbox) if so, who? At present the listboxs are in the top left (I know its nothing to do with php!! lol)
  2. Sorry its messy its just something I banged together quickly for testing Any idea how I can allign the dropdown menus in the right place??
  3. Hi guys, Im doing a page for a friend but there is dropdown menus so im not sure how to set them as varibles. Here my work so far: <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <td><form name="form1" method="post" action="signupsnake.php"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Name:</td> <td><input type="text" name="name" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Age:</td> <td><input type="number" name="Age" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Location:</td> <td><input type="text" name="Location" value="" size="32"></td> </tr> <select name="mydropdown1" size="1"> <option value="Option">Please Select Option</option> <option value="Help Operator">Help Operator</option> <option value="Moderator">Moderator</option> <option value="Senior Moderator">Senior Moderator</option> <option value="IRCop">IRCop</option> <option value="Administrator">Administrator</option> </select> /tr> <tr valign="baseline"> <td nowrap align="right">Reason for Application:</td> <td><input type="text" name="Reason" value="" size="32"></td> </tr> <select name="mydropdown2" size="1"> <option value="Option">Do you work for any chatsite?</option> <option value="YES">YES</option> <option value="NO">NO</option> <tr valign="baseline"> <td nowrap align="right">If so, Which one?:</td> <td><input type="text" name="which" value="" size="32"></td> </tr> <td><input type="submit" value="Apply"></td> </tr> </table> </form> <p> </p> </body> </html> If you can tell me how to put the listbox in line that would be great!!! <?php include('config1.php'); // table name $tbl_name=applications; // values sent from form $name=$_POST['Username']; $Age=$_POST['Age']; $Location=$_POST['Location']; $mydropdown1=$_POST['Position']; $Reason=$_POST['Reason']; $mydropdown2=$_POST['Workonsite']; $which=$_POST['Whatsite']; // Insert data into database $sql="INSERT INTO $tbl_name(Username,Age,Location,Position,Reason,Workonsite,Whatsite)VALUES('$Username', '$Age', '$Location', '$Position', '$Reason','$Workonsite', '$Whatsite')"; $result=mysql_query($sql)or die(mysql_error()); ?> Plus the SQL of database CREATE TABLE `applications` ( `Userid` int(11) NOT NULL auto_increment, `Username` int(11) default NULL, `Age` int(11) default NULL, `Location` int(11) default NULL, `Position` int(11) default NULL, `Reason` int(11) default NULL, `Workonsite` int(11) default NULL, `Whatsite` int(11) default NULL, PRIMARY KEY (`Userid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
  4. Thats great. I'll put together some dummt order etc to test it out. No doubt I'll be back soon looking for help! THANKS
  5. Thanks that makes sense!! Would I manually have to insert Check boxes or can you inset them using PHP?
  6. Its really the display part I have the problem with: How can I get my dispaly to look like this table http://www.btrax.com/includes/sample_admin/eng/order/new.php
  7. I've just started my Admin page and have seen an example I like http://www.btrax.com/includes/sample_admin/eng/order/new.php Now, i've done my template but was wondering how would I produce a table in the middle of my page like the example?? Here's my template <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- TemplateBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- TemplateEndEditable --> <style type="text/css"> <!-- #Layer1 { position:absolute; width:1105px; height:817px; z-index:1; left: 5px; top: -158px; } #Layer2 { position:absolute; width:916px; height:534px; z-index:1; top: 260px; left: 177px; background-color: #CCCCCC; } #Layer3 { position:absolute; width:895px; height:511px; z-index:2; left: 185px; top: 275px; background-color: #FFFFFF; } #Layer4 { position:absolute; width:942px; height:128px; z-index:2; left: 182px; top: 105px; } --> </style> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body bgcolor="#FFFFFF"> <div id="Layer1"> <div id="Layer2"></div> <img src="/grey.jpg" width="130" height="805" /> <div id="Layer4"> <p> </p> <p> </p> <p>------Oders-------Sales-------Items-------Shipping-------</p> <p> </p> </div> <hr /> <div id="Layer3"> <label></label> </div> </div> </body> </html>
  8. I thought I'd need php code to run SQL queries and palce the results in tables. Just not sure how to code this and display the output in a table located in the middle of my page like the link I posted
  9. I've just started my Admin page and have seen an example I like http://www.btrax.com/includes/sample_admin/eng/order/new.php Now, i've done my template but was wondering how would I produce a table in the middle of my page like the example?? Here's my template <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- TemplateBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- TemplateEndEditable --> <style type="text/css"> <!-- #Layer1 { position:absolute; width:1105px; height:817px; z-index:1; left: 5px; top: -158px; } #Layer2 { position:absolute; width:916px; height:534px; z-index:1; top: 260px; left: 177px; background-color: #CCCCCC; } #Layer3 { position:absolute; width:895px; height:511px; z-index:2; left: 185px; top: 275px; background-color: #FFFFFF; } #Layer4 { position:absolute; width:942px; height:128px; z-index:2; left: 182px; top: 105px; } --> </style> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> </head> <body bgcolor="#FFFFFF"> <div id="Layer1"> <div id="Layer2"></div> <img src="/grey.jpg" width="130" height="805" /> <div id="Layer4"> <p> </p> <p> </p> <p>------Oders-------Sales-------Items-------Shipping-------</p> <p> </p> </div> <hr /> <div id="Layer3"> <label></label> </div> </div> </body> </html>
  10. Aaaaahhhh OK. So what does the $_SESSION['type'] do?
  11. I'm about to start an admin frontend so any info would be great!!
  12. I've fixed it but could you explain what the following line does? $_SESSION['type'] = ($row['User']==1)?"Cust":"Emp";
  13. I've just tried that and still getting the same results
  14. the sql for the table is: CREATE TABLE `users` ( `id` int(4) NOT NULL auto_increment, `name` varchar(65) NOT NULL default '', `address` varchar(65) NOT NULL default '', `address1` varchar(65) NOT NULL default '', `address2` varchar(65) NOT NULL default '', `address3` varchar(65) NOT NULL default '', `address4` varchar(65) NOT NULL default '', `county` varchar(25) NOT NULL default '', `zip` varchar(65) NOT NULL default '', `telephone` varchar(25) NOT NULL default '', `email` varchar(25) NOT NULL default '', `username` varchar(65) NOT NULL default '', `password` varchar(15) NOT NULL default '', `User` int(1) default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=36 DEFAULT CHARSET=latin1; The users field will always be 0 and any additional entry from the confirmation email wiil have a 1 in the users column So 1= Users 0=Admin Therefor when a user logs in they will have 1 in the user column and when an admin logs in they will have a 0 in the users column
  15. The filed im comparing is the users field in the Users table. Each person who registers get a 1 in the users column. I put in the admin will have a 0 in the users column
  16. No it wasn't $_SESSION['type'] = ($row['user']==1)?"Emp":"Cust"; But when I swapped them the opposite is happening ie Imjust getting the empindex.php page for both users
  17. The output on the Cutomer page is now Customer PageCust
  18. I've change customerindex.php to this: <?php echo "Customer Page"; Echo $_SESSION['type'] ; Echo $row['user'] ; ?> But the only output is Customer PAge
  19. Whatever way I log in I still get the customer page?? I checked that the user filed is either 1 or 0 for each log
  20. I want it to be if its a 1 its a customer and a 0 is an employee
  21. Could you emplain the line: $_SESSION['type'] = ($row['user']==1)?"Emp":"Cust"; not sure why the "Emp":"Cust" is there
  22. Jesus, It the first bit of code I got right all day!! LOL Just not sure where to place it
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.