-
Posts
780 -
Joined
-
Last visited
Posts posted by mikebyrne
-
-
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??
-
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>
-
Aaaaahhhh OK. So what does the $_SESSION['type'] do?
-
I'm about to start an admin frontend so any info would be great!!
-
I've fixed it but could you explain what the following line does?
$_SESSION['type'] = ($row['User']==1)?"Cust":"Emp";
-
Is there another way round this??
-
I've just tried that and still getting the same results
-
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
-
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
-
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
-
The output is the same if I log in as Admin
-
The output on the Cutomer page is now
Customer PageCust
-
I've change customerindex.php to this:
<?php echo "Customer Page"; Echo $_SESSION['type'] ; Echo $row['user'] ; ?>
But the only output is Customer PAge
-
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
-
-
I want it to be if its a 1 its a customer and a 0 is an employee
-
Could you emplain the line:
$_SESSION['type'] = ($row['user']==1)?"Emp":"Cust";
not sure why the "Emp":"Cust" is there
-
Jesus, It the first bit of code I got right all day!! LOL
Just not sure where to place it
[SOLVED] Signup with dropdown options
in PHP Coding Help
Posted
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)