Lee-Bartlett
-
Posts
225 -
Joined
-
Last visited
Never
Posts posted by Lee-Bartlett
-
-
nvm sorted. ty
-
I just tryied that, but i changed the no in the [] to approve, thats the collum name in the database, have i done it wrong somthing so simple im finding hard.
-
On my site the user fills out a form, when that form is filled out it submits to my database, i need, when that form is submited, a secret answer of no with it. this is then used for admin reasons. I tried this but it sadly didnt work
<td><input type="hidden" name="no" id="no" value="<? $_POST["approve"] == "no"; ?>"></td>
-
Never knew it was so hard to get a submit button to put a yes into a collum, here it my most recent attempt but it just renamed the button and not put yet into the database.
echo "<td><form action='' method='post'> <input type='hidden' name='approve' value='" . $row['approve'] . "'><input type='submit' value='yes' name='app' ></form></td>";
-
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/nexodom/public_html/website/admin/index.php on line 74
is what im getting, how about using a radio button to put in a yes?
-
-
Hehe was gonna say array i am new to this so only no limited ammounts
-
Change file name to php? i am new so might be wrong.
-
so im assuming you have a word list file?
-
$wordlist = "crap|dang|shoot"; $comment = preg_replace("/\b($wordlist)\b/ie", 'preg_replace("/./","*","\\1")', $comment);
This seems to work really good, because it catches words by themselves, not if they are part of another word like class
ex) it changes crap into ****.
Does anyone know how to modify it so it will instead change it to cr*p.
In other words modify it so I can add a new list of replacement words?
Thanks
not to sound a bit baffled by this, isnt it better to have it all * out, to complety get rid of the word
-
Yes for some reason some of my old code isnt working, i just need it, when this button is pressed it makes the row and the cell in the db say yes. I can do it with text boxxes but not buttons.
-
Maybe im wording it wrong, maybe value isnt right word. All i need is a button to put the word yes into a db row, becuase the user side depends on that, i got select where approve=yes on my user side.
-
Anyone, i tried this
echo "<td><form action='' method='post'> <input type='hidden' name='id' value='" . $row['approve'] . "'><input type='submit' value='yes' name='approvebutton' ></form></td>";
no luck
-
is it cause you repeated the if con, die, say could not connect. basically twice?
-
Im not sure why it wont connect, i am new, but why do you leave the if con, die bit out of your include file?
-
when a user fills in my form, i want it to be seen by the admins but not by the public so i can check it over and give it the ok, stops people putting random rubbish in to clogg space up.
-
Here is my page, i would like my bottom button, the approve button to pass a value of yes to my db, but im not quite sure how to do this. the code for this is...
<?php echo "<td><form action='' method='post'> <input type='hidden' name='id' value='yes'><input type='submit' value='approve' name='approvebutton' ></form></td>"; ?>
i was thinking of doing somthing like this tho...
<?php echo "<td><form action='' method='post'> <input type='hidden' name='id' value='" . $row['id'] . "'><input type='submit' value='update' name='updatebutton' ></form></td>"; ?>
-
I think i know how i will do this, still new to php, bit im little confused on is how to work it in with the delete statement, do i just start another one with the approve db entry.
Also on the public page would i call it like this, if db entry = yes echo else do nothing
-
Nah, its just a mess arround site to practice on, my uncle is giving me little tasks to get used to this sort of stuff, atm i have used php my admin for password the admin, an i thought it would be a if yes else no, have you got any links to a tut or somthing like that, here are all my pages of code which it will be linked to.
the admin page, havn't put the check box in, wasnt sure if it was best to use, or maybe a button which said allow, then it will be displayed on the code below this code.
--Admin page--
<?php require_once("includes/db_connection.php"); ?> <html> <title></title> <style type="text/css"> <!-- .style1 { font-size: 36px; color: #FFFFFF; } --> </style> </head> <body> <table width="617" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td colspan="2" bgcolor="#0099FF"><p> </p> <p align="center" class="style1"><?php $header = implode("", file("header.htt")); echo $header ?></p> <p> </p></td> </tr> <tr> <td width="129" height="318" align="left" valign="top"><p><br> <a href="index.php">Delete/Update</a></p> <a href="http://www.nexodom.com/website/admin/index.php">Take me back to my database</a></p> <a href="adminuserform.php">Add a new user.</a></p> <td width="482" align="left" valign="top"><p align="center"> </p> <?php if(isset($_POST['id'])) { $id = $_POST['id']; $delete = mysql_query("DELETE FROM tblbasicform WHERE id='$id'"); } $sql = "SELECT * from tblbasicform"; $res = mysql_query($sql) or die(mysql_error()); ?> <? // Table where the db feilds sit echo "<table border=1 align=centre font size=\"5\" face=\"verdana\">"; echo "<tr><td>id</td> <td>Name</td><td>Email</td><td>Buissnes Name</td><td>Street Name</td><td>Website</td><td>Telephone</td><td>Free or Paid</td><td>Longitude</td><td>Latitude</td><td>Delete</td><td>Update</td></tr>"; while($row = MYSQL_FETCH_ARRAY($res)) { //Database is echoed for user to see all entries echo "<tr><td>".$row['id']."</td>"; echo "<td>".$row['name']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['ct']."</td>"; echo "<td>".$row['website']."</td>"; echo "<td>".$row['telephone']."</td>"; echo "<td>".$row['type']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['latitude']."</td>"; // Begining of the form buttons. echo "<td><form action='".$_SERVER['PHP_SELF']."' method='post'> <input type='hidden' name='id' value='" . $row['id'] . "'><input type='submit' value='delete' name='deletebutton'></form></td>"; echo "<td><form action='form2.php' method='post'> <input type='hidden' name='id' value='" . $row['id'] . "'><input type='submit' value='update' name='updatebutton' ></form></td>"; } echo "</tr>"; ?> <?php $footer = implode("", file("footer.htt")) ?> </table><br> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p></td> </tr> <tr> <td height="20" colspan="2" bgcolor="#0099FF"> <?php echo $footer ?> </td> </tr> </table> </body> </html>
-- Public Side--
<?php require_once("includes/db_connection.php"); ?> <html> <head> <style type="text/css"> <!-- .style1 { font-size: 36px; color: #FFFFFF; } --> </style> </head> <body onLoad="load()" onUnload="GUnload()" > <table width="1128" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td colspan="2" bgcolor="#0099FF"><p> </p> <p align="center" class="style1"><?php $header = implode("", file("header.htt")); echo $header ?> </p> <p> </p></td> </tr> <tr> <td width="198" height="318" align="left" valign="top"><p><a href="index.wifi"></a><br> <a href="index.php">Home</a></p> </td> <td width="904" align="left" valign="top"><p align="center">WIFI Hot Spot List<br> <?php $sql = "SELECT * from tblbasicform"; $res = mysql_query($sql) or die(mysql_error()); echo "<table border=2>"; echo "<tr> <td>Buissnes Name</td><td>Location</td><td>City/Town</td><td>Website</td><td>Telephone</td><td>Latitude</td><td>Longitude</td> <td>Free or Paid</td><td>Veiw on a map</td></tr>"; while($row = MYSQL_FETCH_ARRAY($res)) { $id = $row['id']; ?> <script language='javascript' type='text/javascript'> <!-- function openWindow<?=$id?>() { popupWin = window.open('popup.php?id=<?=$id?>', 'popup','width=550,height=400,resizable=no,scrollbars=yes,toolbar=no,screenX=0,screenY=0,Top=0,Left=0') } // --> </script> <?php echo "<form method=\"post\" name=\"pop$id\">"; echo "<tr><td>".$row['buissnes_name']."</td>"; echo "<td>".$row['location']."</td>"; echo "<td>".$row['ct']."</td>"; echo "<td>".$row['website']."</td>"; echo "<td>".$row['telephone']."</td>"; echo "<td>".$row['latitude']."</td>"; echo "<td>".$row['longitude']."</td>"; echo "<td>".$row['type']."</td>"; echo "<form>"; if ($row['latitude'] and $row['longitude']) { echo "<td><input type=\"button\" onClick=\"openWindow$id(); return false;\" value=\"Pop Up Map\">"; } else { echo "<td>No Lat or Long entered"; } } echo "</td>"; echo "</form>"; ?><?php $footer = implode("", file("footer.htt")) ?> </tr></table> <table> <tr><td> </td></tr> </table> <br> <a href="userform.php">Submit a WIFI hotspot</a> <br /> <br /> <?php echo $footer; ?> </body> </html>
-
Im not the best at explaining i do have captchas i would like a little system like this. The user fills in the form, it goes into the database and stays there. On an admin page i have a check box in a collum, if checked it moves to the public page, else it either remains hidden or gets automatically deleted. Somthing like, validation can only go so far, cause they can still enter aaabbb somthing like that.
-
Im not sure what the code would look like for this, at the moment my web page has a database echoed on a page. When the form is filled in, it automatically puts in a new entry, but i need an approval page to stop spam after spam of entries. So i have full controll of what goes on there. Atm all i have is my database echoed out on the pages, that code is bellow. How would i go about doing the rest of it, it would be good if it was check boxxed.
-
This might sound bit stupid, but is css3 out, if so is it a download or does it automatically kick in?
Also when i use a div, i use the ones out of dreamweaver atm, they change postion on each browser. Its very annoying
-
I tried somthing like this.
body
{
background-repeat: repeat-x;
background-image: url(navbarbg.png);
}
body
{
background-repeat: no-repeat;
background-image: url(sidebar.png);
}
and it takes out the top one, i tried to re name body and it didnt work, how do i put multiple backgrounds onto a page with out using tables, tables mess up for me in browsers when i use dw
-
Mail script.
in PHP Coding Help
Posted
Ok all im trying to do is a simple mail script but im not sure how completly, atm i have the code below, that is on a html page which re directs in about 3 seconds. where am i going wrong ?