Medyman
07-12-2007, 06:18 AM
Hi all...
I'm kind of in a bind. This is like PHP 101 but I can't seem to figure it out.
I have this existing page (with some php on it already)
<?
$fail = false;
if(isset($_GET[s]))
include("search.php");
else
include("recent.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="js/dropdown.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<link type="text/css" rel="stylesheet" href="css/Style.css" />
<link rel="shortcut icon" href="favicon.ico" />
<title>THEPAPERBAGWRITER // CHANGING THE WAY INFORMATION FLOWS</title>
</head>
<body bgcolor="#ffffff">
<div id="watermarklogo" style="position:absolute;height:30px;overflow:hidden;"></div>
<script src="js/logo.js"></script>
<div id="container">
<div id="mainframe" >
<form id="myform">
<input type="text" class="textinput" /> <input class="submit" type="image" src="images/form.png" />
</form>
<div id="musicholder">
<div id="flashmusic">To view the header, please upgrade your Flash plugin.</div>
<script type="text/javascript">
var so = new SWFObject("musicPlayer.swf", "music", "340", "20", "8", "#CCCCCC");
so.addParam("quality", "high");
so.addParam("wmode", "opaque");
so.addParam("salign", "t");
so.addParam("scale", "noscale");
so.write("flashmusic");
</script>
</div>
<div id="musiccredit" style='float:right;'><a href="http://www.caribou.fm/site/">MUSIC BY CARIBOU</a></div>
<div id="menuline"> </div>
<div id="flashcontent">To view the header, please upgrade your Flash plugin.</div>
<script type="text/javascript">
var so = new SWFObject("header.swf", "index", "700", "250", "8", "#ffffff");
so.addParam("quality", "high");
so.addParam("wmode", "opaque");
so.addParam("salign", "t");
so.addParam("scale", "noscale");
so.write("flashcontent");
</script>
<div id="leftframe">
<div id ="news">
<div id="framehead"><img src="images/news.jpg"></div>
<div id="newsart">
<span id="date">07.01.07</span>
<br />Submissions for Brown Paper 1 will be closing soon, so send us your contributions of poetry, prose, commentary and art before it's too late. Send all submissions to <a id="email" href="mailto:printsubmissions@thepaperbagwriter.org">printsubmissions@thepaperbagwriter.org</a>. For more information, see our submission page.
</br>
</br><br /><span id="date">06.30.07</span>
<br />It is with great sadness that we announce, Kim Maria or Revelation Studios has been diagnosed with Cancer. Kim's work has redefined the context of collage and greatly expanded the vernacular of assemblage art. Her innovations have been spectacular and her contributions even greater. Over the course of the last few months, the artistic community has stepped forward in a tremendous way to supplement Kim's extensive medical costs. Benefit auctions have taken place all throughout the country featuring a breadth of artistic talent from Mark Ryden, to Gary Baseman, to Mark Todd and Esther Pearl Watson. To do our share, we have decided to publish a retrospective of Kim and her husband Craig La Rotunda's work, in a folio book that will help to supplement her outstanding medical bills. We are working with Kim and Craig, as to the specifics but expect to hit the shelves soon. 100 % of the profits will go to Kim; the books will be available for pre-order soon. We'll keep you posted.
</br>
</br><br /><span id="date">06.27.07</span>
</br>New Site! Yay, it's been a few months but it's finally here. We know it's been a long construction, but we'd like to get back in the swing of things as quickly as possible so send your submissions or poetry, prose, comment and criticism to websubmissions @thepaperbagwriter.org , so we can get the new site in motion. We've also added a new block section, we're you can post story ideas or fragments. Let us know what you think of the new site, enjoy.
</div>
</div>
</br>
<div id="video">
<div id="framehead" style='background-image:URL("images/videos.jpg");'><a href="http://www.adbusters.org"><img src="images/kalle.gif" style='float:right;margin-top:2px;'></a></div>
<div id="youtube"><embed src="http://www.youtube.com/v/-GhXKILWcG8" type="application/x-shockwave-flash" width="100%" height="210"></embed></div>
</div>
</br>
<div id="personals">
<div id="framehead"><img src="images/personals.jpg"></div>
<span id="opening">LOOKING FOR A CARTOONIST</span>
<span id="desc">We're looking for a cartoonist, somewhere between 4'8 and 8'9, preferably male or female (although I don't discriminate) , must be an outgoing, fun-loving romantic who shares my adoration and enthusiasm for Fellini and Mozart and candlelit dinst have at least six fingers and some experience in the visual arts. </br></br>*If you meet at least 32% of these requirements and are interested in joining our team, drop us a line at 516.474.3947 or email us at team@thepaperbagwriter.org</span>
</div>
</div>
<div id="rightframe">
<div id ="about">
</div>
</div>
</div>
<div id="sideframe">
<a href="brownpaper.php"><img src="images/firstissue.jpg"></a>
<div id="framehead"><img src="images/bptitle.jpg"></div>
</br>
<a href="paperandplastic.php"><img src="images/pp.jpg"></a>
</br>
<a href="donations.php"><img src="images/donate2.jpg" ></a>
</br>
<a href="subscribe.php"><img src="images/subscribe2.jpg" ></a>
</br>
<a href="shop.php"><img src="images/shop2.jpg" ></a>
</br>
<a href="http://www.myspace.com/mybrownpaperbag"><img src="images/myspace2.jpg" ></a>
</div>
</div>
<div id="dropinboxv2cover">
<div id="dropinboxv2">
<div id="framehead" style='width:98%'><img src="images/mlist.jpg"></div>
<div id="bodycontent">
Join our mailing list for news updates, readings and exclusive invitations to PBW events, gatherings and exorcisms. Once you join there is no turning back! (only kidding there is an unsubscribe option – but that’s complicated and involves phone books and taxidermied animals and besides which you’ll never want to leave anyway).
</br>
<form id="submit">
<img src="images/name.jpg"><input style='position:relative;top:-4px;left:5px;' type="text" class="textinput" style='width:328px' name="name" id="name"/>
</br>
<img src="images/email.jpg"><input style='position:relative;top:-4px;left:5px;' type="text" class="textinput" style='width:328px' name="email" id="email"/>
<input class="submit" type="submit" value="submit" style='float:right;margin-right:18px;' id="add" />
</form>
</div>
</div>
</div>
<p align="right"><a href="#" onClick="dismissboxv2();return false"> </a></p>
</body>
</html>
I'm trying to add some php to post the values of the name & email to a mySQL db.
I did it in testing with this page:
<?php
if(isset($_POST['add']))
{
include 'config.php';
include 'opendb.php';
$name = $_POST['name'];
$email = $_POST['email'];
$query = "INSERT INTO mlist VALUES ('','${name}','${email}')";
mysql_query($query) or die('Error, insaert query failed');
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');
include 'closedb.php';
echo "New MySQL user added";
}
else
{
?>
<form method="post">
<table width="400" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="100">Name</td>
<td><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td width="100">Email</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td width="100"> </td>
<td> </td>
</tr>
<tr>
<td width="100"> </td>
<td><input name="add" type="submit" id="add" value="Add New User"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>
But when I try to incorporate it into the actual page, it doesn't work. The page just refershes and the values I entered in fields show up in the address bar (http://www.url.com/page.php?name=Name&email=Email)
I'm kind of in a bind. This is like PHP 101 but I can't seem to figure it out.
I have this existing page (with some php on it already)
<?
$fail = false;
if(isset($_GET[s]))
include("search.php");
else
include("recent.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="js/dropdown.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<link type="text/css" rel="stylesheet" href="css/Style.css" />
<link rel="shortcut icon" href="favicon.ico" />
<title>THEPAPERBAGWRITER // CHANGING THE WAY INFORMATION FLOWS</title>
</head>
<body bgcolor="#ffffff">
<div id="watermarklogo" style="position:absolute;height:30px;overflow:hidden;"></div>
<script src="js/logo.js"></script>
<div id="container">
<div id="mainframe" >
<form id="myform">
<input type="text" class="textinput" /> <input class="submit" type="image" src="images/form.png" />
</form>
<div id="musicholder">
<div id="flashmusic">To view the header, please upgrade your Flash plugin.</div>
<script type="text/javascript">
var so = new SWFObject("musicPlayer.swf", "music", "340", "20", "8", "#CCCCCC");
so.addParam("quality", "high");
so.addParam("wmode", "opaque");
so.addParam("salign", "t");
so.addParam("scale", "noscale");
so.write("flashmusic");
</script>
</div>
<div id="musiccredit" style='float:right;'><a href="http://www.caribou.fm/site/">MUSIC BY CARIBOU</a></div>
<div id="menuline"> </div>
<div id="flashcontent">To view the header, please upgrade your Flash plugin.</div>
<script type="text/javascript">
var so = new SWFObject("header.swf", "index", "700", "250", "8", "#ffffff");
so.addParam("quality", "high");
so.addParam("wmode", "opaque");
so.addParam("salign", "t");
so.addParam("scale", "noscale");
so.write("flashcontent");
</script>
<div id="leftframe">
<div id ="news">
<div id="framehead"><img src="images/news.jpg"></div>
<div id="newsart">
<span id="date">07.01.07</span>
<br />Submissions for Brown Paper 1 will be closing soon, so send us your contributions of poetry, prose, commentary and art before it's too late. Send all submissions to <a id="email" href="mailto:printsubmissions@thepaperbagwriter.org">printsubmissions@thepaperbagwriter.org</a>. For more information, see our submission page.
</br>
</br><br /><span id="date">06.30.07</span>
<br />It is with great sadness that we announce, Kim Maria or Revelation Studios has been diagnosed with Cancer. Kim's work has redefined the context of collage and greatly expanded the vernacular of assemblage art. Her innovations have been spectacular and her contributions even greater. Over the course of the last few months, the artistic community has stepped forward in a tremendous way to supplement Kim's extensive medical costs. Benefit auctions have taken place all throughout the country featuring a breadth of artistic talent from Mark Ryden, to Gary Baseman, to Mark Todd and Esther Pearl Watson. To do our share, we have decided to publish a retrospective of Kim and her husband Craig La Rotunda's work, in a folio book that will help to supplement her outstanding medical bills. We are working with Kim and Craig, as to the specifics but expect to hit the shelves soon. 100 % of the profits will go to Kim; the books will be available for pre-order soon. We'll keep you posted.
</br>
</br><br /><span id="date">06.27.07</span>
</br>New Site! Yay, it's been a few months but it's finally here. We know it's been a long construction, but we'd like to get back in the swing of things as quickly as possible so send your submissions or poetry, prose, comment and criticism to websubmissions @thepaperbagwriter.org , so we can get the new site in motion. We've also added a new block section, we're you can post story ideas or fragments. Let us know what you think of the new site, enjoy.
</div>
</div>
</br>
<div id="video">
<div id="framehead" style='background-image:URL("images/videos.jpg");'><a href="http://www.adbusters.org"><img src="images/kalle.gif" style='float:right;margin-top:2px;'></a></div>
<div id="youtube"><embed src="http://www.youtube.com/v/-GhXKILWcG8" type="application/x-shockwave-flash" width="100%" height="210"></embed></div>
</div>
</br>
<div id="personals">
<div id="framehead"><img src="images/personals.jpg"></div>
<span id="opening">LOOKING FOR A CARTOONIST</span>
<span id="desc">We're looking for a cartoonist, somewhere between 4'8 and 8'9, preferably male or female (although I don't discriminate) , must be an outgoing, fun-loving romantic who shares my adoration and enthusiasm for Fellini and Mozart and candlelit dinst have at least six fingers and some experience in the visual arts. </br></br>*If you meet at least 32% of these requirements and are interested in joining our team, drop us a line at 516.474.3947 or email us at team@thepaperbagwriter.org</span>
</div>
</div>
<div id="rightframe">
<div id ="about">
</div>
</div>
</div>
<div id="sideframe">
<a href="brownpaper.php"><img src="images/firstissue.jpg"></a>
<div id="framehead"><img src="images/bptitle.jpg"></div>
</br>
<a href="paperandplastic.php"><img src="images/pp.jpg"></a>
</br>
<a href="donations.php"><img src="images/donate2.jpg" ></a>
</br>
<a href="subscribe.php"><img src="images/subscribe2.jpg" ></a>
</br>
<a href="shop.php"><img src="images/shop2.jpg" ></a>
</br>
<a href="http://www.myspace.com/mybrownpaperbag"><img src="images/myspace2.jpg" ></a>
</div>
</div>
<div id="dropinboxv2cover">
<div id="dropinboxv2">
<div id="framehead" style='width:98%'><img src="images/mlist.jpg"></div>
<div id="bodycontent">
Join our mailing list for news updates, readings and exclusive invitations to PBW events, gatherings and exorcisms. Once you join there is no turning back! (only kidding there is an unsubscribe option – but that’s complicated and involves phone books and taxidermied animals and besides which you’ll never want to leave anyway).
</br>
<form id="submit">
<img src="images/name.jpg"><input style='position:relative;top:-4px;left:5px;' type="text" class="textinput" style='width:328px' name="name" id="name"/>
</br>
<img src="images/email.jpg"><input style='position:relative;top:-4px;left:5px;' type="text" class="textinput" style='width:328px' name="email" id="email"/>
<input class="submit" type="submit" value="submit" style='float:right;margin-right:18px;' id="add" />
</form>
</div>
</div>
</div>
<p align="right"><a href="#" onClick="dismissboxv2();return false"> </a></p>
</body>
</html>
I'm trying to add some php to post the values of the name & email to a mySQL db.
I did it in testing with this page:
<?php
if(isset($_POST['add']))
{
include 'config.php';
include 'opendb.php';
$name = $_POST['name'];
$email = $_POST['email'];
$query = "INSERT INTO mlist VALUES ('','${name}','${email}')";
mysql_query($query) or die('Error, insaert query failed');
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');
include 'closedb.php';
echo "New MySQL user added";
}
else
{
?>
<form method="post">
<table width="400" border="0" cellspacing="1" cellpadding="2">
<tr>
<td width="100">Name</td>
<td><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td width="100">Email</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td width="100"> </td>
<td> </td>
</tr>
<tr>
<td width="100"> </td>
<td><input name="add" type="submit" id="add" value="Add New User"></td>
</tr>
</table>
</form>
<?php
}
?>
</body>
</html>
But when I try to incorporate it into the actual page, it doesn't work. The page just refershes and the values I entered in fields show up in the address bar (http://www.url.com/page.php?name=Name&email=Email)