Jump to content

CorfuVBProgrammer

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

About CorfuVBProgrammer

  • Birthday 05/04/1982

Profile Information

  • Gender
    Male
  • Location
    Greece

CorfuVBProgrammer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. try the following idate("d",strtotime('2007-03-03')-strtotime('2007-02-03'));
  2. Because i can't catch what you realy need try this code <?php $datestamp1 = 20070328; $datestamp2 = 20020327; $d1_day = idate("d", $datestamp1); // Day $d1_mon = idate("m", $datestamp1); // Month $d1_yea = idate("Y", $datestamp1); // Year $d1_hou = idate("H", $datestamp1); // Hour $d1_min = idate("i", $datestamp1); // Minutes $d1_sec = idate("s", $datestamp1); // Seconds $d2_day = idate("d", $datestamp2); // Day $d2_mon = idate("m", $datestamp2); // Month $d2_yea = idate("Y", $datestamp2); // Year $d2_hou = idate("H", $datestamp2); // Hour $d2_min = idate("i", $datestamp2); // Minutes $d2_sec = idate("s", $datestamp2); // Seconds echo $d1_day . "/" . $d1_mon . "/" . $d1_yea . " - - " . $d1_hou . ":" . $d1_min . ":" . $d1_sec; echo "<br />"; echo $d2_day . "/" . $d2_mon . "/" . $d2_yea . " - - " . $d2_hou . ":" . $d2_min . ":" . $d2_sec; ?> and make tha changes as you want . . . Kind regards Nikos . . .
  3. the deference must be less that 5 years and 1 day ? ? ? ? For example 1/1/1900 1/1/1905 is correct (format [ day / month / year ]) 1/1/1900 2/1/1905 is incorrect (format [ day / month / year ]) Tell me to know about . . .
  4. Do you want somethink like that ? ? ? <?php $date1 = date("Y"); $date2 = date("Y")+11; $deference; if($date1 > $date2) { $deference = ($date1 - $date2); } else { $deference = ($date2 - $date1); } if($deference <= 5) { echo "It's ok"; } else { echo "It's to much"; } ?>
  5. Hello all readers . . . I need your help . . . I have create a class that manipulate jpeg images the source code is the following : <------------------------------------------------------------------> class image_manipulation { private $height; private $width; public $image; public function __construct() { $this->width = 0; $this->height = 0; } public function __destruct() { $this->width = 0; $this->height = 0; } public function setImageSize($img_tmp) { $img_info = getimagesize($img_tmp); $filetype = $img_info['mime']; $this->width = $img_info[0]; $this->height = $img_info[1]; return $this->manipulate_jpeg($img_tmp); } private function manipulate_jpeg($img) { $tmp_img = imagecreatefromjpeg($img); if($this->height > $this->width) { $h = (IMG_LRG_HEIGHT * 100) / $this->height; $newHeight = ($this->height/100) * $h; $newWidth = ($this->width/100) * $h; } else { $h = (IMG_LRG_WIDTH * 100) / $this->width; $newHeight = ($this->height/100) * $h; $newWidth = ($this->width/100) * $h; } $img2 = ImageCreateTrueColor($newWidth, $newHeight); @imagecopyresampled($img2, $tmp_img,0,0,0,0,$newWidth,$newHeight,$this->width, $this->height); $xx = imagesx($img2); $yy = imagesy($img2); $fontSize = 30; $fntWidth = @imagefontwidth($fontSize) * strlen(APP_TITLE); $fntHeight = @imagefontheight($fontSize); $fx = ($xx - $fntWidth) - 10; $fh = ($yy - $fntHeight) - 10; $txtColor = @imagecolorallocate($img2, 255, 255, 255); @imagestring($img2, $fontSize, $fx, $fh, APP_TITLE, $txtColor); $this->image = imagejpeg($img2); return $this->image; } } <------------------------------------------------------------------> Now that i have create this class and test it, it work correctly. The problem is the following. I like to store the image data to MySQL database. I know how to store in the database but when i execute the code the Internet Explorer represent the image and in the database it store only one byte. Why ? ? ? Following the database code : <------------------------------------------------------------------> $image_object = new image_manipulation(); $cnn = @mysql_pconnect(IP, USER, PASSWORD); @mysql_select_db(DATABASE_NAME); $query = "INSERT INTO " . TABLE_NAME . "(img_data) VALUES('" . $image_object->setImageSize(FILE_LOCATION) . "')"; <------------------------------------------------------------------> Thanks a lot . . .
  6. I wonder if it posible to reload a web page using php ? ? ? No javascript or something similar. Only PHP Thanks a lot . . .
  7. My Friend you are the best . . . Thank you a lot . . . ! ! ! ! I had only to make the folder accesible from the IIS I really thank you a lot . . . :D
  8. My session.save_path = C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\session so i changed to C:\Documents and Settings\Μέριανος Νίκος\Local Settings\Temp\php\session And the poblem still exists
  9. Hello all . . . I have PHP Session problem in my PC. My Computer : Windows XP with SP2 IIS Web Server PHP 5.2 The Problem : I have create to web pages : PAGE1 -> index.php ------------------------------------------------------------------------ <?php session_register(); $_SESSION['name'] = "Merianos Nikos"; ?> <html> <head> <title> </title> </head> <body> <?php echo $_SESSION['name']; ?> <a href="index2.php">Click Me[/url] </body> </html> ------------------------------------------------------------------------ PAGE2 ->  index2.php ------------------------------------------------------------------------ <?php session_register(); echo $_SESSION['name']; ?> <html> <head> <title> </title> </head> <body> </body> </html> ------------------------------------------------------------------------ When i start the index.php page it work correctly and the result is the following ------------------------------------------------------------------------ Merianos Nikos Click Me ------------------------------------------------------------------------ Then if i click on the Click Me to go on the index2.php the result is the following ------------------------------------------------------------------------ PHP Notice: Undefined variable: _SESSION in C:\Inetpub\wwwroot\PHP_TEST\index2.php on line 4 ------------------------------------------------------------------------ So what can i do for ? ? ? I have try many many thinks and still i have the same problem. Also i have try to use session_start() instead of session_register() and nothing thange . . . Please i need help . . . Thanks a lot
  10. When i using the session_start() i have the following result: Merianos NikosClick Me PHP Warning: session_start() [function.session-start]: open(C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\upload\sess_vshiukg8ldedh8mcdlk81vanu7, O_RDWR) failed: No such file or directory (2) in C:\Inetpub\wwwroot\PHP_TEST\index.php on line 2 PHP Warning: Unknown: open(C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\upload\sess_vshiukg8ldedh8mcdlk81vanu7, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\DOCUME~1\E456~1\LOCALS~1\Temp\php\upload) in Unknown on line 0
  11. It doesn't work none of them. Only the session_register() let me show the session variable in the index.php but i can't transfer it to index2,php
  12. Hello all . . . I have PHP Session problem in my PC. My Computer : Windows XP with SP2 IIS Web Server PHP 5.2 The Problem : I have create to web pages : PAGE1 -> index.php ------------------------------------------------------------------------ <?php session_register(); $_SESSION['name'] = "Merianos Nikos"; ?> <html> <head> <title> </title> </head> <body> <?php echo $_SESSION['name']; ?> <a href="index2.php">Click Me</a> </body> </html> ------------------------------------------------------------------------ PAGE2 ->  index2.php ------------------------------------------------------------------------ <?php session_register(); echo $_SESSION['name']; ?> <html> <head> <title> </title> </head> <body> </body> </html> ------------------------------------------------------------------------ When i start the index.php page it work correctly and the result is the following ------------------------------------------------------------------------ Merianos Nikos [url=http://Click Me]Click Me[/url] ------------------------------------------------------------------------ Then if i click on the [url=http://Click Me]Click Me[/url] to go on the index2.php the result is the following ------------------------------------------------------------------------ PHP Notice: Undefined variable: _SESSION in C:\Inetpub\wwwroot\PHP_TEST\index2.php on line 4 ------------------------------------------------------------------------ So what can i do for ? ? ? I have try many many thinks and still i have the same problem. Also i have try to use session_start() instead of session_register() and nothing thange . . . Please i need help . . . Thanks a lot
×
×
  • 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.