
michaelkirby
Members-
Posts
40 -
Joined
-
Last visited
Never
Everything posted by michaelkirby
-
Hi, After investigation I found that the SMTP requires authentication. I started looking into PHPMailer, however am not managing to get it to work. Instructions I have got so far are to download and extract phpmailer to my htdocs folder and create a new folder called phpmailer. So the overall path is as follows: C:\xampp\htdocs\phpmailer The code I'm using is as follows: <?php ini_set("include_path", "C:/xampp/htdocs/phpmailer"); require_once("class.phpmailer.php"); $mailer = new PHPMailer(); $mailer->IsSMTP(); $mailer->Host = 'mail.komenltd.co.uk'; $mailer->SMTPAuth = true; $mailer->Username = '[email protected]'; $mailer->Password = 'Password'; $mailer->FromName = 'Komenltd'; $mailer->From = '[email protected]'; $mailer->AddAddress('[email protected]','Michael Kirby'); $mailer->Subject = 'Test Message'; $mailer->Body = 'Does this work?'; if(!$mailer->Send()) { echo "Message was not sent"; echo "Mailer Error: " . $mailer->ErrorInfo; exit; } ?> but when I run the page I get the following error: Warning: require_once(class.phpmailer.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\KomenLtd1\mail.php on line 3 Fatal error: require_once() [function.require]: Failed opening required 'class.phpmailer.php' (include_path='C:/xampp/htdocs/phpmailer') in C:\xampp\htdocs\KomenLtd1\mail.php on line 3 Can anyone help me please?
-
Hi, I found the location of the php.ini file an changed the settings for smtp to the ones of the hosting I have as below> Incoming mail server POP3: pop.123-reg.co.uk IMAP: imap.123-reg.co.uk Outgoing mail server SMTP: smtp.123-reg.co.uk When I run the mail function I still get the following error: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\KomenLtd1\mail.php on line 7 Mail send failure - message not sent Any Ideas at all? Thanks in advance
-
Hi all, Can someone please advise me how to change the SMTP settings in phpinfo(), as I want to add my provider in instead of localhost. Help!! Thanks in advance
-
Hi all, I want to add a contact us form which sends an email to the my email address which happens to be a Google mail account. Can anyone recommend any tutorials that are good to look at? Or pass any advice would be fantastic! Thanks in advance!
-
Hi, I have several drop down boxes which all vary is size. Is there a way to adjust these so they are all the same size? Thanks in advance
-
Query in PHP doesn't work but run in PHP MyAdmin works
michaelkirby replied to michaelkirby's topic in PHP Coding Help
Thanks for pointing out that I missed the quotes but still the AND statement is not applied. I'm just not to sure how this works in PHP MyAdmin but not when I run the same query through my code??? Any ideas? -
Hi all, I have a query in my php code that partly works but the AND statement is not working. When run in PHP MyAdmin this query worked fine. Any ideas?? See code below: $query="select * from users where towncity= 'Maidenhead' and fname = $search_text or organisationname ='$search_text' or surname ='$search_text'";
-
Hi, Sorry I don't quite understand what you mean? Can you explain a little further please? Your help is much appreciated!! Thanks
-
Hi Ken2k7 I just tried breaking it up and the query still produces people that i search for but it does not take into account the condtion I have put in place for profilestatus='public' This is what the code looks like now: $todo=$_POST['todo']; if(isset($todo) and $todo=="search"){ $search_text=$_POST['search_text']; $value=$_POST['type']; $county = Berkshire; //echo $type; $search_text=ltrim($search_text); $search_text=rtrim($search_text); if($value <> "designer"){ $query="select * from users where profilestatus='public' and fname ='$search_text' or organisationname ='$search_text'"; } else{ $kt=split(" ",$search_text);//Breaking the string to array of words // Now let us generate the sql while(list($key,$val)=each($kt)){ if($val<>" " and strlen($val) > 0){$q .= " fname like '%$val%' or organisationname like '%$val%' or ";} }// end o $kt=splif while $q=substr($q,0,(strlen($q)-3)); // this will remove the last or from the string. $query="select * from users where $q "; } } echo "<br><br>"; $nt=mysql_query($query); //echo mysql_error(); ?> Any Ideas??
-
Hi all, I have implemented some search code that I have sourced off the net and have adjusted to fit my needs. What I want to be able to do is search by either fname or organisation name according to the search text which it does, but to also only select the person if the profilestatus = public. I tired adding this to the query but with no luck. Can anyone advise what I'm doing wrong? Below is the code: $todo=$_POST['todo']; if(isset($todo) and $todo=="search"){ $search_text=$_POST['search_text']; $value=$_POST['type']; $county = Berkshire; //echo $type; $search_text=ltrim($search_text); $search_text=rtrim($search_text); if($value <> "designer"){ $query="select * from users where fname or organisationname ='$search_text' and profilestatus='public'"; } else{ $kt=split(" ",$search_text);//Breaking the string to array of words // Now let us generate the sql while(list($key,$val)=each($kt)){ if($val<>" " and strlen($val) > 0){$q .= " fname like '%$val%' or organisationname like '%$val%' or ";} }// end o $kt=splif while $q=substr($q,0,(strlen($q)-3)); // this will remove the last or from the string. $query="select * from users where $q "; } } echo "<br><br>"; $nt=mysql_query($query); //echo mysql_error(); ?> Thanks in advance!!
-
Hi, Ok so I have a login script created already and sessions are working. What do you mean by using access control? thanks in advance!
-
Hi all, I have created a system where each user has a specific profile. What I would like to be able to do is when a user is logged in they should be able to view peoples profile. ANy tips on what I might need to do?
-
Hi all, I'm looking to introduce a file download into my website but not really sure how to go about it. Anyone got any good pointers? Thanks
-
How to refresh the main page after pop up window?
michaelkirby replied to michaelkirby's topic in Javascript Help
Hi xenophobia, I have chosen to use the first method that you suggested and it works perfectly! Thank you for helping out!! -
Hi, I'm new to JavaScript and starting to learn it more, but stuck on an issue and wondered if anyone could provide me with any information. I have a profile page where a picture specific to the user is displayed. Using JavaScript I have a link which opens up a pop up window of an upload form allowing the user to change the particular picture. The user can choose the picture they desire then click upload and the window automatically closes. However this is where the issue is. The main page which is where the profile picture is doesn't update the picture until the page is refreshed. I looked into ways to refresh the page which is possible by setting the refresh of the page to every 5 or 10 seconds, however this is not really practical to refresh the page every 5 or 10 seconds. Is there any better solutions to the issue at all??
-
Hi, I have checked and it's not a cache problem, however TeddyKiller I'm using sessions to get the picture name from the database. e.g $filename = $_SESSION['filename']; <img src="upload/<?php echo $filename?>" align="left"width="150px" height="150px"/> In the database I just store the filename in the user table e.g. car.jpg. So I guess this is the problem. So do I now instead need to create a query straight from the db, but how does this become unique to the person logged in? Would I create a query and at the end say where userid = $userid The $userid coming from the session variable? Can you please advise? Thanks in advance
-
Hi all, I have a way of adding a picture to a profile page for a particular user. When the user changes the profile picture by submitting another picture to the database it stores the link in the dbof the picture. On the profile page the img source is looking for the name of the picture in the db however this works fine however once the picture has been changed the user must log in and out for the picture to change to the new one. Do I need to use some kind of Java script or something in order to get this to dynamically change?? Any able to help at all?
-
Query structure, why would this not work?
michaelkirby replied to michaelkirby's topic in MySQL Help
Brilliant!! Thanks! -
Hi all, I have an upload on and at present it uploads fine to the correct destination. As I'm uploading images I want to be able to store the image in a specific table which is users. $query = "insert into users values where userid= $userid (0,'".$filename."')"; So I run the above query but I errors saying: Unable to perform query insert into users value where userid= 1 (0,'Lighthouse.jpg') I'm storing the user id from the session variable into $user id as below and also putting the filename into the $filename variable. $userid = $_SESSION['userid']; $filename = $_FILES["file"]["name"]; Not sure if I'm doing anything wrong any one able to help?
-
Hi all, I have an upload on and at present it uploads fine to the correct destination. As I'm uploading images I want to be able to store the image in a specific table which is users. $query = "insert into users values where userid= $userid (0,'".$filename."')"; So I run the above query but I errors saying: Unable to perform query insert into users value where userid= 1 (0,'Lighthouse.jpg') I'm storing the user id from the session variable into $user id as below and also putting the filename into the $filename variable. $userid = $_SESSION['userid']; $filename = $_FILES["file"]["name"]; Not sure if I'm doing anything wrong any one able to help?
-
Thanks very much I knew I would be missing something small!!! Thanks
-
$query ="select * from brief, subscriptions where brief.briefid = subscriptions.briefid and userid = $userid"; Error reads... Unable to preform query.br /> select * from brief, subscriptions where brief.briefid = subscriptions.briefid and userid = 1 Column 'userid' in where clause is ambiguous
-
Hi all, I'm creating a query as follows: $query ="select * from brief, subscriptions where brief.briefid = subscriptions.briefid"; What I'm trying to achieve is I have a many to many relationship and want to be able to display that tables details which is called subscriptions. As only the brief id is stored in subscriptions I join the tables to get the name of the brief from brief table. This all works fine but I need some advice on adding another where clause in. I want to be able to select the above data but for the user logged in. So I have the user id in the session but how do I append it to the end of the query as I was getting errors doing it. Any one able to help??
-
Passing values from drop down list to another page
michaelkirby replied to michaelkirby's topic in PHP Coding Help
Thanks Thrope!!! Got it working now. Your help is much appreciated!