[UPHPU] XHTML & PHP

Jennifer Charrey jcharrey at xmtp.net
Tue Jun 12 14:41:49 MDT 2007


This code seems to work. However, have you checked to make sure you  
have PHP set up in your server software? Try making a page containing  
just:

<?php phpinfo(); ?>

And see if it works. If not, your server isn't set up to process PHP  
yet. You'll have to modify some settings. If you need help with that  
let us know what server software and PHP version you're using.

..........................
Jennifer Charrey
jcharrey at xmtp.net


On Jun 12, 2007, at 12:41 PM, Webot Graphics wrote:

> Does xhtml recognize php? Is xhtml the best to use currently?
>
> this code prints everything after my greater than sign.
>
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html>
> <head>
> 	<title>Western Botanicals - Add Product Type</title>
> </head>
> <body>
> 	<h1>Add Product Type</h1>
> 	<?php
> 		// include the database connections
> 		include("/includes/dbconnect.php");
> 		// add product type if not found
> 		if (isset($_GET['producttypename'])) {
> 			$producttypename = ($_GET['producttypename']);
> 			$sql = "SELECT * FROM Product_Types WHERE Product_Type_Name =  
> ('$producttypename')";
> 			$result = @mysql_query($sql);
> 			while ($row = mysql_fetch_array($result)) {
> 				$producttypenamefound = $row['Product_Type_ID'];
> 			}
> 			if ($producttypenamefound > 0) {
> 				echo ('Product Type not entered. Already found.');
> 			} else {
> 				$sql = "INSERT INTO Product_Types VALUES  
> ('i','$producttypename')";
> 				$result = @mysql_query($sql);
> 				echo ('Product Type ' . $producttypename . ' added');
> 			}
> 		}
> 		
> 		echo ('<form method="get" action="'.$_SERVER['PHP_SELF'].'">');
> 		echo ('Product Type Name: <input type="text"  
> name="producttypename" value="" /><br />');
> 		echo ('<br /><input type="submit" value="Add" />');
> 		echo ('</form>');
> 		$sql = "SELECT * FROM Product_Types";
> 		$result = @mysql_query($sql);
> 		while ($row = mysql_fetch_array($result)) {
> 			echo($row['Product_Type_Name'] . '<br />')
> 		}
> 	?>
> </body>
> </html>
>
>
> Justin Giboney
> Graphic Design
> Western Botanicals
> Ph:800.651.4372, Fax:866.366.4372
>
>
>
> _______________________________________________
>
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net



More information about the UPHPU mailing list