Jump to content

pwntastic

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by pwntastic

  1. i did and it doesn't do anything...it just displays the gray box and the lines O.o if i echo out the imagejpeg() then it will not show the image...i even declared the session inside this file and it still doesn't do anything O.o...it's working fine on my local machine just not on this hosted site im really lost on this one
  2. what you can do is make it submit to itself by leaving action blank, inserting your php code at the top of the page where the form is...make sure you add an if() to make sure that it executes when the form is submitted...then under your mail() just echo your thankyou message and then stop the browser with die() after you've echoed out the message
  3. Hello i have some code which is suppose to create a simple captcha image...the code was working fine until it was moved from one location to another...now what it does is the image is created...but for some reason, it's not displaying the text. Here is my code : <?php session_start(); $image = imagecreate(100, 50); $background = imagecolorallocatealpha($image, 204, 204, 204, 127); $text = imagecolorallocate($image, 0, 0, 0); imagettftext($image, 20, 0, 30, 30, $text, 'Gabriola.ttf', $_SESSION['captcha']); $lines = 20; for($i = 0; $i <= $lines; $i++){ $x1 = rand(1, 100); $y1 = rand(1, 100); $x2 = rand(1, 100); $y2 = rand(1, 100); imageline($image, $x1, $y1, $x2, $y2, $text); } header('content-type: image/jpeg'); imagejpeg($image); ?> this code does create the gray box and displays the 20 lines but no text. when i echo out the $_SESSION['captcha'] on the page it displays the number generated (generated in another file)....i've even replaced that with a string and it doesn't work...the interesting thing about it is that it works on local machine but not on a hosted page...what could possibly cause this?...all the files were changed so the .ttf file is also within the same file as this page
  4. Hello, you have the following query: mysql_query("INSERT INTO Feedbacks (Feedback, From, To, Type,) VALUES ('$feedback', '$from', '$owner','$type')") or die(mysql_error); after Type you put in a comma although there is nothing else after that so it should be something like "SELECT INTO `Feedbacks` (`Feedback`, `From`, `To`, `Type`) VALUES('$feedback', '$from', '$owner', '$type')"
  5. ahh i see...i assumed that setcookie() set the value into the cookie array automatically kinda like setting a session...now i know though lol thanks a lot David
  6. ahh i see i did not know that...i figured out an alternative way but still wanted to know the reason for this problem thanks
  7. Woops i apologize i wrote that just to show the problem my code isnt exatctly like that...the syntax on my code is correct...just getting the problem mentioned above.
  8. Hello, im having a bit of a problem...im running a function which declares a session or cookie depending on if the user wants to be remembered...after they have been set, im trying to run another function which based on the session type, does something else...the thing is that when my function to declare the session type is run if it is session it executes the 2nd function just fine because $_SESSION['whatever'] is declared...when the session type is a cookie though my 2nd function indicates that no session type has been specified...if i refresh then it will say a cookie session has been started...while my 2nd function says that there is no session type specified, if i view cookies with my browser it shows them....is this something to do with the time it takes to set a cookie or why is this happening? heres an example: <?php class test1{ function funct_1(){ //This part will declare session type setcookie or $_SESSION[] = ''; } function funct2(){ $this->funct_1(); if(isset($_SESSION['whatever'])){ echo 'Session has been set'; //this one works fine if user logs in with session die(); }else if($_COOKIE[''whatever]){ echo 'Cookie has been set';//this is displayed when user logs in with cookie...but has to refresh the page in order for this message to //print although cookie does exist if you check the browser... die(); }else{ echo'No session type has been specified';//this is what is printed out when user logs in with cookie at first } } } ?>
×
×
  • 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.