Jump to content

chawezul

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

About chawezul

  • Birthday 03/25/1989

Contact Methods

  • AIM
    ninJaweezul
  • Website URL
    http://magarthkia.netrulon.com
  • Yahoo
    chawezul

Profile Information

  • Gender
    Not Telling
  • Location
    Somewhere, for sure

chawezul's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php //header ("Content-type: image/png"); $img_handle = ImageCreate (230, 20) or die ("Cannot Create image"); $back_color = ImageColorAllocate ($img_handle, 0, 10, 10); $txt_color = ImageColorAllocate ($img_handle, 233, 114, 191); ImageString ($img_handle, 31, 5, 5, "My first Program with GD", $txt_color); //ImagePng ($img_handle); ?> Run this and see if there is any output in the page source. You may have a built-in function that runs before everything else in PHP.
  2. If a variable number or records may be added into the database (ie, 3 or 4 or 2 or 1 are all acceptable), I would recommend imploding all of the records together into one string and keeping them in one database field, then exploding them back into seperate records when you take them out of the database. That's how my blogs handle tags, it works very well with variable amounts of input.
  3. Make your script print() or echo() your query string out to you, then paste it into PhpMyAdmin or similar and see if it yields any errors or hints.
  4. <?php function longest($str) { $ar = explode(" ", $str); $ln = $ar[0]; for($i=0; $i < count($ar); $i++) { if (strlen($ar[$i]) > strlen($ln)) { $ln = $ar[$i]; } } return $ln; } ?> Arrays ARE quick and easy.
  5. Your query is sound and it worked on my system. Perhaps you didn't select a database with mysql_select_db() ? Also you can try to see if $cat gets deleted or set to "" at any point.
  6. Err in the new code you also don't have quotations around ${name}
  7. Does that new page have the values in the query string? You could possibly go <script type="text/javascript"> var cname = <?php echo $_GET["cname"]; ?>; </script>
  8. Ah Check your Javascript console to make sure you're not sending: passvar(1, 3, name ,this); Because in that name is a constant! Try: <?php echo "<tr id=\"action\" title=\"Click to display sites below\" onclick=\"passvar(${pageNum}, ${id}, '${name}', this );\">"; ?> thanks! <ins>By the way, in that case the error you would get is: Variable 'name' is undefined in ... on line ...</ins>
  9. I don't know much about Regex, but I would go about using explode() with the ", " to break it into an array, then loop through it and echo <option id="${exploded[$i]}" />
  10. Can you supply more of the code? From what I've seen it should be working perfectly, there's gotta be something interfering with $name that I can't see.
  11. If you get have a PHP file that gets the image form the database then echo()'s it out, you can put header("Content-type: image/gif"); at the end to have it sent as an image (in this case gif), from there you can embed it in your HTML page with your basic img tag
  12. You can use <del>single</del> <ins>double</ins> quotes <?php echo "<tr id=\"action\" title=\"Click to display sites below\" onclick=\"passvar(${pageNum}, ${id}, ${name}, this );\">"; ?>
  13. You need to tell PHP which session values to take as well as to set, so You'd go session_start(); session_register("idstud"); session_register() will "tell" the computer that you are going to allow reading and writing of a session value of whatever you input. Otherwise it doesn't know that. After that you can set and access it from the public field $_SESSION["idstud"]; Hope that helps
  14. You can also use parse_str() on $_SERVER["QUERY_STRING"] for a register globals effect, getting the query string is generally easy if you're only passing one value to the script, but if you're using it with parse_str it's frowned upon and begs for injection.
×
×
  • 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.