Jump to content

simcoweb

Members
  • Posts

    1,104
  • Joined

  • Last visited

Everything posted by simcoweb

  1. Produces a blank page. Here's the entire code but without the query output. [code]<?php session_start(); $loginError = ""; // declare this so it is always available // Turn on magic quotes to prevent SQL injection attacks if(!get_magic_quotes_gpc()) set_magic_quotes_runtime(1); // Validate users input if(!empty($_POST)) { // Check username has a value if(empty($_POST['username']))   $loginError['username'] = "Please enter a user name!"; // Check password has a value if(empty($_POST['password']))   $loginError['password'] = "Please enter a password!"; // Check if any errors were returned and run relevant code if(empty($loginError)) { $username = $_POST['username']; $password = $_POST['password']; include 'dbconfig.php'; // Connect to database $con = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname, $con) or die(mysql_error()); // Get Record Set $sql = ("SELECT * FROM plateau_pros  WHERE username = '$username' AND password = '$password'"); // mysql_query($sql) or die(mysql_error()); $results = mysql_query($sql, $con) or die(mysql_error()); $num_rows = mysql_num_rows($results) or die(mysql_error()); if (mysql_num_rows($results) == "1") { $_SESSION['username'] = $_POST['username']; $_SESSION['memberid'] = $_POST['memberid']; header("Location: members.php"); exit; } else { echo "Your user name and password do not match any in our database! Please try again. <a class='body' href='login.php'>Return to login page.<br>\n"; } } } include 'header.php'; ?>[/code]
  2. Hmmm...that didn't work either. I even changed it to this: [code]<?php if ($num_rows == 1) {       // Enable sessions   $_SESSION['username'] = $_POST['username'];   $_SESSION['memberid'] = $_POST['memberid'];   header("Location: members.php");   exit; } else {   //if ($num_rows == 0){     // display bad username and password error     echo "Your user name and password do not match any in our database! Please try again. <a class='body' href='login.php'>Return to login page.<br>\n";       //}   } ?>[/code] and the page just pulls blank. Here's the page. Type any user/pass combo and see: [url=http://www.plateauprofessionals.com/login.php]www.plateauprofessionals.com/login.php[/url]
  3. Ok, that worked. Thanks, Hug. I knew it was close ..but wasn't puffin on the cigar yet. Now...another quick little issue. In this part: [code]<?php $results = mysql_query($sql, $con) or die(mysql_error()); $num_rows = mysql_num_rows($results) or die(mysql_error()); if ($num_rows == 1) {       // Enable sessions //if (isset($_SESSION['loggedin'])) //{   $_SESSION['username'] = $_POST['username'];   $_SESSION['memberid'] = $_POST['memberid'];   header("Location: members.php");   exit; } else {   if ($num_rows == 0){     // display bad username and password error     $loginError = "Your user name and password do not match any in our database! Please try again. <a class='body' href='login.php'>Return to login page.<br>\n";   } ?.[/code] If they type in a correct user/pass then it works fine. If it's incorrect then i get a blank page. Not sure why. It should display the header/footer and contain the error message....but it's not.
  4. That form code is NOT part of members.php. That is part of login.php which also contains form field validation and a match of username/password against the database. If successful then the user is transferred to members.php via a header call: [code]<?php header("Location: members.php"); exit; ?>[/code] The whole bit of code in the login.php form: [code]<?php session_start(); include 'header.php'; $loginError = ""; // declare this so it is always available // Turn on magic quotes to prevent SQL injection attacks if(!get_magic_quotes_gpc()) set_magic_quotes_runtime(1); // Validate users input if(!empty($_POST)) { // Check username has a value if(empty($_POST['username']))   $loginError .= "Please enter a user name!"; // Check password has a value if(empty($_POST['password']))   $loginError.= "Please enter a password!"; // Check if any errors were returned and run relevant code if(empty($loginError)) { $username = $_POST['username']; $password = $_POST['password']; include 'dbconfig.php'; // Connect to database $con = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname, $con) or die(mysql_error()); // Get Record Set $sql = ("SELECT * FROM plateau_pros  WHERE username = '$username' AND password = '$password'"); // mysql_query($sql) or die(mysql_error()); $results = mysql_query($sql, $con) or die(mysql_error()); $num_rows = mysql_num_rows($results) or die(mysql_error()); if ($num_rows == 1) {       // Enable sessions //if (isset($_SESSION['loggedin'])) //{   $_SESSION['username'] = $_POST['username'];   $_SESSION['memberid'] = $_POST['memberid'];   header("Location: members.php");   exit; } else {   if ($num_rows == 0){     $loginError = "Your user name and password do not match any in our database! Please try again.";     header("Location: login.php");     exit; }   } } } ?>[/code] The members.php page is as follows: [code]<?php // Enable sessions session_start(); $_SESSION['loggedin'] = $_POST['username']; $username = $_POST['username']; // Turn on magic quotes to prevent SQL injection attacks if(!get_magic_quotes_gpc()) set_magic_quotes_runtime(1); include 'dbconfig.php'; include 'header.php'; // Connect to database $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); //new sql query $sql = "SELECT * FROM plateau_pros WHERE username='$username'"; $result = mysql_query($sql, $conn) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<div align='center'>   <table  style='BORDER-COLLAPSE: collapse' bordercolor='#666666' cellpadding='4' width='530' border='0'>   <tbody>   <tr><td>   <p>     <font class='bodytext'>Welcome<b>" . $row['username'] ." " .$row['lastname'] . "</b></font>   </p>   <p>   <img src='images/photo/$photo' width='150' height='175'>   </p>   <p>   <strong><font class='bodytext'>Member Actions</font> </strong>   </p>   <font class='bodytext'>   <ul>   <li>Edit Profile</li>   <li><a class='body' href='getrefs.php?memberid=$memberid'>View Referrals</a></li>   <li><a class='body' href='http://www.plateauprofessionals.com/cal/calendar.php' target='_blank'>View Calendar</a></li>   </ul>   <p>   <h3>Plateau Professionals Code of Ethics</h3><p> <font class='bodytext'><b>As a member of Plateau Professionals I agree to abide by the following Code of Ethics:</b><br> <ul> <li>I will provide the quality of service and price quoted to all referrals.</li> <li>I will treat my business like any other prestigious enterprise and will fulfill commitments I make to members and referrals.</li> <li>I will conduct myself with integrity and responsibility</li> <li>I will be a positive member of Plateau Professionals and support the enthusiastic atmosphere by my active participation at every meeting.</li> <li>I will uphold the Code of Ethics within my profession.</li> </ul> </p> <p> </p> <p> </p> </font></td> </tr> </tbody> </table> </div>"; } include 'footer.php'; ?> <? // Tidy up used objects // Close recordset if(isset($result)) @mysql_free_result($result); // Close database connection if(isset($conn)) @mysql_close($conn); ?>[/code]
  5. Ok, just for fun I took the basic form elements and the 'test' snippet and ran it. Here's what I did: [code]<form action="<? $_SERVER['PHP_SELF'] ?>" id="Form1" style="WIDTH: 100%" name="Form1" method="post" > <table id="Table1" cellspacing="0" cols="2" cellpadding="0" align="center" border="0"> <tbody> <tr><td>User name:&nbsp;&nbsp;</td><td><input type='text' size='21' name="username" ></td> </tr> <tr> <td>Password:</td><td><input type="password" size="21" name="password"></td> </tr> <tr> <td></td> <td align="right"><br><input type="submit" value="Login"></td> </tr> </tbody> </table> </form> <?php if(isset($_POST['username'])){   echo "post worked!"; } echo $username; echo $password; ?>[/code] When I test this I get these results: [quote]post worked!terrellowens[/quote] Which means the form works. Now, WHY is the form then breaking down and not sending the 'username' and 'password' fields to the members.php page.
  6. First, thanks for the posts. Both of you. I have not echoed the $username variable. Just the query itself to see if it pulls the data. It's blank when I echo that. But, if I manually enter the username in the WHERE clause then it echoes the results of that particular profile. I'll try echoing the $username and post back here the results.
  7. I'm still struggling with this mystery. I have a login form. Simple stuff: [code]<form action="<?php print $PHP_SELF ?>" id="Form1" style="WIDTH: 100%" method="post" > <table id="Table1" cellspacing="0" cols="2" cellpadding="0" align="center" border="0"> <tbody> <tr><td>User name:&nbsp;&nbsp;</td><td><input type='text' size='21' name="username" ></td> </tr> <tr> <td>Password:</td><td><input type="password" size="21" name="password"></td> </tr> <tr> <td></td> <td align="right"><br><input type="submit" value="Login"></td> </tr> </tbody> </table> </form>[/code] There's other code but this is the focus. No errors in the other code as it just validates then if no errors forwards the logged in user to a page 'members.php' where it should display their profile and picture based upon their username. Problem is it won't display it as for some reason the 'username' field is not being passed. Here's the 'members.php' code: [code]<?php $username = $_POST['username']; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); //new sql query $sql = "SELECT * FROM plateau_pros WHERE username='$username'"; $result = mysql_query($sql, $conn) or die(mysql_error()); ?>[/code] Now, this is SUPPOSED to pull the array of data based upon the posted username. It's not. The page is blank. We've echoed the query to see what's up using this bit of code: [code]<?php echo "query = ". $sql. "<br/>"; if(!$username) { echo "Heres your problem"; } ?>[/code] Which produces the echo display. In other words, NO username is being passed. Therefore, no data being pulled. Now, if I change the $username variable in the query to an actual username then all their data shows properly. This is the mystery. WHY won't the username variable pass via POST to the members.php page and populate the WHERE username='$username' clause in the query? I've even tried this with different login forms thinking there's something goofy I can't see. Still the same issue. I've tried posting the data to an external script instead of <?php print $PHP_SELF ?> and that didn't work. I need some help with this one. Thanks! :)
  8. It echoes nothing if I remove the session lines. Actually i've removed the session_register lines and just having session_start(); on both the form page and the parsing script makes it work.
  9. Ok, got it to work by adding this to the sessions: [code]<?php session_start(); session_register("secure"); ?>[/code] Which then matches the variable match for $_SESSION in the validation process. Form produced no errors and I received the email from the contact form. Thanks again!
  10. Funny you should mention that as i'd just put that in there before receiving your post email. I've added it but it still provides a mismatch error. My revised code looks like this now: [code]<?php session_start(); // do the security check if (isset($_POST['submit'])) { // clean and check form inputs including the secure image code     $name = trim(strip_tags($_POST['name']));     $location = trim(strip_tags($_POST['location']));     $email = trim(strip_tags($_POST['email']));     $phone = trim(strip_tags($_POST['phone']));     $best_time = trim(strip_tags($_POST['best_time']));     $details = trim(strip_tags($_POST['details']));     $referred_by = trim(strip_tags($_POST['ref_by']));     $secure = strtoupper(trim(strip_tags($_POST['secure'])));     $match = $_SESSION['secure']; // the code on the image } $err = ""; include 'header.php'; // input error checking     if ($name=="") {         $err.= "Please provide your name. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br/>";     }     if ($location=="") {   $err.= "Please provide your city of residence. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br/>"; } if (!$email) {         $err.= "Please provide your email address. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br>";     }     if ($email) {         if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {             $err.= $email. " is not a valid email address. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br/>";         }     }     if ($phone=="") {         $err.= "Please provide a phone number. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br/>";     }     if ($best_time=="") {   $err.= "Please provide the best time to contact you. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br/>"; }     if (!$secure) {         $err.= "No security code entered. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br/>";     }     if (($secure!=$match) && ($secure!="")) {         $err.= "Security code mismatch. <a class='body' href=\"javascript: history.go(-1)\">Back To Form</a><br/>";     }     //echo $err; //exit;       if ($err!='') {     echo "<center>";     echo "<strong>Form Error(s)</strong><br/>";     echo "<font class='bodytext'>The following fields were not completed correctly. Please return to the form and complete them accordingly.<br>\n";     echo "<font color='#cc3300'>". nl2br($err). "</font><br/>\n";     echo "</center>"; } else { // set mail variables $to="admin@plateauprofessionals.com"; $subject="Plateau Professionals Inquiry"; $mailContent="--------CONTACT--------\n"             ."Name: ".$name."\n"             ."Location: ".$location."\n"             ."E-mail: ".$email."\n\n--------PHONE--------\n"             ."Phone: ".$phone."\n"             ."Best time to call: ".$best_time."\n\n--------Details--------\n"             ."Details: ".$details."\n" ."Referred by: ".$referred_by."\n"; // send the results mail($to, $subject, $mailContent, "From:$email") or print "Could not send email"; echo "<h2>Message Sent</h2><br>\n"; echo "<font class='bodytext'><blockquote>Your message has been sent. A representative will respond as soon as possible. Thank you for contacting Plateau Professionals!</blockquote><br>\n"; } include 'footer.php'; ?>[/code] The form input for the security image is basic stuff: [quote]<td><img src="captcha_image.php" alt="security image" border="0"/></td> </tr>             <tr>             <td><p align="right"><font class="bodytext">Verification:</font><br><font size="1">Enter the code shown.</font> </p></td>             <td><input type="text" name="secure" maxlength="8"></td>[/quote] Thanks for your help!
  11. heh...silly me. I forgot to put an echo statement to show the various errors. Guess I thought they'd somehow magically appear.  ;D Only challenge left is the security image. For some reason it's not matching it and continually says the security code entry doesn't match. I KNOW i'm typing them in correctly. See anything in that segment that stands out?
  12. I have this form script (below) that doesn't produce any errors but does not display any validation errors nor sends the data nor displays the confirmation message. Basically it displays the header/footer and the rest is blank. I don't see the point where it's breaking down. [code]<?php // do the security check if (isset($_POST['submit'])) { // clean and check form inputs including the secure image code     $name = trim(strip_tags($_POST['name']));     $location = trim(strip_tags($_POST['location']));     $email = trim(strip_tags($_POST['email']));     $phone = trim(strip_tags($_POST['phone']));     $best_time = trim(strip_tags($_POST['best_time']));     $details = trim(strip_tags($_POST['details']));     $referred_by = trim(strip_tags($_POST['ref_by']));     $secure = strtoupper(trim(strip_tags($_POST['secure'])));     $match = $_SESSION['secure']; // the code on the image } $err = ""; include 'header.php'; // input error checking     if ($name=="") {         $err.= "Please provide your name. <a href=\"javascript: history.go(-1)\">Back</a><br/>";     }     if ($location=="") {   $err.= "Please provide your city of residence. <a href=\"javascript: history.go(-1)\">Back</a><br/>"; } if (!$email) {         $err.= "Please provide your email address. <a href=\"javascript: history.go(-1)\">Back</a><br>";     }     if ($email) {         if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {             $err.= $email. " is not a valid email address. <a href=\"javascript: history.go(-1)\">Back</a><br/>";         }     }     if ($phone=="") {         $err.= "Please provide a phone number. <a href=\"javascript: history.go(-1)\">Back</a><br/>";     }     if ($best_time=="") {   $err.= "Please provide the best time to contact you. <a href=\"javascript: history.go(-1)\">Back</a><br/>"; }     if (!$secure) {         $err.= "No security code entered. <a href=\"javascript: history.go(-1)\">Back</a><br/>";     }     if (($secure!=$match) && ($secure!="")) {         $err.= "Security code mismatch. <a href=\"javascript: history.go(-1)\">Back</a><br/>";     }     if ($err=="") { // set mail variables $to="admin@plateauprofessionals.com"; $subject="Plateau Professionals Inquiry"; $mailContent="--------CONTACT--------\n"             ."Name: ".$name."\n"             ."Location: ".$location."\n"             ."E-mail: ".$email."\n\n--------PHONE--------\n"             ."Phone: ".$phone."\n"             ."Best time to call: ".$best_time."\n\n--------Details--------\n"             ."Details: ".$details."\n" ."Referred by: ".$referred_by."\n"; // send the results mail($to, $subject, $mailContent, "From:$email") or print "Could not send email"; echo "<h2>Message Sent</h2><br>\n"; echo "<font class='bodytext'><blockquote>Your message has been sent. A representative will respond as soon as possible. Thank you for contacting Plateau Professionals!</blockquote><br>\n"; } include 'footer.php'; ?>[/code] The form is at [url=http://www.plateauprofessionals.com/gencontact.php]www.plateauprofessionals.com/gencontact.php[/url] It's fairly basic with the exception of the CAPTCHA image and has action="sendform.php" which is the script code shown.
  13. Ok, let's see if we can make sense of this. Alright, so you're not using tables. That was just an example. I wanted you to see how I was calling the results using " . $row['hotelName'] . " and not so much the tables themselves. In regards to the link....first I need to understand how you get the ID into your link. I have a similar setup and my links are like this which are hard-coded with the category id number: http://www.mysite.com/category.php?categoryid=4 Now, when they click on that it takes them to category.php and identifies the categoryid through a $_GET['categoryid'] which sets that as a variable like: $categoryid = $_GET['categoryid']; So, in the continuation links you'd use the variable like this: http://www.mysite.com/category.php?categoryid=$categoryid This way no matter what link they click on over there <------------- it take them to the proper category over there --------> and displays the content/details pertaining to only that categoryid by using the WHERE categoryid = '$categoryid' clause. Make sense? So, in your case, i'm not 100% on how you have this set up but it's obvious you have an ID # in your links that they are clicking on. So, assuming that you have a list of hotels on a page that then link to this script you're creating whereas there's an ID number in that link (ie: index.php?[b]Id=16[/b]&id={$row['Id']}">{$row['regionName']}) then you'd want to snag that ID using the $_GET and use in your links and get the other 'id' from your query to fill out your link. Since your query returns an array of all the data pertaining to that particular hotel (ie: the SELECT * FROM ) then you can get the other 'id' variable displayed like I showed you and then daisy chain it into your link like this inside you WHILE loop: echo "<a href='index.php?Id=$Id&id=" . $row['id'] . "'>Click here to view this hotel!</a>"; Again, these are just examples. Not 100% sure what you're trying to accomplish. But, one more thing. I still don't see where you are setting a value for this variable: $sql="SELECT * FROM tabHotel WHERE regionId = [b]$id[/b]"; That needs to know what the value is in order to match it with your regionID in the WHERE clause.
  14. Hmmm...nope. Added them and still produces nothing if I search for 'bananas' which occurs in 6 places. Still, if I search for 'wangers' I get a result. The word 'wanger' is the only word in that field for that member. I read something on this that mentioned 'Full Text' searches. Here's the summary. Maybe this sheds light on it or sparks an idea. [quote]MORE ON FULL-TEXT... Full-Text is a type of index created on a table. The Full-Text index basically creates an index of all of the words of the field specified in your table. Each entry in this index references a row in your table. These indexes are created in separate index files by MySQL. When you perform a search against the Full-Text index, the MySQL Full-Text search functions use this index to return the related rows from the table back through the result set. Through this index, the search performance is enhanced through its speed in returning the results and could also give you the ability to sort the results according to its relevance. SETTING UP THE DATABASE... As an example let us use the table with the structure defined below: CREATE TABLE `Table_Name` ( `field1` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `field2` VARCHAR( 100 ) NOT NULL ); The field where we will match our search queries against is the string field2. to create the Full-Text index for field2 use the sql statement below: ALTER TABLE Table_Name ADD FULLTEXT (field2); THE QUERY... With the database set, let us move on the query statement that would be used to return the resulting records from the search�. SELECT * FROM Table_Name WHERE MATCH(field2) against(`search string`); Full-Text searching uses the MATCH() and AGAINST() syntax. As parameters, MATCH() takes the list of all the field names from where we will �match� the search string into. While AGAINST() takes the search string. The search string can contain any phrase that you would like to search in database. Stopwords like `else`, `any`, `at`, `as` would not be considered by the full-text search. For a list of all the stopwords visit http://dev.mysql.com/doc/refman/5.0/en/fulltext-stopwords.html[/quote] Does this conjure up any ideas/solution? :)
  15. I'm not a pro but I see a couple of things and perhaps a different way to write your output. First, I don't see where you're setting the value for the variable $id that's in your query: [quote]$sql="SELECT * FROM tabHotel WHERE regionId = $id";[/quote] There should be something like this in order to set the value: [quote]$id = $_GET['id'];[/quote] Then let's take a look at the URL you want to output from your results. You have this: [quote]<a href="index.php?Id=22">[/quote] In your 'while' loop for displaying your contents you can include that link plus the other html and make the link like this: [code]<?php <a href='index.php?Id=" . $row['Id'] . "&id=" . $row['id'] . "'><img src="../images/moreinfo.jpg" alt="moreinfo" width="75" height="18" border="0"></a> ?>[/code] Since you're already retrieving all the data in your query: [code]$sql="SELECT * FROM tabHotel WHERE regionId = $id";[/code] You can display it in your 'while' loop and dress if up in a table for example and the link would appear as your image and point to the proper location.  Make sense? So, displaying it like this for example: [code] <?php echo "<table width='90%' border='0'>"; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<tr><td>" . $row['hotelName'] . "</td></tr>         <tr><td>" . $row['hotelDescription'] . "</td></tr>         <tr><td>" . $row['hotelRating'] . "</td></tr>         <tr><td><img src='../thumb/phpThumb.php?src=../images/hotel_" . $row['hotelImage'] . "&w=100&h=100&zc=1' alt='Hotel'></td></tr>"; } echo "</table>"; ?> [/code] This is just an idea, obviously. But would output your results in a table layout that you can then dress up with some background colors and styles.
  16. Ok, through some tweaking to get the actual database parameters and field names correct I got the search working for the most part and displaying the results. However, here's the rest of the puzzle now that I see if work. If I type in a single word and the single word matches a 'specialties' in the database that is also a single word then it returns a result. However, if the single word search word matches against a sentence in the 'specialties' field then it returns nothing. To clarify, it only returns a result for a single word search IF the item is finds is also a single word. Here's an example: a search for 'wangers' comes up with a member specializing in 'wangers' as 'wangers' is the only word in his specialties field If I search for 'bananas' which is mentioned in 5 member profiles in the 'specialties' field but as part of sentences like 'I eat bananas' it returns nothing. The search should display the results of any member matching the keywords from their 'details' and 'specialties' fields. Is there an adjustment to make to this to do so? Here's the working query: [code]<?php $sql = "SELECT DISTINCT p.firstname, p.lastname, p.title, p.comments, p.memberid FROM plateau_pros p INNER JOIN specialties s ON p.memberid = s.memberid WHERE p.comments LIKE '%$keyword%' OR s.specialties LIKE '%$keyword%'"; $results = mysql_query($sql) or die(mysql_error()); ?>[/code] You can test this to see what I mean at [url=http://www.plateauprofessionals.com/search.php]http://www.plateauprofessionals.com/search.php[/url] The specialites fields, for example, contain these items:         ID    MEMBERID    SPECIALTIES 3      65      I eat bananas faster than any monkey. 4 66 I eat bananas 5 67 I eat bananas 6 68 eating bananas 7 69 eat bananans 8 70 eat bananas Searching for 'bananas' returns a fat 0.
  17. Barand: Can the $keyword variable just be a simple $_POST['keyword']; call? The search form is basically: [quote]<input type='text' size='20' name='keyword'>[/quote] Or is there some special tags I have to use to summon it to work with the %keyword% tags?
  18. I need a simple search that will query two fields in a membership database, 'details' and 'specialties', where these two are in separate tables. I've done some research on the various methods. For example, a simple query: [code]SELECT * FROM Table_Name WHERE MATCH(field2) against(`search string`);[/code] Or: [code]SELECT field1, field2 FROM Table_Name WHERE field2 LIKE '%search_string%' [/code] Basically this should be a 'keyword' match type thing then return specific info from the query into links to the member's profile that contain the results. So, say they want a chiropractor and enter that as their keyword. It should query the fields and return the results displayed like: 1. Dr. Robert Jones - Chiropractic Care 2. Dr. Billy Bob Thornton - Chiropractic Center etc. With each linking to their respective member profile. To avoid hours of coding in the wrong direction i'm asking for some help in getting this started so I can get 'er done :) Thanks in advance!
  19. heh...i'm not sure if i'm happy or sad. It's my server  :'(  But at least I know the code is good!  ;D Thanks for helping.
  20. Interesting...... both showed up in the Hotmail account.
  21. Ok, I chose a member id that has my email address in it and then used the same email address as the visitor. So, I should've received both emails. Neither one showed up. When I used my hotmail account as the visitor then it would show up in my hotmail account and the 'from' address would be the email address of the member which is the same one I just tried. It's a valid email address and I triple checked it. So, we know it will send to my hotmail account so it's not entirely a delivery problem. However, it wouldn't send to my domain account which is hosted on the server this script is running on. Ideas?
  22. Basically $row is established as part of a query. Here's the code: [code]<?php // need to get member data $sql2 = "SELECT * FROM plateau_pros WHERE memberid = '$memberid'"; $results = mysql_query($sql2); $row = mysql_fetch_array($results); ?>[/code] This query's results then are sprinkled throughout the page like this: [code]<?php echo "<h2>Inquiry Sent!</h2><br><font class='bodytext'>Thank you for your contact submission! <b>" . $row['firstname'] . " " . $row['lastname'] ."</b> will respond to your inquiry as soon as possible. We also encourage you to contact <b>" . $row['firstname'] . " " . $row['lastname'] ."</b> directly by email or phone:<p> <ul> <li><a class='body' href='mailto:" . $row['email'] . "'>Click here to email</a></li> <li>Phone: " . $row['phone'] . "</li> <li>Mobile: " . $row['mobile'] . "</li> </ul><br>\n"; exit; ?>[/code] As well as in that snippet your quoted where i've inserted the $row['email'] in order to have the email sent to the member chosen. The script is a contact form whereas the visitor first chooses a member they wish to contact. When they select that member the memberid is passed via the URL and snagged with a $_GET. Then the query is run based upon the $_GET['memberid'], extract that member's data and displays it where needed. That query code is right above the form mail code. But, there's no 'while' loop. The form is successfully emailing this one to the visitor: [quote]mail($email, $subject, $receiptMessage,"From:$toAddress");[/quote] but not this one to the member: [quote]mail($toAddress,$recipientSubject,$mailContent,"From:$email");[/quote] The one that does get sent to the visitor shows the proper return address which would be the member's email as placed by " . $row['email'] . "
  23. Please post your code for the image upload.
×
×
  • 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.