Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by HuggieBear

  1. My bad... I put the wrong values in the php if condition [code] <?php   $engine = urlencode($_GET['engine']);   $string = urlencode($_GET['string']);   if ($engine == "Google.com"){       $url = "http://www.google.com/search?q=$string";   }   elseif ($engine == "Yahoo.com"){       $url = "http://search.yahoo.com/search?p=$string";   }   header("Location: $url"); ?> [/code] Regards Rich
  2. No problem my friend, no problem at all. Rich
  3. I'm determined to get this sorted for you... Forget all the previous stuff, lets go from scratch as it's all very confusing. [code] <?php   // Get the parameters from the URL   $id = $_GET['id']   $page = isset($_GET['page']) ? $_GET['page'] : '1'; // if '&page=n' (n is a number) is in the url use it, if not, default to page=1   // The following assumes that you have a user_id column in your pages table, and the columns are called 'content', 'page_id' and 'user_id'   $sql = "SELECT content FROM pages WHERE page_id = '$page' AND user_id = '$id'";   $result = mysql_query($sql);   // We should only have one row returned, so mysql_fetch_row should be fine here   $content = mysql_fetch_row($result);   // Check we found a page with the page_id that was given to us and output accordingly   if ($content){       echo $content[0];   else {       echo "No record was found for Page ID $page";   } ?> [/code] Now this is assuming quite a lot, but this simple bit of code should work fine and you should be able to build whatever you need around it. Regards Rich
  4. No problem, Didn't really help much though  ;D Regards Rich
  5. Why not have something like this... HTML Page (Not sure the syntax is exact): [code] <form name="search" method="GET" action="search.php"> <select name="engine">   <option name="google">Google.com</option>   <option name="yahoo">Yahoo.com</option> </select> <input type="text" name="string"> </form> [/code] This calls search.php which looks like this [code] <?php   $engine = urlencode($_GET['engine']);   $string = urlencode($_GET['string']);   if ($engine == "google"){       $url = "http://www.google.com/search?q=$string";   }   elseif ($engine == "yahoo"){       $url = "http://search.yahoo.com/search?p=$string";   }   header("Location: $url"); ?>[/code] Should work a treat. Regards Rich
  6. You could pass it in the url... So have the code from the db generate links like this... [code] <a href="reviews.php?id=1">Product 1</a> <a href="reviews.php?id=2">Product 2</a> [/code] Then have you next page (reviews.php) do another select from the database based on the $_GET['id']and propogate the forms accordingly. Regards Rich
  7. I think we should put the 'Warez' issues behind us for now, and maybe Hansman will think twice before posting content like that again.. Benefit of the doubt time... OK, so what do you mean by header? Rich
  8. I've just noticed something... If the code that you've included is all you have you're missing something massive... [code=php:0] <?php   session_start(); // this must be specified at the top if you're referring to a $_SESSION variable. ?> [/code] Regards Rich
  9. I was going to say that, but wanted to go one step at a time  ;D Cheers Roopert
  10. Have you tried running this in something like phpMyAdmin?  If so, the sql statement returned results you're looking for? Just trying to work out if it's SQL or PHP. Rich [color=red]Edit: Also, if you echo things out as you go, it's a good way to diagnose.[/color]
  11. Remove the curley braces { } from around $page in your SQL statement. Rich
  12. Makes sense now.... [code] <?php   $page = isset($_GET['page']) ? $_GET['page'] : '1'; // if $_GET['page'] is set then assign it to the variable $page, else assign '1' ?> [/code] Try that at the top of your code. Rich
  13. Oh, if you're print from the php, you need to escape the quotes... try this: [code=php:0] <?php echo "<img src=\"http://www.domain.com/uploads/Image/flags.jpg\" alt=\"description of image\">"; ?> [/code] If that doesn't work, post the code you have. Regards Rich
  14. Try this... [code] $query = "select * from call_reminder WHERE date(date) >= '$todays_date' AND date(date) <= '$max_date' AND level <= '$show->level') OR (member_group = '$show->mastermind' AND call = 'mastermind') ORDER by date, time"; [/code] If that doesn't work, then post your code as previously suggested. Rich
  15. Get rid of the </img> tag... Try: [code] <img src="http://www.domain.com/uploads/Image/flags.jpg" alt="description of image" /> [/code] Regards Rich
  16. More of an html question really... Use Meta-Refresh or Javascript. Google is your friend  :D Regards Rich
  17. Your date column is of type 'date' in the database is it? Regards Rich
  18. Try setting the session variable of 'userlevel' once a user's logged in and then use this... [code] <?php if ((!isset($_SESSION['userlevel'])) || ($_SESSION['userlevel'] <= 5)){ // if the session's not set, or if it's less than or equal to 5   header("Location: index.php"); // forward them to our homepage } ?> [/code] Regards Rich
  19. That code's not quite right... [code] if(!isset($session['userlevel'])=>5){ echo "<center><font face='Verdana' size='2' color=red>Sorry, you don't have sufficent access rights to use this page </font></center>"; exit; [/code] Notice the [b][color=red]![/color][/b] before the isset()... That means negative, so in essence you're saying "if the session isn't set, and is greater than 5"... That will always evaluate to false, as something that has no value can never be greater than 5. Regards Rich
  20. Nicklas... why the parenthesis arount the first 's'? You don't want to match it, and it's not being user for alternation. Surely [color=green][tt]https?[/tt][/color] says match [color=red][tt]http[/tt][/color] and an optional [color=red][tt]s[/tt][/color] Regards Rich
  21. Here's an idea, can we see your code and an example record from the DB? Rich
  22. ok, here's a shorter version... might achieve what you're after. [code=php:0] <?php $string = "HereĀ“s a string  https://mysite.com with a link to www.somesite.com bla bla"; echo preg_replace('/(https?:\/\/)?(www\.)?([^\s]+)/', '\\3', $string); ?> [/code] Also, there's another problem with your code wildteen88.. what about if my domain's http://www.ilovethewww.com ? What's going to happen then  ;) Regards Rich
  23. Here's the output I get, agrees with brown2005... www.somesite.com -> somesite.com http://www.somesite.com -> somesite.com http://somesite.com -> http://somesite.com Regards Rich
  • 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.