Jump to content

bslevin

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bslevin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK it is working now!! Thanks for all your help! After seeing that message i found out that the datbase had been deleted and reinstalled but the username had never been reattached to it. Thanks again!
  2. Ok i did that and here is what i got... Problem with the query: select * from mail where email='bill@celebrityhill.com' at line 61 No database selected
  3. I did that and i still get the same result.. it says "Select Fails"
  4. Hello, I know very little about PHP, i am a graphics and HTML guy , i had a simple mailing list script up on a clients page for a couple years, and now all of a sudden it has stopped working. When you enter your name, and email, you get "select fails" and it does not get added to the database. Here is the code, any help would be great, i am lost since nothign has changed, but it just stoppped working. from the config.php file function insert_mail() { $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $sql2="select * from mail where email='$email'"; $result2=mysql_query($sql2) or die("select fails"); $no=mysql_num_rows($result2); if ($no==0) { $sql = "insert into mail(id,fname,lname,email) values(NULL,'$fname','$lname','$email')"; $result = mysql_query($sql) or die("insert fails"); echo "Email added to list: " . LISTNAME; } else { echo "Email Address Already Exists in List: " . LISTNAME; } } function delete_mail() { $email = $_POST['email']; if ($email == "") { $email = $_GET['email']; } $sql2="select * from mail where email='$email'"; $result2=mysql_query($sql2) or die("select fails"); $no=mysql_num_rows($result2); if ($no==0) { echo "Your email was not found in the list: " . LISTNAME; } else { echo "Your email was unsubscribed from the list: " . LISTNAME; } $sql2="delete from mail where email='$email'"; $result2=mysql_query($sql2) or die("unsubscribe failed, please try again"); } ?> From the HTML <center> <form action='<? echo BASEHREF; ?>index.php' method=post> <TABLE BORDER=0 ALIGN=center> <TR> <TD><b>first name</b></TD> <TD><INPUT TYPE=text name=fname></TD> </TR> <TR> <TD><b>last name</b></TD> <TD><INPUT TYPE=text name=lname></TD> </TR> <TR> <TD><b>email</b></tD> <TD><INPUT TYPE=text name=email></td> </tR> <TR> <TD colspan=2 align=center><INPUT TYPE=submit value=join> <INPUT TYPE=reset value=reset><BR></TD> </tR> </TABLE> </FORM> </center> Let me know what else you may need....
  5. Just to explain further about what i was looking for.... there are tons of password protect scripts for members areas out there, some free some for a fee. The problem is most fo them are these full members protection scripts for paid members sections, i do not need all of that. I just need the abilty to have a person register, confirm with an email, then have access to the protected section. it is just to keep a section of a client's site private until they are registered.
  6. I was wondering does anyone know of a simple script to protest a "members section" of a web site? I do not need these fancy scripts with all the features, this is not a paid members section. I just need a very simple registration page with only a few options, amd a way to protect a directory with a username and password. that is about it. Any ideas would be greatly appreciated
  7. Thanks for your help... An animated gif would be too large for all the images plus i will be adding images all the time. http://www.dyn-web.com/code/rotate_images/ - i had already tried that but it is simply a rotaion after a page refresh, that was the problem i had with using google most of the links were all for refresh rotation and the ones that were not , were scripts to buy that had way too many things i did not need. This page had everything i was looking for except for the fact it rotated on page refresh. I was just wondering if there was a simple way to do this without buying some crazy script.
  8. Hello i have very little knowledge of php, but strong knowledge of HTML. I was searching all over the net trying to find a script to do the following and have had no luck at all, so i am hoping someone can help me. I have a web page, in the top left corner i have a section that i want to rotate an image in, i have about 30 images ina a directory and want them to simply randomly rotate every 5 sec or so. the problem is all i could find are scripts that rotate on page refresh. Any ideas? Thanks in advance
  9. [quote author=thorpe link=topic=102372.msg406202#msg406202 date=1154297412] Actualy... the error you post seems to be a Javascript one, nothing to do with php. Where have you defined the GoUrl() function? [/quote] Thank you, i did not notice that, i altered the layout of the script and somehow removed the script that defined the GoUrl() . thank you so much, this has been driving me crazy!!
  10. Ok here is line 77 - 96 $query2 = "SELECT month FROM $maintable GROUP BY month ORDER BY id"; $result2 = mysql_query($query2) or die("<strong class=black-large>Whoops! Something wrong happened to the my database! It would be nice if you emailed <a href=mailto:$webmaster>me</a> and told me!</strong>"); if ($result2) { echo "<form><table border=0 cellspacing=0 cellpadding=5 width=$width align=center> <td align=right colspan=2 valign=top> <select onchange=\"GoUrl(this)\"> <option> previous news entries for: <option> &nbsp;"; while ($r2 = mysql_fetch_array($result2)) { extract($r2); echo "<option value=news.php?month=$month><strong class=black-small> -&gt; &nbsp; $month </strong>"; } echo "</select> </td> </tr></table></form> "; mysql_free_result($result2); } mysql_close();
  11. Sorry about that here is the whole page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title></title> <link rel=stylesheet type=text/css href="styles.css"> <style type="text/css"> A:link { color:#ffffcc; } A:visited { color:#ffffcc; } A:hover { color:red; } BODY { FONT-SIZE: 12px; FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif; SCROLLBAR-BASE-COLOR: #492263; SCROLLBAR-ARROW-COLOR: #ffff66; /* SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-HIGHLIGHT-COLOR: #FF9999; SCROLLBAR-SHADOW-COLOR: #FF9999; SCROLLBAR-DARKSHADOW-COLOR: #660000; SCROLLBAR-FACE-COLOR: #ffff66; SCROLLBAR-TRACK-COLOR: #000000;*/ </style> </head> <body background="../images/stretch.jpg" bgcolor="Black" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 text="White" link="#ffffcc" vlink="#ffffcc" alink="#ffffcc"> <table width="760" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td><img src="../images/blank.jpg" width="760" height="16" alt="" border="0"></td> </tr> <tr> <td valign="top"> <table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#492263"> <tr bgcolor=492263><td align=center><br><strong class=black-large>News and Updates Page</strong><br><br></td></tr> <tr> <td><br> <? include ("common.php"); MYSQL_CONNECT($hostname,$username,$passwrd) OR DIE("Oh damn! Couldnt connect to the database, sorry mate!"); @mysql_select_db($dbName) or die("<strong class=black-large>Unable to select database</strong>"); if ($month) { $sortby = " WHERE $maintable.month='" . $month . "' " ; $limit = " ";} else {$sortby = " "; } $query = " SELECT $maintable.id, $maintable.thedate, $maintable.topic, $maintable.entry, count($commentstable.id) AS comments FROM $maintable LEFT OUTER JOIN $commentstable ON $maintable.id = $commentstable.id $sortby GROUP BY $maintable.id ORDER BY $maintable.id DESC $limit";   $result = mysql_query($query) or die("<strong class=black-large>Whoops! Something wrong happened to the my database! It would be nice if you emailed <a href=mailto:$webmaster>me</a> and told me!</strong>"); if ($result) { echo "<table border=0 cellspacing=0 cellpadding=5 width=$width align=center>"; while ($r = mysql_fetch_array($result)) { extract($r); $entry = nl2br($entry); echo "  <tr bgcolor=492263><td><strong class=black>$topic</strong></td><td align=right><strong class=black>$thedate</strong></td></tr> <tr bgcolor=492263><td colspan=2><small class=black-small>$entry</small><br></td></tr> <tr bgcolor=492263><td colspan=2><hr color=ffffff size=1 width=100%></td></tr> "; } echo "</table><br>"; mysql_free_result($result); } $query2 = "SELECT month FROM $maintable GROUP BY month ORDER BY id"; $result2 = mysql_query($query2) or die("<strong class=black-large>Whoops! Something wrong happened to the my database! It would be nice if you emailed <a href=mailto:$webmaster>me</a> and told me!</strong>"); if ($result2) { echo "<form><table border=0 cellspacing=0 cellpadding=5 width=$width align=center> <td align=right colspan=2 valign=top> <select onchange=\"GoUrl(this)\"> <option> previous news entries for: <option> &nbsp;"; while ($r2 = mysql_fetch_array($result2)) { extract($r2); echo "<option value=news.php?month=$month><strong class=black-small> -&gt; &nbsp; $month </strong>"; } echo "</select> </td> </tr></table></form> "; mysql_free_result($result2); } mysql_close(); ?> </td> </tr> </table> </td> </tr> <tr> <td><br></td> </tr> <tr> <td></td> </tr> </table> </body> </html>
  12. Hello, I am very new to PHP and i am having a problem with a script i have. It is a simple "diary / news" script which you enter a subject and body and it displays on the page. I have moved the script to a test directory becuse it is in a protected members area normally. the problem i am having is there is an entry posted every week (starting back from the begining of the year) to the present. At the bottom of the page there is a drop down to see past "archived" months. This does not work, if you select a month you get an error in IE - the error is below Line: 80 Char: 1 Error: Object expected Code: 0 URL: http://www.kingoftheheel.com/test/news.php the link is http://www.kingoftheheel.com/test/news.php If anyone has any idea, it would be greatly appreciated, the person who wrote the script cannot be found. Thanks in advance Bill
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.