Jump to content

Hooch

Members
  • Posts

    452
  • Joined

  • Last visited

Everything posted by Hooch

  1. Hooch

    my search page

    hmm..I must be missing something. $query = "SELECT id,username,studio,tours,medium,biography FROM users " ."WHERE (username LIKE '%".$keywords['0']."%' studio LIKE '%".$keywords['0']."%' OR tours LIKE '%".$keywords['0']."%' OR medium LIKE '%".$keywords['0']."%'OR biography LIKE '%".$keywords['0']."%')";for ($i=1; $i<count($keywords); $i++) {$query = $query." AND (username LIKE '%".$keywords[$i]."%' studio LIKE '%".$keywords[$i]."%' OR tours LIKE '%".$keywords[$i]."%' OR medium LIKE '%".$keywords[$i]."%' OR biography LIKE '%".$keywords[$i]."%')";} I just saw I missed an OR on each section...ooopssee
  2. Hooch

    my search page

    awsome! Sorry for my confusion on the terminology. Now I have about the search..I have about 5 fields to search. Would this "WHERE (biography LIKE '%".$keywords['0']."%' OR tours LIKE '%".$keywords['0']."%')"; change to this "WHERE (biography LIKE '%".$keywords['0']."%' OR studio LIKE '%".$keywords['0']."%' OR medium LIKE '%".$keywords['0']."%'OR tours LIKE '%".$keywords['0']."%')";
  3. Hooch

    my search page

    Holy cow..am I moving along here!! I really appreciate the help you guys have given me.I did a google on site searches. I found one and have it very close to what I need. It will search one row of a database. I know how to make it show results fromas many rows I want, but I can't figure out how to make it search multiple rows. Here's my code... <link rel="stylesheet" type="text/css" href="includes/tia.css" /><?php// Connect to DBinclude "includes/z_db.php";if(isset($_GET['search'])){$search = $_GET['search'];}$keywords = explode(" ", $search);$query = "SELECT id,username,email,biography, tours FROM users " ."WHERE biography LIKE '%".$keywords['0']."%'";for ($i=1; $i<count($keywords); $i++) {$query = $query." AND biography LIKE '%".$keywords[$i]."%'";}$result = mysql_query($query) or die(mysql_error());?><center><a href="index.php">Back</a><table width="50%" style="border:1px solid #000000;"><?phpwhile($row = mysql_fetch_array($result)){echo "<tr>";echo "<td style='border-bottom: 1px solid #000000;'>";echo "<b><span class=\"red-medium-16\">".$row['username']."</span></b><br>";echo "<b><span class=\"black-reg-10\">Tours:</b> ".$row['tours']."<br>";echo "<b>Biography:</b> ".$row['biography']."<br>";echo "</span></td>";echo "</tr>";}?></td></tr></table></center> I assume this is what needs to be tweaked. Right now it's searching the Biography row. for ($i=1; $i<count($keywords); $i++) {$query = $query." AND biography LIKE '%".$keywords[$i]."%'";} Many many thanks..Hooch
  4. Thanks guys. I took Choclates advice and all is working.
  5. Hooch

    Log in

    Bingo. Wow, I'm a happy boy. This is great. Thanks a million guy!!
  6. Hi Chocolate,would it look like this then? // set a cookiesetcookie( "id", "$id", time()+3600, "/", "", 0 );print "<script>location = 'index.php';</script>"; print '<noscript><a href=\"index.php\">Click here to go back to index.php</a></noscript>';}
  7. Like a glove!! Thanks man!
  8. I have a login.php page that will say you have successfully logged in or it will say try again if something is wrong. I wish to change the successfull login from this.. // set a cookiesetcookie( "id", "$id", time()+3600, "/", "", 0 );echo "User Logged in.<br><br><a href=\"index.php\">Continue...</a>";} To redirecting back to index.php automatically. Can I do this, If so how? Thank you..Hooch
  9. Hooch

    Log in

    I did that 1st actually..but the image never moved. So I thought the CSS covered that part. I'll give it a try again..maybe something was missing before. I just added the src. and still no movement. It just keeps the original pic. I even tried changing the bg pic for the hover, nothing changes.
  10. Hooch

    Log in

    hmm.. the image is not working. But the CSS is. Here's my code for the submit...mind having a boo? <input type=\"image\" class=\"submit\" name=\"submit\"> Here's my CSS code /* =======Submit button========= */.submit { background-image: url(images/submit.jpg); background-repeat: no-repeat; background-position: top left; height: 16px; width: 16px;}.submit:hover { background-position: bottom left;} Again, I cannot thank you enough. I wouldn't be able to learn this stuff any other way.Cheers P.S. I just got the msgbox working...yay!!
  11. Hooch

    Log in

    I hope I can change the subject a bit here. I was wondering if it's possible to change the submit button for my log in form?Here's the code. echo "<a href=\"signup.html\">Register</a><form action=\"login.php\" method=\"post\">name: <input type=\"text\" name=\"username\" size=\"8\"> password: <input type=\"password\" name=\"password\" size=\"8\"><input type=\"submit\" value=\"submit\" name=\"submit\"></form>"; I was hoping to change the button to a clickable .gif. Or atleast a text link. The button looks way out of place.Would I change it to this?? echo "<a href=\"signup.html\">Register</a><form action=\"login.php\" method=\"post\">name: <input type=\"text\" name=\"username\" size=\"8\"> password: <input type=\"password\" name=\"password\" size=\"8\"><input type=\"image\" SRC=\"image/mypic.gif\" name=\"submit\"></form>"; Thank you
  12. Hooch

    Log in

    Awsome, ty. It's very late, but I"ll try this later Monday night. I'll update you then. Hooch
  13. Hooch

    Log in

    I thought this would work...but because of the die command I loose the restof my page if I'm not logged in. Is there a way around this with the way I'm going here? Thank you..Hooch
  14. Hooch

    Log in

    BINGO!!! Thank you soo much!! You da man!!Oh..BTW incase anyone is following alongI had to change 1 thing in your code.$r=mysql_fetch_assoc($result)) to$r=mysql_fetch_assoc($result);Again thank you very very much.
  15. Hooch

    Log in

    Thanks justsomeguy. I took the "where" clause out because it didn't work. And I added yours with the same result. Nothing gets displayed. Hooch
  16. Hooch

    Log in

    I got the username showing up now after "welcome - ". But it's only showing the 1st name in the database....not the user who actually is signed in. Here's my code. <table width="700" height="100" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#00FF00"> <tr> <td height="81" colspan="4" background="images/header-700-81.jpg"> </td> </tr> <tr> <td width="62" height="19"> <?php if (!$_COOKIE['id']){ echo "<a href=\"signup.html\">Register</a>"; echo " "; echo "<a href=\"login.html\">Log In</a>"; die(""); } echo "Welcome - "; ?> </td> <td width="212" height="19"> <?php // Connect to the database $server = "localhost"; $dbuser = "user"; $dbpass = "pass"; $dbname = "bd_name"; mysql_connect($server,$dbuser,$dbpass) or die ("connection error"); // make connection mysql_select_db($dbname); // select database // Get users information $result = mysql_query("SELECT * FROM users LIMIT 1"); while($r=mysql_fetch_array($result)) { $username=$r["username"]; echo "$username"; } ?> </td> <td width="212" height="19"> </td> <td width="214"> </td> </tr></table> Thank you for any help. Hooch
  17. Hooch

    Log in

    Hello all, and thank you W3Schools for a helpfull site.I was wondering how you could have a page that shows if your logged in or logged out. But if you are logged out, the script doesn't block the rest of the page.I was hoping to keep the main page the same for users no matter logged in or out. Just have a button/link to log in or out within a table of the header.So I tried making a header that was in an includes folder. Then the whole of the header is before the php that checks to see if your logged in. This way no matter what the header will show.I then made my main page that included the header.php file.Now the php code that says if your logged in or not seems to be working, but I want it to say Hello "username here". Here is my problem.Could someone please look at my code to find out why the username doesn't show up?Here's a more simplified look at my code.. <?php if (!$_COOKIE['id']){ echo "<a href=\"signup.html\">Register </a><a href=\"login.html\">Log In</a>"; die(""); }echo "Welcome";// username here?> How would you code this to add the username from the database?And where is the best place to add the database connection? Here is the code for the connection...is this ok? // Connect to the database $server = "localhost"; $dbuser = "&^*^%"; $dbpass = "%^$%^"; $dbname = ")**^^"; mysql_connect($server,$dbuser,$dbpass) or die ("Could not establish connection"); // make connection mysql_select_db($dbname); // select database // Get users information $result = mysql_query("SELECT * FROM `users` WHERE `id` = '".$u."' LIMIT 1"); while($r=mysql_fetch_array($result)){ I have successfully added 3 members to my test site. I can log in and out no problem. Thanks for your time...Hooch
  18. Hooch

    d/l a .pdf?

    Thanks Goat. This is what I'll do. I was curious if there was a way to do this via html. Maybe there wasa code I wasn't aware of. Have a great weekend.
  19. Hooch

    d/l a .pdf?

    Hello all...Happy Easter. Is it possible to have a link to download a .pdf file, instead of it going to it to view? Thank you.. Hooch
  20. (In a Mr. Burns voice).....Excellent Thanks guys.
  21. Hi Scott, I have another question. Is it possible to add alt="text here" somewhere over the text of the link? So when you scroll over the artists name, it will say they are a "painter" or "carver" etc. Thank you..Hooch btw, here's my work in progress TIArts.org Go to the members page to see this code in action.
  22. AWSOME!! Thank you so much. I can't wait to try this out when I get home.
  23. Hi all. I hope to get my point across here without confusing everyone. What is the best way to have the ability to mouse over a link ( it needs to be a link too) that will change a picture on another part of a page? There will be about 40-60 of these links. I'm helping out with a local artist communities webpage. They will have anywhere from 40 - 60 members. On the members page they want to be able to show all members on one page. They will be in 2 columns and there will be a spot between the 2 columns for a small pic of the atrtist. So when you mouse over each name you can see thier picture, and if you want to see more just click the link. Is this a possiblity? Thank you
×
×
  • Create New...