-
Posts
2,527 -
Joined
-
Last visited
Everything posted by DeanWhitehouse
-
If you want it updated automatically , without reloading the page, you will need ajax
-
can i ask why you are removing 0's and then wanting to put them back?
-
session_register("myusername"); session_register("mypassword"); that is depriciated i think change to $_SESSION[''] = ;
-
[SOLVED] Help with second part of script
DeanWhitehouse replied to Xtremer360's topic in PHP Coding Help
What?? that didnt make any sense -
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>
-
[SOLVED] Hoe to assign an Array to a Session?
DeanWhitehouse replied to Solarpitch's topic in PHP Coding Help
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) -
Soz, that wasnt the prob,it was because the person has another CSS for the print and it mucks it up.
-
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?
-
How can i display the photo for the photo album ?
DeanWhitehouse replied to Rommeo's topic in PHP Coding Help
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. -
How can i display the photo for the photo album ?
DeanWhitehouse replied to Rommeo's topic in PHP Coding Help
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 } -
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
-
that is what it says,
-
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); ?>
-
Ok, awesome thanks,
-
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.
-
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?
-
PHP Session not always being recognized
DeanWhitehouse replied to woody79's topic in PHP Coding Help
Ok, so that means the session start is always there, have you checked if the session is there try session_start(); echo $_SESSION['maxinfo']; -
PHP Session not always being recognized
DeanWhitehouse replied to woody79's topic in PHP Coding Help
echo session_id(); under session_start(); and check if that shows all ten times. -
DW u reported it?
-
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
-
Have u researched this, have a look at the LIKE clause in mysql
-
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
-
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?
-
Can you stop bumping this thread, while waiting for a reply please look on google and/or try and work it out yourself.