Lee-Bartlett
Members-
Posts
225 -
Joined
-
Last visited
Never
Everything posted by Lee-Bartlett
-
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
its working, dont worry im an idiot. missed somthing i shouldnt. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
Yer but i tried before the dot, after the dot, in middle and at the end all give. unexpected } on line number -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
<?php require_once "includes/db_connection.php"; $sql = "SELECT email FROM email"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo "<form action='' method='post'>\n"; echo "<input type='text' name='id' value='" . $row['email'] . "'>\n"; echo " <input type='submit' value='update' name='updatebutton'>\n"; echo "</form>\n"; } else { echo "No email found"; } } else { echo mysql_error() . "<br />$sql"; I know it means somthing aint closed, but i cant se where, i tried closing the else at the end and didnt work. Parse error: syntax error, unexpected $end in /home/nexodom/public_html/website/admin/email.php on line 21 -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
u know u get the dollar end, i assumed it was the } cause u never closed the else. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
cant figure out where to end it, $end, but i put the } in like all places. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
im using the code u gave me. error is Notice: Undefined variable: row in /home/nexodom/public_html/website/admin/email.php on line 12 <?php error_reporting(E_ALL) ; ini_set('display_errors','1'); ?> <?php require_once "includes/db_connection.php"; $sql = "SELECT email FROM email"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { echo "<form action='' method='post'>\n"; echo "<input type='text' name='id' value='" . $row['email'] . "'>\n"; echo " <input type='submit' value='update' name='updatebutton'>\n"; echo "</form>\n"; } else { echo "No email found"; } } else { echo mysql_error() . "<br />$sql"; } ?> -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
In phpmyadmin, it has, table name email, 2 feilds email and id, in them 2, there is 1 for id and my email adress. and it is connecting to my db. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
<form action='' method='post'> <input type='text' name='id' value=''> <input type='submit' value='update' name='updatebutton'> </form> -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
I posted it all. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
that is it all. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
all it shows is the form, all the rest is in php and cant be seen. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
What page source when you right click the page or the whole code. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
nope, all i am getting back is a blank echo. and the feild isnt being echoed. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
strange still not seeing an email. -
[SOLVED] Basic...where am i going wrong.
Lee-Bartlett replied to Lee-Bartlett's topic in PHP Coding Help
Took out that and it still wont echo the email adress i put in there -
Im trying to duplicate somthing i done but on a smaller size, but thats proving to be alot harder for some reason. I have a db table called email, in that table there are 2 feilds, email and id. there will only ever be 1 entry to this table but i cant seem to pull that entry into my text boxx, or even get it to echo. heres my code. <?php require_once("includes/db_connection.php"); ?> <?php $email = $_GET['email']; $sql = "SELECT * FROM email WHERE id='1'"; $res = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($res)); { echo $email; $email = $row['email']; echo "<form action='' method='post'> <input type='text' name='id' value='" . $row['email'] . "'><input type='submit' value='update' name='updatebutton' ></form>"; } ?>
-
i was thinking about using a database table and just storing it in there reckon that will work?
-
that only works if its in the same file right? if so i cant use that. My situation i need it in an admin folder page and the email bit is in the users section.
-
At the moment there is a varible called $to with an email in, i need a text box, which will change that data in that varible to what ever i put in the text box, if you know what i mean. Say this is the varible $to = bob ......... puts jim in text box then submits it ........... new varible ............ $to = jim anyone got a tut on how to do that?
-
Is there anything connected to this file, for that to work for me, my form names/id's etc are set to them.
-
Ye ill look at the settings etc... ty anyway, ill tick as solved so more look
-
This is on my own domain, got from The Planet Internet Services, Inc and my OS is mac, if thats what you mean.
-
This is the code i use, it might help it might not. <?php $sql="INSERT INTO tblbasicform (name, email, buissnes_name, location, ct, website, telephone, longitude, latitude, type, approve) VALUES ('$_POST[name]','$_POST[email]','$_POST[buissnes_name]','$_POST[location]','$_POST[ct]','$_POST[website]','$_POST[telephone]','$_POST[longitude]', '$_POST[latitude]','$_POST[type]','$_POST[approve]')"; if (!mysql_query($sql,$connect)) { die('Error: ' . mysql_error()); } ?>
-
Ok, im not sure how to do this, imagine i have just a form button and when that is clicked i need it to send an email to my email adress, i used the basic code, seen below. But that dont work, how do i acheive this ? <?php $to = "leebartlett18@googlemail.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?>
-
This is the whole code, first im putting stuff into my db, then i want a mail to go me, telling me somthing new has been entered. this is all my code. Im new to mailing so got no clue how <?php session_start(); ?> <?php require_once('db_connection.php'); ?> <?php include_once ("securimage/securimage.php"); $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { // the code was incorrect // handle the error accordingly with your other error checking // or you can do something really basic like this ?> <a href="http://www.nexodom.com/website/userform.php">The code you entered was incorrect. Go back and try again.</a> <?php die(''); } $sql="INSERT INTO tblbasicform (name, email, buissnes_name, location, ct, website, telephone, longitude, latitude, type, approve) VALUES ('$_POST[name]','$_POST[email]','$_POST[buissnes_name]','$_POST[location]','$_POST[ct]','$_POST[website]','$_POST[telephone]','$_POST[longitude]', '$_POST[latitude]','$_POST[type]','$_POST[approve]')"; if (!mysql_query($sql,$connect)) { die('Error: ' . mysql_error()); } ?> <?php $to = "leebartlett18@googlemail.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> <html> <head> <meta http-equiv="refresh" content="2;url=http://nexodom.com/website/index.php"> <title></title>