Jump to content

epseix

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

epseix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. And possibly what to google for future reference...
  2. I have tried to google this, however I can't seem to find an answer (it might just be the way I'm describing it in search engine). I have numerous MySQL queries throughout my website. I had considered creating a separate php file with all queries (for easy-editing, if needed) and including it on every page and then calling the required query from while loop onwards etc. However, this MAY result in slower loading time - I don't know... I have also read about the possibility of using functions to call required query, but I don't understand what this means, let alone know how to code this. Can someone please advise me of "best practice" solution for my particular issue? Thanks!
  3. Bit confused here... Have the following form which allows me to enter a search term, define the table (tbl) from which to search and limit of results, however I also need to define an anchor tag at the end of the url which matches the tbl. eg. <div class="b2"> <form action="/admin/home.php" method="GET"> <div class="row"> <input name="search" size="19" type="text" value=""> </div> <div class="row"> <select name="tbl"> <option selected>blog</option> <option>book_me</option> <option>comments</option> <option>events</option> <option>faq</option> <option>links</option> <option>workshops</option> </select> </div> <div class="row"> <select name="limit"> <option selected>50</option> <option>100</option> <option>250</option> <option>500</option> <option>1000</option> <option value="">All</option> </select> </div> <div class="row"><input class="submit" type="submit" value="Go!"></div> </form> </div> This code will produce: /admin/home.php?search=&tbl=blog&limit=50 ...wheras I need it to produce... /admin/home.php?search=&tbl=blog&limit=50#blog OR /admin/home.php?search=&tbl=events&limit=50#events OR /admin/home.php?search=&tbl=workshops&limit=50#workshops etc. Any ideas?
  4. Hi everyone. I'm struggling to figure this one out and hope someone can help. I completely understand the principles of this function - however - I am using pre-defined strings and entering them into a database. For some reason whenever there is a single quote, the pre-defined string uses &#39; instead of &#039; I am trying to parse this, decode the string, and use htmlspecialchars function to convert it and enter into my database, however htmlspecialchars_decode does not seem to recognise &#39; - only the likes of " and & In order to convert: Sam&#39;s House -> Sam's House -> Sam&#039;s House I have tried using: $str = "Sam&#39;s house"; $str = htmlspecialchars_decode($str); $new = htmlspecialchars($str, ENT_QUOTES); However, this returns: Sam&#39;s House. The decoding function seems to fail. any ideas? Much appreciated in advance!
×
×
  • 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.