View Single Post
  #1 (permalink)  
Old 08-06-2007, 10:18 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,118
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Icon13 How to combine Query and Variable in PHP?

Here's my current code, I want to send query to MySQL to add the username and password that's just created:

PHP Code:
<!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=utf-8" />
<title>MyCMS Installer</title>
</head>

<body>
<?php
include 'config.php';
print 
'Table has been created.'.'<br/>';
print 
'Installation succeeded.';
?>
<form action="<?php echo ($_SERVER['PHP_SELF']); ?>?p=submitted" method="POST">
Admin Username: <input type="text" name="adminuser" accesskey="u" /><br />
Admin Password: <input type="text" name="adminpass" accesskey="p" />
</form>

<?php
if (isset($_GET['p']) && $_GET['p'] == 'submitted') {
    
$adminUserName $_POST['adminuser'];
    
$adminPassword $_POST['adminpass'];
}
$query 'INSERT INTO `mycms` VALUES('// please help here
?>
</body>
</html>
Any comments on my implementations are welcomed...

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote