Jump to content

[SOLVED] Search PHP help


archonis

Recommended Posts

Hey guys,

I been searching all day and found the search code posting here but it dont help me any. Can someone tell me what I am doing wrong here?

 

 

This is the index.php

 

 

<form name="form2" action="search.php">

            <table width="117%" border="0" align="center">

              <tr>

                <td bgcolor="#3D7AB8">SEARCH</td>

              </tr>

              <tr>

                <td>

                  <input name="a" type="radio" value="1a">

                 

                  <input name="a" type="radio" value="2a">

                 

                  <input name="b" type="radio" value="1b">

                  Male

                  <input name="b" type="radio" value="2b">

                  Female <br>

                 

                  <input name="c" type="text" id="c" size="6">

                  <input type="submit" name="Submit2" value="Submit"></td>

              </tr>

            </table>

                    </form>

 

 

 

 

 

This is the search.php

 

 

 

 

<?php

ini_set("session.cookie_domain"," .thesolarapexs.com");

session_start();

 

$username = $_SESSION['username'];

$mypassword = $_SESSION['password'];

$a1=$_POST['a'];

$b1=$_POST['s'];

$c1=$_POST['c']; 

 

 

 

 

// Make a MySQL Connection

$result = mysql_query("SELECT * FROM members WHERE 'a' LIKE '%a1%' AND 'b' LIKE '%b1%' AND 'c' LIKE '%c1%'")

or die(mysql_error()); 

 

?>

        <table border="0" align="center">

          <tr><td><div align="center">

            <?php

 

while($row = mysql_fetch_array($result))

{

if($x == 2){

echo '</div></td></tr></table><table border=\"0\" align=\"center\"><tr><td><div align=\"center\">';

$x=0;

}

else{

$x++;

}

 

$showmyphoto = "<center><a href=\"http://date.thesolarapexs.com/profile.php?id=" . $row['username'] . "\"><img src=\"http://date.thesolarapexs.com/".$row['photo'] ."\" width=\"132\" height=\"158\"><a>";

echo $showmyphoto;

echo "<br>";

echo  "Username: " . $row['username'] . "<br>" . "Age: " . $row['age'] . "<br>" . "City: " . $row['city'] . "<br>" . "State: " . $row['state'] . "<br>" . "<span class=\"style3\">ONLINE TODAY!</span></center>";

echo "</div></td><td><div align=\"center\">";

}

 

 

?>

 

 

 

 

 

Any help?

 

Link to comment
https://forums.phpfreaks.com/topic/173962-solved-search-php-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.