-
Posts
780 -
Joined
-
Last visited
Everything posted by mikebyrne
-
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
-
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
-
Thanks that makes sense!! Would I manually have to insert Check boxes or can you inset them using PHP?
-
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
-
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>
-
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
-
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>
-
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
Aaaaahhhh OK. So what does the $_SESSION['type'] do? -
I'm about to start an admin frontend so any info would be great!!
-
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
I've fixed it but could you explain what the following line does? $_SESSION['type'] = ($row['User']==1)?"Cust":"Emp"; -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
Is there another way round this?? -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
I've just tried that and still getting the same results -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
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 -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
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 -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
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 -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
The output is the same if I log in as Admin -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
The output on the Cutomer page is now Customer PageCust -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
I've change customerindex.php to this: <?php echo "Customer Page"; Echo $_SESSION['type'] ; Echo $row['user'] ; ?> But the only output is Customer PAge -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
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 -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
Thanks!! -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
I want it to be if its a 1 its a customer and a 0 is an employee -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
Could you emplain the line: $_SESSION['type'] = ($row['user']==1)?"Emp":"Cust"; not sure why the "Emp":"Cust" is there -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
Jesus, It the first bit of code I got right all day!! LOL Just not sure where to place it -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
Brilliant!! Now what i wanted to do was but a bit of rediredtion because I've 2 types of users the code for users = 1 admin =0 I wanted something like this but cant seem to get it to work! $defaultPage = "customer/index.php"; if($rows['user'] == "1") { $defaultPage = "emp/index.php"; } header("location:$defaultPage"); -
[SOLVED] Loging Problems!! (Cant set it up)
mikebyrne replied to mikebyrne's topic in PHP Coding Help
It seems to take in the code but just displays the login screen again