Jump to content

Janice

Members
  • Posts

    20
  • Joined

  • Last visited

Posts posted by Janice

    stats

    i have created a page like this.. i dont use any database for this..actually it is a form page followed by a stats box. when someone enter the form, it should add 1 extra number of members in stats and when someone enter total work(1000), it should be added in the stats aswell.sampleiy4.png

  1. I have another doubt..Email ID:</b><input type="text" name="email" size="20" />this will give output with a box for email id to be entered..how to make it show without a box?

  2. This is the error message:It can't create the image file to write to. Either it would not have permission to do this or the path is incorrect, if permissions were the problem I think it would specify that. I suspect the path because it might be trying to open a file in a folder called images inside the include folder, and I'm thinking the images and include folders are parallel, not nested. There is a function in the captcha class called get_filename that looks like this:
    function get_filename($public="") {	  if ($public=="")		$public=$this->public_key;	  return "images/".$public.".".$this->imagetype;	}

    Change this function to return the absolute path instead of a relative path. That would make it like this:

    function get_filename($public="") {	  if ($public=="")		$public=$this->public_key;	  return "/home/megax/public_html/images/".$public.".".$this->imagetype;	}

    Reply back if that works.

    thanks alot justsomeguy .. you are always informative..it worked fine when I set 777 permissions to "images" folder but I know it is not safe!I will try your codings and let you know
  3. functions.php

    <?phpfunction standardheader($title) {?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xtml" xml:lang="en" lang="en"><head>   <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />   <title><?php echo $title; ?></title></head><body><?php}function stdfoot() {?></body><html><?php}  class ocr_captcha {    var $key;       // ultra private static text    var $long;      // size of text    var $lx;        // width of picture    var $ly;        // height of picture    var $nb_noise;  // nb of background noisy characters    var $filename;  // file of captcha picture stored on disk    var $imagetype="png"; // can also be "png";    var $public_key;    // public key    var $font_file="./include/adlibn.ttf";    function ocr_captcha($long=6,$lx=120,$ly=30,$nb_noise=25) {      $this->key=md5("A nicely little text to stay private and use for generate private key");      $this->long=$long;      $this->lx=$lx;      $this->ly=$ly;      $this->nb_noise=$nb_noise;      $this->public_key=substr(md5(uniqid(rand(),true)),0,$this->long); // generate public key with entropy    }    function get_filename($public="") {      if ($public=="")        $public=$this->public_key;      return "images/".$public.".".$this->imagetype;    }    // generate the private text coming from the public text, using $this->key (not to be public!!), all you have to do is here to change the algorithm    function generate_private($public="") {      if ($public=="")        $public=$this->public_key;      return substr(md5($this->key.$public),16-$this->long/2,$this->long);    }    // check if the public text is link to the private text    function check_captcha($public,$private) {      // when check, destroy picture on disk      if (file_exists($this->get_filename($public)))        unlink($this->get_filename($public));      return (strtolower($private)==strtolower($this->generate_private($public)));    }    // display a captcha picture with private text and return the public text    function make_captcha($noise=true) {      $private_key = $this->generate_private();      $image = imagecreatetruecolor($this->lx,$this->ly);      $back=ImageColorAllocate($image,intval(rand(224,255)),intval(rand(224,255)),intval(rand(224,255)));      ImageFilledRectangle($image,0,0,$this->lx,$this->ly,$back);      if ($noise) { // rand characters in background with random position, angle, color        for ($i=0;$i<$this->nb_noise;$i++) {          $size=intval(rand(6,14));          $angle=intval(rand(0,360));          $x=intval(rand(10,$this->lx-10));          $y=intval(rand(0,$this->ly-5));          $color=imagecolorallocate($image,intval(rand(160,224)),intval(rand(160,224)),intval(rand(160,224)));          $text=chr(intval(rand(45,250)));          ImageTTFText ($image,$size,$angle,$x,$y,$color,$this->font_file,$text);        }      }      else { // random grid color        for ($i=0;$i<$this->lx;$i+=10) {          $color=imagecolorallocate($image,intval(rand(160,224)),intval(rand(160,224)),intval(rand(160,224)));          imageline($image,$i,0,$i,$this->ly,$color);        }        for ($i=0;$i<$this->ly;$i+=10) {          $color=imagecolorallocate($image,intval(rand(160,224)),intval(rand(160,224)),intval(rand(160,224)));          imageline($image,0,$i,$this->lx,$i,$color);        }      }      // private text to read      for ($i=0,$x=5; $i<$this->long;$i++) {        $r=intval(rand(0,128));        $g=intval(rand(0,128));        $b=intval(rand(0,128));        $color = ImageColorAllocate($image, $r,$g,$;        $shadow= ImageColorAllocate($image, $r+128, $g+128, $b+128);        $size=intval(rand(12,17));        $angle=intval(rand(-30,30));        $text=strtoupper(substr($private_key,$i,1));        ImageTTFText($image,$size,$angle,$x+2,26,$shadow,$this->font_file,$text);        ImageTTFText($image,$size,$angle,$x,24,$color,$this->font_file,$text);        $x+=$size+2;      }      if ($this->imagetype=="jpg")        imagejpeg($image, $this->get_filename(), 100);      else        imagepng($image, $this->get_filename());      ImageDestroy($image);    }    function display_captcha($noise=true) {      $this->make_captcha($noise);      $res="<input type=hidden name='public_key' value='".$this->public_key."'>\n";            $res.="<img align=middle src='".$this->get_filename()."' border='0'>\n";      return $res;    }  }?>

  4. I have a php verification / landing verification / image verification page. It worked fine before,Now i get this error after uploading and I dont see the image.Warning: imagepng() [function.imagepng]: Unable to open 'images/b804e0.png' for writing in /home/megax/public_html/include/functions.php on line 114What would be wrong?

  5. Here's an good example for starter: http://www.weberdev.com/get_example-3913.html(Just google on "php image code generate" or "php image validation generate" or something like that)And instead of just rand(0,9) for just numbers, in the example, you can use chr():
    ...// Get one random number$rand = rand( 54, 116 );// If it's less than 65 it's an number (0-9)if ($rand < 65)	// Get the right ASCII	$rand = 48 + ($rand - 54);// If it's more than 90 (uppercase: A-Z)else if ($rand > 90)   // Get the right ASCII   $rand = $rand + 6;$str .= chr( $rand ). " ";...

    Isn't the best or most clear code perhaps, but it should generate a random character (0-9, a-z or A-Z).

    Since I am a newbie, I dont understand this :)
  6. hi all,i would like to know how to create a validation first page. something like the one in http://football2gold.comUser must enter a validation code (any number or alphabets) to enter the site.Since I am new to php, I would like to get a detailed answer with codings.Hope someone could help me, as this forum is the best place for learners :)

  7. Yu could passwordprotect all pages ore add a visual confirmation function, however I doubt this will do anything against a DDOS sinds it will still connect to your server and eat your badwith the only affect possibly is that they can't go for your biggest file instantly.Ruud Hermans
    How to add visual confirmation page? Something like, when someone goes to www.example.com, they will see any random numbers like turing numbers to enter to index page.
  8. Hello everyone, Hope you all fine here. I am in need of a help. Anyone know how to add a DDOS protection first page for a website? Something like typing a code to enter the website?I would be glad to get a detailed explanation for this with codings.Thanks alot. I always get excellent help here.Long Live w3 forum members :)

    Help

    Okay. You would have the form send data to redirect.php and method would be GET. you also need to have the input box named "username".Its quite simple. Redirect.php gets the data from the form and takes the user to [username input].php using the header() function.
    It works just fine..Thank yall

    Help

    you could have a page called redirect.php, which you send the info from the form to in GET, which then redirects to [input_username].phpredirect.php would look something like this:<?php$username = $_GET['username'];header( "Location:$username.php" );?>I think. im also in a bit of a hurry, so that might not work
    This aint work. I would like to get some more explanation. Please

    Help

    uhm.. the form isnt that hard to do:
    <form method="post" action="username.php"><input type="text" name="username"/><br/><input type="submit" name="submit" value="GO!"/></form>

    But what i dont get is if you want it to go to the page of the inputted username, or if you just want it to go to username.php...More explaining please.

    Hi,Thanks alot for your help! It should go to the inputted username (inputted username.php)

    Help

    Hi,This really is the best place to get infos. Thanks alot for that. I would like to thank justsomeguy for his excellent helping tendency.I am looking for something. User : username (box) SubmitWhen someone clicks submit, it should go to www.site.com/username.phpIs it possible to make something like this? I would be real glad if someone help me with this.Also, I would like to know how to make a scrolling text box, something like News Box that should scroll up automatically.Thank you guys.

  9. Thanks much for your reply. I bought this flash template Readymade. They gave me the .fla file too though.I dunno much about flash. Since it is a readymade template, I can edit the content of the flash template. I didnt know I have to edit flash source file to get this action to be done. :) The output is a single flash page (index.html or php) and I have added a link in that flash page that goes to signup.php (which is not a flash page and it is a different HTML page, no relation between index flash page and signup form page)So, no other way I can add a ref like I said before other than this?

    CODEif(isset($_GET['ref'])){//do whatever to add the referal to registering}
    I dont know this. I would be very happy if you give me more details. Where and how to add this code?
  10. I am very glad to be a member in this forum. I hope I would find a solution for my need here :)I know nothing about flash, so please dont mistake me if this is a dumb question :)Well I have a flash template. I use a link there for signup (signup.php)It opens to a new page - http://sitename.com/signup.php.Signup form contains details like -username :state:country: ....these details are sent to my mail when someone signup. What I need is.. I wish to add a referral system. Something like http://sitename.com/?ref=*somenumbers*So when someone uses this referral URL and click the signup link, I need this option in signup form Referrerd by *123* and this referral detail asusual sent to my email when someone signup along with the signup form details (name, state, country ... and Referred by *123*)I dont want to use database here because I am not sure how to handle databases. The index flash page I will use is index.phpI would be reallllllllll flad if someone help me with this with a detailed code.Advance thanks...Janice

×
×
  • Create New...