Jump to content

ap_

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ap_'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. know any other function i can use that no requires formating the image? and thanks for the tip!
  2. im trying to create a uploader class but im havin problems with the file type restrictions. see this! im geting this error: Warning: getimagesize(image/x-png) [function.getimagesize]: failed to open stream: No such file or directory in C:\serverbin\htdocs\under\librarie.class on line 40 index.php <?php include('librarie.class'); print('<form enctype="multipart/form-data" method="POST" action="'.$_SERVER['PHP_SELF'].'">'); print('<input type="file" name="upfile"></input>'); print('<input type="submit" name="upload" value=">>"></input>'); print('</form>'); if(isset($_POST['upload'])){ $cl = new uploader(); $filename = $_FILES['upfile']['name']; $filesize = $_FILES['upfile']['size']; $filetype = $_FILES['upfile']['type']; $cl->filename = $filename; $cl->filesize = $filesize; $cl->filetype = $filetype; $cl->ifempty($filename); $cl->allowsize($filesize); $cl->allowtype($filetype); print $cl->filerename($filename); } ?> uploader.class <?php class uploader{ public $filename; public $filesize; public $filetype; public $random; public $randomname; public $target; public function ifempty($empfile){ $this->filename = $empfile; if(empty($empfile)){ print("<script>alert('select a file');</script>"); exit(); } } public function allowsize($filesz){ $this->filesize = $filesz; if($filesz >= 1024000){ print("<script>alert('wrong file size');</script>"); exit(); }else{ return $filesz; } } public function allowtype($filetp){ $this->filetype = $filetp; if(getimagesize($filetp) == false){ print("<script>alert('wrong file type');</script>"); exit(); }else{ return $filetp; } } public function filerename($randname){ $this->random = $randname; $randname = rand(000,999); $newname = $randname.$this->filename; if(!$newname){ print("<script>alert('can't rename the file');</script>"); exit(); }else{ return $newname; } } public function storefile($file){ $handle = move_uploaded_file($file,$this->target); if($handle == 0){ print("<script>alert('can't rename the file');</script>"); } } } ?> im kind of new just dont scream! thanks by the way!
  3. if is a free domain try setting the cookies to low in the privacy tab
  4. i didn't notice the chid boards!
  5. im trying to put the cssdiplay() values in the config .php but it doesnt write them index.php <?php require("config.php"); require("main.class"); $cn = new build; print $cn->display(); ?> config.php <?php $margin = "30px"; $back = "media/black.bmp"; ?> main.class <?php ob_start(); class build{ var $title; var $keywords; var $margin; var $backg; var $font; var $linkcolor; var $none; public function display(){ print("<html>\n"); print("<head>\n"); print("<title>$this->title \n"); print(" $this->keywords</title>\n"); print $this->cssdisplay(); print("<head>\n"); print("<body>\n"); //print $this->maincontent(); print("</body>\n"); print("</html>"); } public function cssdisplay(){ print("<style type=text/css>\n"); print(" body{\n"); print(" margin-top: $this->margin;\n"); print(" background: url('$this->backg');\n"); print(" font: $this->font;\n"); print("}\n"); print("a:link{color: $this->linkcolor;}\n"); print("a:active{color: $this->linkcolor;}\n"); print("a:visited{color: $this->linkcolor;}\n"); print("a:hover{color: $this->linkcolor; text-decoration: $this->none;}\n"); print("</style>"); } } ob_end_flush(); ?> little help here?
  6. im having troubles passing variables from config.php to index.php index.php <?php require("config.php"); require("main.class"); $cn = new build; print $cn->display(); ?> config.php <?php $margin = "30px"; $back = "media/black.bmp"; ?> main.class <?php ob_start(); class build{ var $title; var $keywords; var $margin; var $backg; var $font; var $linkcolor; var $none; public function display(){ print("<html>\n"); print("<head>\n"); print("<title>$this->title \n"); print(" $this->keywords</title>\n"); print $this->cssdisplay(); print("<head>\n"); print("<body>\n"); //print $this->maincontent(); print("</body>\n"); print("</html>"); } public function cssdisplay(){ print("<style type=text/css>\n"); print(" body{\n"); print(" margin-top: $this->margin;\n"); print(" background: url('$this->backg');\n"); print(" font: $this->font;\n"); print("}\n"); print("a:link{color: $this->linkcolor;}\n"); print("a:active{color: $this->linkcolor;}\n"); print("a:visited{color: $this->linkcolor;}\n"); print("a:hover{color: $this->linkcolor; text-decoration: $this->none;}\n"); print("</style>"); } } ob_end_flush(); ?> a little help here?
  7. im having truoble giving the cssdisplay() variable values cause im trying to use a config.php file throught the index , any ideas? <?php ob_start(); class build{ private $title; private $keywords; private $margin; private $backg; private $font; private $linkcolor; private $none; public function display(){ print("<html>\n"); print("<head>\n"); print("<title>$this->title \n"); print(" $this->keywords</title>\n"); print $this->cssdisplay(); print("<head>\n"); print("<body>\n"); //print $this->maincontent(); print("</body>\n"); print("</html>"); } public function cssdisplay(){ print("<style type=text/css>\n"); print(" body{\n"); print(" margin-top: $this->margin;\n"); print(" background: url('$this->backg');\n"); print(" font: $this->font;\n"); print("}\n"); print("a:link{color: $this->linkcolor;}\n"); print("a:active{color: $this->linkcolor;}\n"); print("a:visited{color: $this->linkcolor;}\n"); print("a:hover{color: $this->linkcolor; text-decoration: $this->none;}\n"); print("</style>"); } } ob_end_flush(); ?> thanks by the way!
  8. i have this code <?php ob_start(); class build{ private $title; private $keywords; public function display(){ print("<html>\n"); print("<head>\n"); print("<title>$this->title \n"); print(" $this->keywords</title>\n"); print cssdisplay(); print("<head>\n"); print("<body>\n"); print maincontent(); print("</body>\n"); print("</html>"); } public function cssdisplay($margin,$back,$font,$linkcolor,$none){ print("<style type=text/css>\n"); print("body{\n"); print("margin-top: $margin;\n"); print("background: url('$back');\n"); print("font: $font;\n"); print("}\n"); print("a:link{color: $linkcolor;}\n"); print("a:active{color: $linkcolor;}\n"); print("a:visited{color: $linkcolor;}\n"); print("a:hover{color: $linkcolor; text-decoration: $none;}\n"); print("</style>"); } } ob_end_flush(); ?> and recieve this error when called to the index Fatal error: Call to undefined function cssdisplay() in C:\serverbin\apache\htdocs\under\bridge.class on line 16 little help? i have read a lot but still i need some practice! thanks by the way!
×
×
  • 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.