-
Content Count
975 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mrdee
-
Hi,I was wondering if there is a possibility in the PHP Date function to let it display the date in other languages (probably not, but I thought I'd ask).I know that 'D' gives you 'Sun', 'Mon', etc. and 'l' gives you 'Sunday', 'Monday', etc.Is there any provision for letting it display something like eg. 'Zon', 'Maa', etc., or 'Zondag', 'Maandag' etc. ?It would be handy for people (like me) who have a multilingual web site.Thanks in advance.
-
Thanks,but I keep getting errors all over the place. Ultimately, the code for confirm.php changed to this: <HTML><HEAD> <TITLE>Vlaanderen-Flanders</TITLE></HEAD><BODY><?php$con = mysql_connect("localhost","root","*************");if (!$con) { die('Could not connect: ' . mysql_error()); }$Voornaam = trim(addslashes(strip_tags($_POST['First'])));$Naam = trim(addslashes(strip_tags($_POST['Name'])));$Stad = trim(addslashes(strip_tags($_POST['Town'])));$Land = trim(addslashes(strip_tags($_POST['Country'])));$Epost = trim(addslashes(strip_tags($_POST['Email'])));mysql_select_db("tester", $con);mysql_query("INSERT INTO newsletter VALUES ('','$First','$Name','$Town','$Country','$Email','')") or die(mysql_error());$result = mysql_query("Select id from newsletter where Email=('$Email)");while($row = mysql_fetch_array($result)){$confirm_id = $row['id'];}mysql_close($con);$email_address_to = "$Email";$site = "http://vlaanderen-flanders.org.uk;;$subject = "Thanks";$message_contents = "Hello, $First, thank you for subscribing to our newsletter.\n Click the link below to confirm your subscription.\n http://localhost/home/confirm.php?confirm_id='$confirm_id' \n Kind regards,\n The webmaster.\n $site\n";$header = "From: webbie@vlaanderen-flanders.org.uk\r\n";$header .= "Reply-To: webbie@vlaanderen-flanders.org.uk\r\n";$header .= "webbie@vlaanderen-flanders.org.uk\r\n";mail($email_address_to,$subject,$message_contents,$header);?><div align="center"><img src="Pics/Vlaamse Leeuw.jpg" width="114" height="127" alt="" border="0" align=""></div><p align="center"><b>Thank you, you are now subscribed.</b></p><br><p align="center"><a href="index.htm"><img src="Pics/begin.gif" width="95" height="30" border="0"></a></p></BODY></HTML> I had to change in a few places where you did things like $result = mysql_query("Select id from newsletter where email =". $Email); as i got parse errors and all that. I think I am losing site of the trees through the woods with all the single and double quotes and parentheses and curly brackets and that. The last errors I got were those: Notice: Undefined variable: Email in c:\program files\easyphp1-8\home\confirm.php on line 16 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\home\confirm.php on line 18 Notice: Undefined variable: First in c:\program files\easyphp1-8\home\confirm.php on line 22 Notice: Undefined variable: confirm_id in c:\program files\easyphp1-8\home\confirm.php on line 22 Notice: Undefined variable: site in c:\program files\easyphp1-8\home\confirm.php on line 22 Notice: Undefined variable: confirm_id in c:\program files\easyphp1-8\home\confirm.php on line 24 Notice: Undefined variable: id in c:\program files\easyphp1-8\home\confirm.php on line 24 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=''' at line 1 I am getting more and more confused now. Please try to give me further help. Thanks in advance.
-
I assume confirm_id is a variable? Is that correct?And why exactly is the value 9806?Will that be the value for every confirmation of members?And what is the relationship of config_id (which holds 9806) to the id field in the database?That is where I really get stuck, getting that particular record of the person who clicked the confirm link, in order to set his activation to 1 (true).I really don't see how to do it.Thanks.
-
Wow, great stuff, Carson.My best is exactly what I am going to do.(And also hope for the best).Thanks.
-
Thanks, folks.I'll let you know how it went.
-
Hi,I am asking people to wish me luck again.A week today I am taking part in the TISKA Karate championships in the disciplines sparring (fighting), Kata and team Kata.Really excited but also pretty nervous about it all.
-
Sorry to bother you again, but still not getting there with the following in confirm.php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://forums.xisto.com/no_longer_exists/ xmlns="http://forums.xisto.com/no_longer_exists/ http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><?php$con = mysql_connect("localhost","root","root");if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("tester", $con); $confirm_id=9806;mysql_query("UPDATE newsletter SET active='1' WHERE $confirm_id='$id'") or die(mysql_error());mysql_close($con);echo 'That\'s it!!!';?></body></html> I have had all sorts of errors, from parsing errors to unidentified variables, and the latest one is this: 'Notice: Undefined variable: id in c:\program files\easyphp1-8\home\confirm.php on line 17'. So, I am obviously still doing something wrong. Thanks.
-
Thanks, but there are weird things going on. This is my listing for signing in: <HTML><HEAD> <TITLE>Vlaanderen-Flanders</TITLE></HEAD><BODY><?php$con = mysql_connect("localhost","root","********");if (!$con) { die('Could not connect: ' . mysql_error()); }$First = trim(addslashes(strip_tags($_POST['First'])));$Name = trim(addslashes(strip_tags($_POST['Name'])));$Town = trim(addslashes(strip_tags($_POST['Town'])));$Country = trim(addslashes(strip_tags($_POST['Country'])));$Email = trim(addslashes(strip_tags($_POST['Email'])));mysql_select_db("tester", $con);mysql_query("INSERT INTO newsletter VALUES ('','$First','$Name','$Town','$Country','$Email')") or die(mysql_error());mysql_close($con);$email_address_to = "$Email";$site = "http://vlaanderen-flanders.org.uk;;$subject = "Thank you";$message_contents = "Hello, $First, Thank you for subscribing to our newsletter.\n Click the link below to confirm your subscription:\n http://localhost/home/confirm.php?confirm_id=9806 \n Kind regards,\n The webmaster.\n $site\n";$header = "From: webbie@vlaanderen-flanders.org.uk\r\n";$header .= "Reply-To: webbie@vlaanderen-flanders.org.uk\r\n";$header .= "webbie@vlaanderen-flanders.org.uk\r\n";mail($email_address_to,$subject,$message_contents,$header);?><div align="center"><img src="Pics/Vlaamse Leeuw.jpg" width="114" height="127" alt="" border="0" align=""></div><p align="center"><b>Thank you, you have subscribed and you will receive a confirmation email soon.</b></p><br><p align="center"><a href="index.htm"><img src="Pics/begin.gif" width="95" height="30" border="0"></a></p></BODY></HTML>This worked before for subscribing, now I am getting : 'Column count doesn't match value count at row 1' from this PHP page. If that is relevant, the first field is simply called 'id', and is int(6) with auto_increment. Also, to get to that page, a form has been filled in on a HTML page, the following fields were submitted: First, Name, Town, Country, Email. Thanks for all the help so far.
-
I got my mail() function to work on my local machine, thanks to jhaslip's excellent help. (Sincere thanks for that).Now, I am one step away from completing a script to let it do exactly what I want.I already have a page where people can fill in a form to subscribe to a newsletter, and they get an email to confirm they have subscribed.However, i would like to be able to put a link in there, when they click on it it sends them to a webpage to tell them their subscription is now active.To achieve that, i have added one field to the table called 'active', with an array type of int(1) and set to a default of 0.The only thing I want now is that when people click the link, it sets the value of 'active' to 1 and takes them to a page confirming this has happened and their subscription is now active.Unfortunately, I am not 100% sure of how to set up the link (probably something like "http://forums.xisto.com/no_longer_exists/) or the code to change the 'active' value for that particular record to 1.BTW my table 'newsletter' looks like: id int(1) auto_increment primary index, first Varchar(30), last varchar(30), town varchar(30), country varchar(30), email varchar(60), active int(1) default 0.All fields are NOT NULL.Any suggestions, please?Thanks in advance.
-
Hello, I notice in the list that my post "SMTP settings" has received a reply. Yet, when I click on the title to enter the topic, I get the following: Can anyone tell me what has happened to the topic, and, more importantly, how I would be able to read it? Thanks.
-
I have been trying to set my SMTP server so I can test out scripts in which sending email is involved.As I mentioned in another topic, i am using EasyPHP 1.8, a combined package of Apache server, PHP 4 and MySQL.When executing a script on my local machine, a script that normally works online tells me I have a 530 error and I need to authenticate.So, I looked things up in the PHP manual where I found to go to the php.ini file and find [mail function], and underneath that, to set your SMTP server to the one of your own ISP.Furthermore, it told me to set sendmail_from to the email address you want to send from.I did all that, but after restarting the Apache server, and even after re-booting the machine, i still get the same error, and when I look in phpinfo(), my SMTP server still appears at localhost, while my email address still appears as root@localhost.Yet, in the php.ini file, the values are retained as the ones I set them to.Does anyone know why this is happening?BTW I use EasyPHP in order to avoid having to upload all the time and to be able to test scripts and do exercises on my own machine.Thanks in advance for any help.
-
Which Data Type To Use In Mysql Table Using a 5 character number
mrdee replied to mrdee's topic in Websites and Web Designing
True really.That, as you say, would probably complicate things needlessly.It was only like a thing of me getting carried away really.Thanks for the advice. -
Which Data Type To Use In Mysql Table Using a 5 character number
mrdee replied to mrdee's topic in Websites and Web Designing
You see,the intention is to generate like a customer number for them, a sort of customer ID, such as an ID to be printed on invoices.Also good as recognition or to look them up in the database.Eg. 00023= Mr. John Smith, 00038=Mrs. Sally Jones.Or else, a way to auto generate something like:(For piano students) PI00023(For singing students) SI00038(For keyboard students) KE00057Get my drift?That is, of course, difficult to do for me as a beginner, hence the, what probably looks to some reafers her like, moronic questions.All help is very much appreciated and gratefully accepted, though. -
In my MySQL table I would like to use one text field which can contain lots of text. What I want to use it for is for student records, and I want to be able to add to it without destroying what is already there.I want the field to contain something like:****03/11/2007****Chopin prelude No 9: small problem bars 12-15.Advice given on how to practice.****10/11/2007****Problem in Prelude overcome, piece successfully completed.New piece set: Beethoven Sonata No 1, movement 1.etc.This is of course just an example, but that is how I want to set up my student records.Do I have to use LONGTEXT for this, and how do I set the parameters?Thanks in advance.
-
If I wanted to use an ID field which automatically increments when data are addad, but displays the ID as a 5 figure number, which data type would I have to use?I would want a type that assigns a number to a record in the format "00001", "00002", etc.However, when I use "int" as datatype, it only displays th field contents as "1", "2" etc.So, which data type could do the job for me?i do not need a decimal point or anything, just an id that displays in 5 figures, including the leading zeros.Thanks in advance.
-
Where Am I Going Wrong This Time? Cant enter data into database
mrdee replied to mrdee's topic in Websites and Web Designing
I have simply thrown it all out. (Apache, PHP and MySQL).I came across a wonderful (and free) program today called EasyPHP, which gives you all this too, is less than 8 Mb in size, and at least it works, which means that I will be able to learn PHP/MySQL in peace now, without always having to upload my files for testing them.(And without my hair getting gray, or me having one heart attack after another). -
Where Am I Going Wrong This Time? Cant enter data into database
mrdee replied to mrdee's topic in Websites and Web Designing
Since I have been having trouble constantly, I installed everything according to this site: Installing Apache 2.0 and PHP 5 (And MySQL) -
Hi, on my local machine (with Apache 2.0, PHP 5.2.4 and MySQL 5.0) I come across weird things. I have successfully made a table, but when I try to enter data into it it just will not accept the empty string for the first field (id). This was the creation line: This has created the table no problem.However, when I try to enter something into that table with the following command: $query = "INSERT INTO members VALUES ('','John','Barnes','01234 567890','00112 334455','01234 567891','johnbarnes@gowansnet.com','http://gowansnet.com;;mysql_query($query);if (@mysql_query ($query)) {print '<p>The data entry was sucessful.</p>';} else {print "<p>Could not add the entry because: <b>" . mysql_error() . "</b>.The query was $query.</p>";}mysql_close(); (and provision to see whether or not it succeeded), I get the following error: Invalid value in id. Then, when I try again, it does put data in, but in the wrong table, it either works or doesn't when I have to keep switching the opening tag from <? to <?php and back, ie. it says it has worked with the </ tag, but has not entered any data, then with the <?php tag, it tells me "Access denied", although correct username and password are in the script.. In other words, it seems like the whole system is running quite unstable. I know I am not being very specific at times, but there is so much going on that i don't know what fault to post anymore. Would it help if I posted a result from phpinfo()? Thanks, (Before I go completely nuts).
-
Glitch On This Forum? [resolved] Picture not showing up
mrdee replied to mrdee's topic in Web Hosting Support
OK, thanks.Using an avatar now.How could I be so stupid to mistake the personal photo for an avatar?Thanks for your help, everyone. -
Hello,I hope this is the right place to post this, I couldn't find any other place where this would fit.Weeks ago, I uploaded a picture to go with my username.Yet I notice it does not show up, only when I click my username on the left of the forum, it shows up.I did notice that with other users, their picture shows up next to (or underneath) their name.I was wondering why this is happening.Thanks.
-
I see, well, I have hosting at Xisto.So, I could set these details up then?Thanks.
-
I'm afraid that link does not help, talks about using Googlemail.By the way, I forgot to mention: I am testing this program on my local machine, Using PHP 5.2 in conjunction with Apache server 2.2.Thanks.
-
Hello, I typed out a PHP script (literally copied from w3schools, the script is as follows: <html><body><?phpfunction spamcheck($field) {//eregi() performs a case insensitive regular expression match if(eregi("to:",$field) || eregi("cc:",$field)) { return TRUE; } else { return FALSE; } }//if "email" is filled out, send emailif (isset($_REQUEST['email'])) { //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==TRUE) { echo "Invalid input"; } else { //send email $email = $_REQUEST['email']; $subject = $_REQUEST['subject']; $message = $_REQUEST['message']; mail("info@vlaanderen=flanders.org.uk", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } }else//if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; }?></body></html> Yet, when I run it, I keep getting the following error: Warning: mail() [function.mail]: SMTP server response: 530 Authenticate before sending emails. in C:\Program Files\Abyss Web Server\htdocs\mailform.php on line 34 Thank you for using our mail form. Judiging by the last line, the script continues to run after the error. Line 34 is this line: $message, "From: $email" ); As I said before, I am very inexperienced in PHP (a complete beginner), so I do not understand why I am getting this error. Any help will be very much appreciated. Thank you.
-
Can Anyone Advise Me? Interactive web design
mrdee replied to mrdee's topic in Websites and Web Designing
Thanks, but when I went there, it looked suspicously much like one of those domain squatter sites.All they do is try to sell you stuff of which the quality yet has to be proven. I have heard of the w3schools before, but are you sure you have sent me to the right site? Adjustment: After having a look, I found it should most probably be .com rather than .org, this took me to the site I have come across before. -
Can Anyone Advise Me? Interactive web design
mrdee replied to mrdee's topic in Websites and Web Designing
Yes, I know how to do that. LOCALHOST/whatever folder/whatever script. As well as on my web server I have MySQL 5 on my local PC. Thanks.