Jump to content

buknoii

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by buknoii

  1. anyone here got a good image resize script?
  2. i tried to check my hosting service and it produces this kind of output Array ( [0] => libxml [1] => xml [2] => wddx [3] => tokenizer [4] => sysvshm [5] => sysvsem [6] => sysvmsg [7] => standard [8] => SimpleXML [9] => sockets [10] => SPL [11] => shmop [12] => session [13] => Reflection [14] => pspell [15] => posix [16] => pcntl [17] => mime_magic [18] => iconv [19] => hash [20] => gmp [21] => gettext [22] => ftp [23] => exif [24] => date [25] => curl [26] => ctype [27] => calendar [28] => bz2 [29] => zlib [30] => pcre [31] => openssl [32] => dbase [33] => gd [34] => imap [35] => ldap [36] => mbstring [37] => mysql [38] => mysqli [39] => PDO [40] => pdo_mysql [41] => pdo_sqlite )
  3. thanks for the reply.. i tried changing the path from photos/ to var/www/html/community/photos but still no luck i heard that i need to chech my gd library?? whats a gd library? also what are the short tags that i used in my script? i just copied and paste some of this script so i really dont have idea what wrong with the script... thanks
  4. Hi there! I've been developing a simple website wherein users on my website can upload their picture, once it is uploaded it will be renamed according to time and its width resized to 470px. I have been success working on it on my local computer but once I uploaded it on my webhosting service, the resizing script doesnt work. Please check my code below <?php $userid=$_POST["userid"]; include("dbconnect.php"); $result = mysql_query("select * from community_user_info where user_xid='$userid' ") or die (mysql_error()); while ($row = mysql_fetch_array($result)) { echo $row["user_xid"]; $user_id = $row["user_xid"]; #echo "<br>-->".$user_id."<br>"; } mysql_free_result($result); ?> <?php $target_path = "photos/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } ?> <br><br> <?php ?> <Br><br> <? $newfilename= date(("ydjGHs")); $oldWD = getcwd(); $path="photos"; chdir($path); rename("".basename( $_FILES['uploadedfile']['name'])."","".$user_id."-".$newfilename.".jpg"); echo "<input type='text' value='".$user_id."-".$newfilename.".jpg"."'><br>"; chdir($oldWD); ?> <br><br> <?php echo $photo = $user_id."-".$newfilename.".jpg"; chmod("photos/".$photo."", 0755); mysql_query("INSERT INTO community_user_photo (user_id,user_photo) VALUES ('$user_id','$photo') ") or die(mysql_error()); ?> <h2>photo added</h2> <br><Br><Br><Br><Br> <?php // File and new size $filename = "photos/".$photo; //echo($filename); // Get new sizes list($width, $height) = getimagesize($filename); //figure out height ratios $newwidth = 470; $newheight = ($newwidth/$width) * $height; echo "new height -->".$newheight."<br>"; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); echo "thumb -->".$thumb."<br>"; echo "thumb -->".$source."<br>"; // resize imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Save the image as 'mynewpic.jpg' imagejpeg($thumb, ''.$filename,85); // Free up memory imagedestroy($thumb); ?> Any help or tips would be appreciated.
  5. how do i insert a substring on this kind of code? echo $row["content_data"];
  6. hi there! anyone in here got an idea on how to produce an output coming from the database wherein the output is limited to only 60 characters? for example i have a field named news_content and i want to display on 60 characters.. anyone in here got an idea?
  7. hello there! im a php newbie and would like to ask if anyone in here can share to me a basic username and password script? by the way username and passowrd are connected to the database.
  8. Jun and Derrick thanks for the help! what i did is i incorporated both of your codes and it worked perfectly. <?php include("dbconnect.php"); $xname = $_POST['frm_name']; $email = $_POST['frm_email']; $telno = $_POST['frm_telno']; $message = $_POST['frm_telno']; $frm_submit = $_POST['frm_submit']; if ($_POST['frm_submit']=="POST GUESTBOOK") { $query = " insert into gb_entry (gb_name,gb_email,gb_telno,gb_message) values ('".mysql_real_escape_string($xname)."','". mysql_real_escape_string($email)."','". mysql_real_escape_string($telno)."','". mysql_real_escape_string($message)."')" ; mysql_query($query) or die(mysql_error()); echo "<h2>entry added</h2>"; } else { echo "WRONG"; } ?> thanks guys!
  9. hi! thanks for your help! but when i tried inserting the code that your recommended it works well with firefox but not in IE and everytime it works and i view the tables, the fields are empty.
  10. thank you very much with your help
  11. greetings! I installed XAMPP on my computer and when i tried creating a php script to view the database it shows the result perfectly. But when I tried creating a simple guestbook program it keeps showing the same error message "WRONG" below are the codes of my program SIGNUP.PHP <form method="post" action="signup_db.php"> Name : <input type="text" name="frm_name"><br> E-mail : <input type="text" name="frm_email"><br> Tel No : <input type="text" name="frm_telno"><br> Message : <input type="text" name="frm_message"><br> <input type="submit" name="frm_submit" value="POST GUESTBOOK"> SIGNUP_DB.PHP <?php include("dbconnect.php"); if ($frm_submit=="POST GUESTBOOK") { $query = " insert into gb_entry (gb_name,gb_email,gb_telno,gb_message) values ('".mysql_real_escape_string($frm_name)."','". mysql_real_escape_string($frm_email)."','". mysql_real_escape_string($frm_telno)."','". mysql_real_escape_string($frm_message)."')" ; mysql_query($query) or die(mysql_error()); ?> <h2>entry added</h2> <?php } else { echo "WRONG"; } ?> dbconnect.php <?php mysql_connect("127.0.0.1","root","november") or die("query=$query\nerror=".mysql_error()); mysql_select_db("guestbook") or die ("could not select database"); ?> any help would be appreciated thanks!
×
×
  • 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.