Search results

  1. mephis

    [PHP] CodeIgniter Help

    Assuming the session library is loaded and you're only having issues accessing the session variable "username": do you have cookies enabled on your test browser? CodeIgniter's developers have decided to use cookies to store CI's session variables (don't ask me why!). I personally prefer to...
  2. mephis

    Iframe filtering

    I had a similar problem this week... I decided the best way was to cURL the iframe page, store the html in a variable and just parse it to remove/retrieve the bits of HTML before putting them on my page (I did it through AJAX, but I'm sure you don't necessarily have to) Although I'm sure you can...
  3. mephis

    Change image on Same PHP page

    you'll need to use javascript to do that. example: <div id="main_image"> <img id="my_image" src="image1.jpg" /> </div> <div id="thumbs"> <img src="thumb2.jpg" onClick="change_image('image2.jpg')" /> <img src="thumb3.jpg" onClick="change_image('image3.jpg')" /> <img...
  4. mephis

    DirectX, OpenGL or SDL?

    I would personally go for SDL. It's a graphics/sound/network API and it is cross-platform. Even if you're only planning on developing for windows (at the moment), if you ever decide to expand to other OS'es it would be easier to just recompile for the target systems than to change the code...
  5. mephis

    php mysql help

    try changin this line: while($results = mysql_fetch_array($result)) to this: while($results = mysql_fetch_assoc($result))
  6. mephis

    [php] Help with a parsing program

    I believe he wants to parse HTML code to extract certain information in that code. I would suggest using preg_match() or maybe a combination of strpos()/substr() to extract that information. If you want to use preg_match() then you better read up on regular expressions, although in your case I...
  7. mephis

    php in shtml page

    Someone correct me if I'm wrong, but you can make any file type PHP parseable using Add Type. In your case it would be: AddType application/x-httpd-phpv2 .shtml (just replace v2 for the x10hosting PHP version you have: v1=basic, v2=intermediate,...)
  8. mephis

    [PHP] cut off 160 chars

    regarding xPlozion's code, it would be faster to use a builtin php function instead of iterating: // instead of iterating like this while (($string{$length} != " ") AND ($length > 0)) { $length--; } // call strrpos() function which returns // the last occurrence of " " in $string...
  9. mephis

    PHP help with mysql please

    not a problem... glad I could help :) (and yes, it can be *very* frustrating sometimes)
  10. mephis

    PHP help with mysql please

    hmmmm... I think that if you want to access the $row elements by their field name you need to use mysql_fetch_assoc() instead of mysql_fetch_row(). mysql_fetch_row() returns an indexed array, whereas mysql_fetch_assoc() returns an associative array. read this...
  11. mephis

    PHP help with mysql please

    nope, xplozion got it right the first time: you can't call an array element directly from within a string. you have to concatenate the array element like xplozion said. alternatively, you can just use: "{$row['userid']}" summarizing: // sample variables $a = 1; $b['id'] = 1...
  12. mephis

    Login Form Help

    well, after the if clause you're using ( instead of { and also closing with ) instead of } replace that, fix line 10 and you should be OK: if($count == "1") { session_register("loggedin"); header("location: check.php"); } else { echo "Could no log you in."; }
  13. mephis

    Contact over msn to help fix my problem

    try changing your SQL statement to this: mysql_query("INSERT INTO `pages` (`title`, `blurb`) VALUES ('$title', '$blurb') WHERE `pages_id` = '0'"); use ` around table/field names and ' around the data you're inserting
  14. mephis

    Too Many Cookies!

    I'm assuming the storing of stats is only while the user is playing, which makes sense because cookie data is quicker to access than making a db query. but even so, why not use $_SESSION vars instead? have a read here about the pros and cons of cookies/sessions...
  15. mephis

    Too Many Cookies!

    from the CodeIgniter user guide: "Cookies can only hold 4KB of data, so be careful not to exceed the capacity." side note: just exactly how much information were you storing on your cookies?!? 4kb is plenty :P
  16. mephis


    Well, if you are using ubuntu: System -> Administration -> Services should list one or more mysql entries, just untick them
  17. mephis

    I can't retrieve info from db to display on page??

    Two things could be wrong here: 1) Like Livewire said: is $id set, and if so, what is it set to? If it's set to an INT then it's fine, if not: $query = "SELECT * FROM pages WHERE pages_id='$id'"; (notice the single quotes around $id) 2) I assume you are making the connection to your...
  18. mephis

    Need text editting script

    I see... someone else was asking that,go here:
  19. mephis

    Site not working in IE.

    np, glad I could help
  20. mephis

    MYSQL - backend admin enter blurb in textarea to display on front end

    doing the dropdown list: $result = mysql_query("SELECT * FROM `pages`"); echo "<select>"; while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"{$row['pages_id']}\">{$row['pagename']}</option>"; } echo "</select>"; making the select list dynamic would probably be best done...