Jump to content

atchy

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by atchy

  1. Thanks thats reassuring to know. Will now look elsewhere John
  2. Sorry meant to say, receiving the email at my work address but not my home address. I checked the spam filters and there was nothing there. I appeciate that it is not secure but this is not the final code all I am trying to do is get the basics to work first. John
  3. Hi Thanks for the reply Code as requested This is from a tutorial found on apptools.com while googling. It all seems to work apart from receiving email. I sent it to my work address which is a different system (First Class) and arrived ok. Sendmail is set up. Hope you can help. Thanks John [code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>Contact Form</title> <meta http-equiv="Content-Type"   content="text/html; charset=iso-8859-1"> </head> <body> <?php   if ($_SERVER['REQUEST_METHOD'] != 'POST'){       $me = $_SERVER['PHP_SELF']; ?>   <form name="form1" method="post"         action="<?php echo $localhost;?>">       <table border="0" cellspacing="0" cellpadding="2">         <tr>             <td>Name:</td>             <td><input type="text" name="Name"></td>         </tr>         <tr>             <td>Subject</td>             <td><input type="text" name="Subject"></td>         </tr>         <tr>             <td valign="top">Message:</td>             <td><textarea name="MsgBody"></textarea></td>         </tr>         <tr>             <td>&nbsp;</td>             <td><input type="submit" name="Submit"               value="Send"></td>         </tr>       </table> </form> <?php   } else { // initialize a variable to   // put any errors we encounter into an array   $errors = array();   // test to see if the form was actually   // posted from our form   $page = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];   // check to see if a name was entered   if (!$_POST['Name'])       // if not, add that error to our array       $errors[] = "Name is required";   // check to see if a subject was entered   if (!$_POST['Subject'])       // if not, add that error to our array       $errors[] = "Subject is required";   // check to see if a message was entered   if (!$_POST['MsgBody'])       // if not, add that error to our array       $errors[] = "Message body is required";   // if there are any errors, display them   if (count($errors)>0){       echo "<strong>ERROR:<br>\n";       foreach($errors as $err)         echo "$err<br>\n";   } else {       // no errors, so we build our message       $recipient = '[email protected]';       $from = stripslashes($_POST['Name']);       $subject = stripslashes($_POST['Subject']);       $msg = "Message sent by $from\n         ".stripslashes($_POST['MsgBody']);       if (mail($recipient,$subject,$msg))         echo "Thanks for your message!";       else         echo "An unknown error occurred.";       }   } ?> </body> </html> [/code]
  4. Hi Everyone, I am still a newcomer to PHP and have with a lot of help got my site up and running. My last problem is getting the results of a form sent back by email. My test form submits ok but I do not receive the email. Looking at all the tutorials it looks easy using the mail() function. Can anyone please help. John
  5. atchy

    Images in MySQL

    Hi Johnbr, My method has been to upload the .jpg files using ftp to an images folder and then use the database to create the link. I have noticed that the file name should be enclosed within <> Atchy
  6. Hi All, I am using, document.getElement by id, to load large version of a thumbnail image on click. The data in the MySQL table as follows: <img src=images_large/r_price_lg1b.jpg> This has served me well when using ASP now into PHP and the only way I can get this to work is to put the full url of the image into the database ie img src=http://www.mysite.com/images_large/name_lg1b.jpg for every image. Is there an easier way? The thumbnails use <img src=images_small/r_price_sm1b.jpg title='Richard Price - Heaven and Earth'> and work ok so its something to do with the document.getElement by id. Any clues! Thanks Atchy
  7. My text box name is 'search' and I thought that '$search' was/is  the variable I need. Further research has me thinking that I need something like: $something = (isset ($_GET['search']); and $something = mysql_escape_string($_GET['search']); Thanks John Youre last comment got me thinking (its hard at my age) and blundering around and adding $searchstring = mysql_escape_string($_GET['search']); seems to have got me going. Many thanks for your patience with a PHP beginner. All I have to do now is get the results to link to the details page. I may be back. regards
  8. Substituting '$search' with e.g. 'Gregor anda smith vanessa'  (a mixture from 2 columns from table) displays on my results page a list of people matching the keywords; exactly what I want. To my simplistic way of thinking the search page/form is not talking to the results page.  When I try putting in a variable the blank page that results is exactly that, there is no code at all in view source. Sorry I am probably not explaining it in the correct way. John
  9. Hi Fenway, Not sure what you mean by Interpolation. In my ASP version I added a variable to the recordset (Request.QueryString) but trying to add a variable with #search# as shown in 'Dreamweaver help' gives a blank page. It seems that I am missing some code but as I am totally new to PHP I am not sure what this is or where it should be. If you can advise or point me to a straightfoward tutorial or beginners guide to PHP I would be most grateful Thanks for your reply Regards John
  10. Hi, I am currently moving my site over from ASP to PHP and I am trying to create a FULL TEXT search facility. I have created a results page which works perfectly if I type in the name/s directly but unable to get a text field on my search page to work. I am using Dreamweaver, MySql + PHP and testing locally using Apache. A lot of the PHP code is quiet baffling to me and have been using the MySQL Full-Text Searching with PHP from your site as a guide. I feel it must be straightfoward but beyond me. The code from the Recordset is below. I would appreciate any guidance advice so that I may maintain some sanity. Thanks John SELECT artistinfotbl.artistName, artistinfotbl.lastName,artistinfotbl.headDescription, MATCH (artistinfotbl.artistName, artistinfotbl.lastName)  AGAINST ('$search' IN BOOLEAN MODE) AS score FROM artistinfotbl WHERE MATCH (artistinfotbl.artistName, artistinfotbl.lastName)  AGAINST ('$search' IN BOOLEAN MODE) ORDER BY score DESC replacing '$search' with name/s gives exactly what I want.
×
×
  • 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.