Jump to content

justAnoob

Members
  • Posts

    561
  • Joined

  • Last visited

    Never

Everything posted by justAnoob

  1. Here is my query now. <?php $var = @$_GET['whatever'] ; $trimmed = trim($var); $query = "select * from MYTABLE where SOMETHING like \"%$trimmed%\" or description like \"%$trimmed%\" order by SOMETHING"; ?>
  2. I think so, I just need to create another variable off of the first one so my search script will search for the plural also. I'll do some playing around. I think the only problem I may run into is if I already type the plural into the search box, then I need it to check for the singular tense of the word. Any input would be greatly accepted. But in the meantime, its coding time(more like trial and error for me, lol)
  3. I'm still learning PHP, but I'm pretty sure sessions are destroyed when the browser is closed. You may to look into using cookies. Cookies will be stored in the users browser until the user deletes them(most users with no knowledge of PC's deletes them, lol) Do a quick search on storing login cookies with PHP and see what you get.
  4. I have a little search script. But I also want it to search for the plural of words also ex: guitar guitars or crash crashes Basically adding either "s" and "es" to any word entered in the search box. The question I got is, what is the name for adding letters to variables? I think I can figure it out if I know what to look for.
  5. have a misplace a quote or semi-colon? <?php echo '<a style="cursor:pointer" class="style10" onclick="toggle_visibility('control');">' . $row['item_name'] . '</a>'; ?>
  6. sorry again. I must be tired. i had href="#" which takes me to the top of the page. sorry folks.
  7. I have some tree menus on a page. When I click on a menu selection. My scroll bar on the page keeps taking me to the top, which then I have to scroll back down to see the change on my tree menu. Would I use PHP to keep the position of my page? And if so, what do you call this?
  8. I have a table that is populated from a database. Right now the background color is D3E0EC. My question is how could I have the rows alternated colors from D3E0EC and FFFFFF ? <?php while ($row = mysql_fetch_array($sql)) { echo '<table width="705" border="0" cellspacing="0" id="first" bgcolor="#D3E0EC">'; echo '<tr>'; echo '<li>'; echo '<td width="323">'; echo '<a href="#" class="style10" onclick="clicked(\'' . $row['item_name'] . '\')">' . $row['item_name'] . '</a>'; echo '</td>'; echo '<td width="100"><div align="center"><form id="form3" name="form3" method="post" action="delete.php">'; echo '<input type="submit" name="submit" class="style10" style="cursor: pointer; border: 0; background-color: #D3E0EC;" id="submit" value="X" /></form></div></td>'; echo '<td width="75"><div align="center" class="style10">55</div></td>'; echo '<td width="131"><div align="center" class="style10">07-19-2009</div></td>'; echo '</tr>'; echo '</table>'; echo '</li>'; ?>
  9. this may be easier. here is the click function that opens and closes my menu options function clicked(element) { var div=document.getElementById(element) if(div.style.display=='none') div.style.display='block'; else div.style.display='none'; return; } When the page loads, all the menu options are expanded. Then when clicked upon they will close, so couldn't i just use a few lines of the function above to create a new function that keeps the menu closed on page load?
  10. function closeTable(second) { var oTable = document.getElementById(second); oTable.style.display = 'none'; } <body onload ="closeTable(second)"> Nothing happens. Am i doing something wrong with the id of the table?
  11. I found this script online for hiding the divs. function closeall() { var divs=document.getElementsByTagName('div') for(var i=0; i<divs.length; i++) divs[i].style.display='none'; } What I'm looking to do is tweak it a bit so it doesn't close all the divs, actually not a div at all, a table with the id of "second". Could this function be modified a little or should I start over with a new function?
  12. knowing that the php is good is a start, i guess i will post this in a different section. but which one. let me know what is wrong so i can put this somewhere else, thanks.
  13. Basically, this is what I have, the 3 echoed lines, the last 2 columns work just fine in my table. But the 1st column, the CSS style won't apply to my text ( $row['item_name'] ) Is this something minor? .style10 { color: #000000; font-weight: bold; text-decoration: none; } <?php echo '<td width="388"><span class="style10"><a href="#" onclick="clicked(\'' . $row ['item_name'] . '\')">' . $row['item_name'] . '</a></span></td> '; echo '<td width="110"><div align="center" class="style10">55</div></td>'; echo '<td width="131"><div align="center" class="style10">07-19-2009</div></td>'; ?>
  14. my span class wont take affect when this line is echoed out. Anyone? <?php echo ' <span class="style9"><a href="#" onclick="clicked(\'' . $row['item_name'] . '\')">' . $row['item_name'] . '</a></span>'; ?>
  15. bump, Spent a good part of the night trying to figure this out. I'm stumped. <?php echo '<a href="#" onclick="clicked(' . $row['item_name'] . ')">' . $row['item_name'] . '</a>'; ?>
  16. Set your page up so there is a form to fill out, so you can enter in the email to whom you wish to send it to. Then have a submit button, so when clicked, the mail function is called and it grabs your vars from the form.
  17. This is what i use. Hope it helps. <?php $to = 'whoever'; $subject = 'whatever'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: you@you.com' ; $message = 'blah blah blah'; mail($to, $subject, $message, $headers); ?>
  18. Here is all the code again. function clicked(element) { var div=document.getElementById(element) if(div.style.display=='none') div.style.display='block'; else div.style.display='none'; return; } <?php echo 'My'; echo '<div id="My">'; while ($row = mysql_fetch_array($sql)) { ?> <div id="trade"> <li> <?php echo '<a href="#" onclick="clicked(' . $row['item_name'] . ')">' . $row['item_name'] . '</a>'; ?> </li> <div id="item name"> <?php echo '<img src="' . $row['thumb_1'] . '" width="100" alt="" />'; ?> </div> </div> <?php } echo "</div>"; ?>
  19. ok, maybe it is not working, sorry guys. here is the problem, again. this works, meaning my function works <a href="#" onclick="clicked('name')">name</a> but for the name i want to pull it from the db, which is not correctly executed below. <?php echo '<a href="#" onclick="clicked(' . $row['item_name'] . ')">' . $row['item_name'] . '</a>'; ?> Anyone?
  20. <SCRIPT TYPE="text/javascript"> function closeall() { var divs=document.getElementsByTagName('div') for(var i=0; i<divs.length; i++) divs[i].style.display='none'; } function clicked(element) { var div=document.getElementById(element) if(div.style.display=='none') div.style.display='block'; else div.style.display='none'; return; } </script> <?php echo 'My'; echo '<div id="My">'; while ($row = mysql_fetch_array($sql)) { ?> <div id="trade"> <li> <?php echo '<a href="#" onclick="clicked(' . $row['item_name'] . ')">' . $row['item_name'] . '</a>'; ?> </li> <li> <?php echo '<img src="' . $row['thumb_1'] . '" width="100" alt="" />'; ?> </li> </div> <?php } echo "</div>"; ?> found some functions online that work great for a tree menu, but when i have a little php in with the menu (so i can pull info from db) it seems to throw off the javascript functions. Can you see what is wrong? I'm guessing that the js cannot be inside the php like that.
×
×
  • 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.