Jump to content

icekat83

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

icekat83's Achievements

Member

Member (2/5)

0

Reputation

  1. A break for dinner (it's 7pm where I am) has made me realise that DUH....of course. Brain dead moment gratefully solved. Thanks guys. IceKat.
  2. I know in this case I can manually put in slashes but with the way the data is coming in I can't always do that so I need an automated version which I would have thought I could have but can't work out. Thanks all..... IceKat.
  3. Hey, I have a variable: 151°06'50"E This variable is giving me massive problems because of the single and double quote marks. PLEASE help me get rid of my damn t_string error! $var = 151°06'50"E; - does not work $var2 = (151°06'50"E); - does not work $var3 = ("151°06'50"E"); - does not work $var4 = ('151°06'50"E'); - does not work $var5 = addslashes("151°06'50"E"); - does not work $var6 = addslashes('151°06'50"E'); - does not work $var7 = mysql_escape_string("151°06'50"E"); - does not work $var8 = mysql_escape_string('151°06'50"E'); - does not work $var9 = htmlspecialchars("151°06'50"E"); - does not work $var10 = htmlspecialchars('151°06'50"E'); - does not work $var11 = urlencode("151°06'50"E"); - does not work $var12 = urlencode('151°06'50"E'); - does not work I've also tried the three functions with the various enclosing quote marks (single and double). I've also tried string replace. At the moment I'll settle for being able to put: echo $var; and NOT have an error. Please help...this error is driving me nuts!!! IceKat.
  4. Hey, I wasn't sure where to post this. I've been coding for a while but still know very little about security. I'm hoping someone can direct me someplace I can learn a bit more about encryption, what SSL is and how it's different to Open SSL, how Open SSL can work (considering what I understand of open source wouldn't that make it more hackable?) and security. I do know the basics. I know about SQL injection, something I try to protect against, and I know you can use the inbuilt MD5 function to encrypt passwords one way (which I do) but that's about it. If people want to post here that's cool but I don't expect that. I'm just hoping for some good info links. And if people can help me work out how to test how secure/insecure my scripts are that would also be awesome. Thanks, IceKat.
  5. Hi, I have a file which contains settings for a user. Similar to wordpress except simpler like setting a default email for error messages or something. The idea is that it's used as an installation script for web-ware where someone fills in a form with their database details, my script will hard-code them into the settings file and then delete itself. I'll admit I did get the idea from wordpress. Only the way it's coded currently requires a certain combination of characters at the end and seems really messy. The script looks like this (and does work): $endpos = strpos ( $contents, '"; //replace with name//', $startpos); The settings file looks like this: $hard_name = "Smith"; //replace with name// As you can see I use the comment in the settings file, which follows what I'm actually changing, to find the end of the variable. I am sure there must be a better way of doing things but don't know what. It just seems really inefficient because if the comment is removed the script breaks. Any info and tips would be much appreciated. IceKat
  6. Hey Guys, Thanks for the help...The font path error is now gone (yea!) but it's been replaced by another issue. I thought the accompanying header error was just a by-product....turns out it's not. I'm using a file with a function (which I posted before). However because the image needs to be displayed after the heading/nav menu etc the code doesn't like it. I can display the image differently of course but that doesn't allow me to hold onto the random number I'm using for the capcha. Can I get the number another way or get around this header issue? I'm not sure if storing the variable number in a session variable will defeat the purpose of having a capcha in the first place. Or are sessions the only other option in this kind of case? Thanks, IceKat.
  7. Hi, I am creating an image with a random number to use as a capcha. I've done the image creation before and had it working but now I have a font path error. However......I know my font path is the same...I didn't change it and it was working perfectly. What I changed was I made the image creation piece of code into a function...so I could return a value and use the function as a capcha....can you not use this image creation stuff in a function? The difficulty is getting hold of the random number to verify someone typed it correctly. If you have any ideas I'm open to other methods. My code is: function capcha(){ $capchatxt = rand(10000,99999); $font = '/includes/balloon.ttf'; $textarray = imagettfbbox(30, 0, $font, $capchatxt); $width = $textarray[2]-$textarray[0]; $height = $textarray[3]-$textarray[7]; $image = imagecreate($width+10,$height+10); $background = imagecolorallocate ($image, 255,227,232); $colour = imagecolorallocate($image, 0, 154, 239); // blue; $pink = imagecolorallocate($image, 239, 0, 144); // crimson pink; $peach = imagecolorallocate($image, 255, 227, 232); // pale pink; // Add the text imagettftext($image, 30, 0, 5, $height+5, $pink, $font, $capchatxt); header('Content-type: image/png'); imagepng($image); imagedestroy($image); return $capchatxt; } At the moment: The function and the font file are in the same folder. The file which is calling the function is in a different folder. BTW - Forgot to mention that right now I'm using localhost (xampp)...not a real server. Thanks for the help. IceKat
  8. Yes but JavaScript can be disabled. How do website statistics robots (like google analytics) do it? They get location and stuff which is basically what I need. I don't want to invade privacy or anything, just be able to automatically alter times for web viewers.
  9. Hey, I'm trying to code a page which is supposed to bring up the time of a person's computer. Is this possible without majorly complicated coding? I'm good with GMT offsets and stuff but I don't know how to get the time of a person's computer. I don't want other stuff, just the time so I can edit the time based on where they are. I don't know if I'm making sense so here's an example... If someone does a forum post at 2pm Sydney time but it's 5pm Perth time. How can I make it so that someone in Perth sees 5pm but someone in Sydney sees 2pm...without them manually telling me their timezone? I read about using IP addresses but don't know much (Ok anything) about this , any hints or good sites to view would be appreciated? Or the answer if it's not too complex. Preferably I'd like to get the time in the 11 digit "time()" format so I can use it in tables and translate it with an existing function. IceKat
  10. Hey, Trying to learn to generate PDF files, something apparently WAAAAYYY more complex than I thought. Can someone please give me an explanation on '$optlist' from this function..... PDF_load_image ( resource $pdfdoc , string $imagetype , string $filename , string $optlist ) What is it? PHP.net doesn't have any info at all. Thanks, IceKat. BTW - Any (recent) tutorials or pages would be appreciated. Everything I find is out of date or doesn't work.
×
×
  • 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.