Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. If you want it updated automatically , without reloading the page, you will need ajax
  2. can i ask why you are removing 0's and then wanting to put them back?
  3. session_register("myusername"); session_register("mypassword"); that is depriciated i think change to $_SESSION[''] = ;
  4. ok, heres the button <?php if (isset($_POST['create'])) { //create cookie here } ?> <form method="post" action=""> <input type="submit" value="Create Cookie" name="create"> </form>
  5. you need session start at the top of the page , and i think this $_SESSION['rows'][] = $_POST['rows']; should be $_SESSION['rows'] = $_POST['rows']; edit (kenrbnsn got there first)
  6. Soz, that wasnt the prob,it was because the person has another CSS for the print and it mucks it up.
  7. Ok, another problem , how can i save the created image? or something because when i print the page , the image isnt there and i need it to be , any ideas?
  8. I think by storing the image as u are is causing you alot of extra hassle , i store the whole extension e.g. image.jpg then just call that .And yes i think you will need multiple loops for the information.
  9. try $sql = query; //put ure mysql query here while($rows = mysql_fetch_assoc($sql)) { ?> <img src="<?php echo $rows['place']."_".$rows['size']."_".$rows['number'].".jpg" ?>"> <?php }
  10. update on the code <?php // Set the content-type header("Content-type: image/png"); // Create the image $imgname = "discount.jpg"; $im = imagecreatefromjpeg($imgname); $tc = imagecolorallocate($im, 0, 0, 0); // The text to draw $text = 'Testing...'; // Replace path by your own font path $font = 'arial.ttf'; // Add the text imagettftext($im, 20, 0, 10, 20, $tc, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?> still getting error though Solved now ,it was the shadow bit
  11. this code doesnt work i get an error message saying there is an error. <?php // Set the content-type header("Content-type: image/png"); // Create the image $im = imagecreatefromjpeg($imgname); $tc = imagecolorallocate($im, 0, 0, 0); // The text to draw $text = 'Testing...'; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagettftext($im, 20, 0, 11, 21, $grey, $font, $text); // Add the text imagettftext($im, 20, 0, 10, 20, $tc, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?>
  12. hmm, do you know where i can get ariel.ttf? or any other fonts, i was hoping to do it without having to download them.
  13. I have this code <?php /* put ONLY this code into a file called image.php put a image called "myimage.jpg" info the same folder then open image.php */ if(isset($_GET['date'])) { $date = $_GET['date']; $first = $_GET['first']; $last = $_GET['last']; $id = $_GET['id']; $pfirst = $_GET['pfirst']; $plast = $_GET['plast']; $imgname = "discount.jpg"; $im = imagecreatefromjpeg($imgname); $tc = imagecolorallocate($im, 0, 0, 0); //imagestring($im, 1, 5, 5, "Details", $tc); imagestring($im,5,50,100,"Date:".$date,$tc); header("Content-Type: image/jpeg"); imagejpeg($im); } ?> and the image is produced fine, but the font style looks horrible, and from what i read on the PHP manual you need to upload a font file to change it , is there a way i can just use a font e.g. ariel?
  14. Ok, so that means the session start is always there, have you checked if the session is there try session_start(); echo $_SESSION['maxinfo'];
  15. can i ask , do you know HTML?? this is basic stuff <html> <body> texttexttext <img src="imagelink.jpg" alt="Image missing" /> //or the php way <img src="<?php echo "imagelink.jpg"; ?>" alt="Image missing" /> </body> </html>
  16. echo session_id(); under session_start(); and check if that shows all ten times.
  17. Ok thanks for that , i don't get what the params are for though, and what they are. but i will test with this , also i didnt try googling ,i like to keep you on ure toes lolz , i will google first next time , and also i posted here because , half the time i never get a reply in the other rooms and because everyone posts JS questions here and doesnt moan so i thought i would
  18. Have u researched this, have a look at the LIKE clause in mysql
  19. Might help if i say what it's for , i would of edited but i am 2late. It will be an ajax shoutbox, bit like a chat box
  20. How do i send post vars using ajax, this is my code function addmessage() { var xmlhttp=createhandler(); xmlhttp.onreadystatechange=function (){ if(xmlhttp.readyState==4) { xmlhttp.onreadystatechange = null; xmlhttp.abort(); } }; xmlhttp.open('POST', 'postchat.php', true); xmlhttp.send(null); return true; } function createmessage() { var button = document.getElementById('post'); if(validatechat()) { if(addmessage()) { button.value='Message Posted'; button.disabled=true; if(shouts()) { return true; } } return false; } return false; } and my php code <form action="javascript:void(0)" onSubmit="return createmessage();" method="post"> <input type="text" id="name" name="name" size="25"><br> Your Message<br> <textarea rows="5" cols="19" id="message"></textarea><br> <input type="submit" value="Post Message" name="postmessage" id="post"> </form> and this is my insert code <?php $db = mysql_connect("host","uname","pword"); $dbsel = mysql_select_db("dbname"); $name = $_POST['name']; mysql_query("INSERT INTO `spearbang_shoutbox` (`id`,`name`,`message`,`ip`,`time`)VALUES ('','$name','test','test','test');") ; ?> But this doesnt insert a name , any help?
  21. Can you stop bumping this thread, while waiting for a reply please look on google and/or try and work it out yourself.
×
×
  • 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.