Jump to content

doforumda

Members
  • Posts

    300
  • Joined

  • Last visited

    Never

Everything posted by doforumda

  1. now it just display this http://localhost/imageResizer/image_resizer.php no errors are displayed
  2. now it is working for jpg and gif but not for png i modify my code and add these if($jpg==true) { $image = imagecreatefromjpeg($filename); } if($png==true) { $image = imagecreatefrompng($filename); } if($gif==true) { $image = imagecreatefromgif($filename); }
  3. hi i am trying to upload images and resize them to thumbnail size through imagecopyresampled. I allowing four kinds of images gif,jpg,jpeg and png. the problem is imagecopyresampled only works for jpg not for others. my code is below please help me out where i am making mistake <?php include("getExtension.php"); $filename = 'banner.gif'; $ext = getExtension($filename); $ext = strtolower($ext); $jpg = false; $png = false; $gif = false; // Content type if($ext=='jpeg' || $ext == 'jpg') { $jpg = true; header('Content-type: image/jpeg'); } if($ext=='png') { $png = true; header('Content-type: image/png'); } if($ext=='gif') { $gif = true; header('Content-type: image/gif'); } // Get new dimensions list($width, $height) = getimagesize($filename); $new_width = 80; $new_height = 80; // Resample $image_p = imagecreatetruecolor($new_width, $new_height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); // Output if($jpg==true) { imagejpeg($image_p, $save, 100); } if($png==true) { imagepng($image_p, $save, 100); } if($gif==true) { imagegif($image_p, $save, 100); } ?> above code displays this error The image “http://localhost/imageResizer/image_resizer.php” cannot be displayed, because it contains errors.
  4. ok now if i do "unlink($final);" then i wont delete that image bcoz i am not mentioning it destination. so how can i mention desitination to avoid directory deletion?
  5. hi i have this string "../profile_photos/Image0094.jpg" What i want is just to take "Image0094.jpg" and place it in variable. i actually want to unlink this image from profile_photos directory. so how can i delete this image from that directory. if i do it this way "unlink("../profile_photos/Image0094.jpg")" then i think it will delete the whole folder. how to do this?
  6. hi i have issue with jScrollPane. I created three divs. First and third have paragraphs and the second one i want to make it dialogue box. so the problem is when i run the code below it gives weird effect. <!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/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="lib/jquery-1.4.min(Production).js"></script> <script type="text/javascript" src="scroller/scroller/jScrollPane.js"></script> <script> $(function() { $('.dialogue_box').jScrollPane({showArrows:true}); }); </script> <style> .dialogue_box { position: fixed; width: 300px; height: 200px; margin-left: 400px; border: 1px solid #999; background-color: #FFF; z-index: 1000; } .first { position: relative; } .third { position: relative; } </style> </head> <body> <div class="first"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in ante eu nisi condimentum placerat. Aliquam eget faucibus nibh. Quisque porttitor malesuada rutrum. Sed ornare magna id lorem mattis consectetur. Cras convallis dapibus erat sed malesuada. Vestibulum sed nisi nec nisi luctus rhoncus. Suspendisse potenti. Phasellus hendrerit lorem at neque bibendum aliquam. Aliquam convallis iaculis hendrerit. In vel vestibulum est. Proin ac orci eu sem faucibus scelerisque. Phasellus sed leo urna, eget porttitor purus. Aliquam et elit et libero fringilla dapibus. Aenean ut ligula in libero aliquet lacinia sit amet quis leo. Nam nibh justo, pharetra vel tincidunt vel, ultricies in mi. Vivamus condimentum mattis lectus, sit amet pharetra neque laoreet iaculis. Phasellus consequat aliquet diam, et aliquam nisi varius a. Sed sed metus eget nibh ultricies tempor. Phasellus purus leo, scelerisque non blandit vitae, vulputate quis metus. In pellentesque augue sem, ut interdum justo. Praesent metus mi, accumsan eget venenatis ut, mattis ut sapien. Cras molestie, velit et venenatis pretium, lectus justo sagittis lorem, a viverra enim odio vitae purus. Maecenas aliquet facilisis tortor. </div> <div class="dialogue_box"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in ante eu nisi condimentum placerat. Aliquam eget faucibus nibh. Quisque porttitor malesuada rutrum. Sed ornare magna id lorem mattis consectetur. Cras convallis dapibus erat sed malesuada. Vestibulum sed nisi nec nisi luctus rhoncus. Suspendisse potenti. Phasellus hendrerit lorem at neque bibendum aliquam. Aliquam convallis iaculis hendrerit. In vel vestibulum est. Proin ac orci eu sem faucibus scelerisque. Phasellus sed leo urna, eget porttitor purus. Aliquam et elit et libero fringilla dapibus. Aenean ut ligula in libero aliquet lacinia sit amet quis leo. Nam nibh justo, pharetra vel tincidunt vel, ultricies in mi. Vivamus condimentum mattis lectus, sit amet pharetra neque laoreet iaculis. Phasellus consequat aliquet diam, et aliquam nisi varius a. Sed sed metus eget nibh ultricies tempor. Phasellus purus leo, scelerisque non blandit vitae, vulputate quis metus. In pellentesque augue sem, ut interdum justo. Praesent metus mi, accumsan eget venenatis ut, mattis ut sapien. Cras molestie, velit et venenatis pretium, lectus justo sagittis lorem, a viverra enim odio vitae purus. Maecenas aliquet facilisis tortor. </div> <div class="third"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in ante eu nisi condimentum placerat. Aliquam eget faucibus nibh. Quisque porttitor malesuada rutrum. Sed ornare magna id lorem mattis consectetur. Cras convallis dapibus erat sed malesuada. Vestibulum sed nisi nec nisi luctus rhoncus. Suspendisse potenti. Phasellus hendrerit lorem at neque bibendum aliquam. Aliquam convallis iaculis hendrerit. In vel vestibulum est. Proin ac orci eu sem faucibus scelerisque. Phasellus sed leo urna, eget porttitor purus. Aliquam et elit et libero fringilla dapibus. Aenean ut ligula in libero aliquet lacinia sit amet quis leo. Nam nibh justo, pharetra vel tincidunt vel, ultricies in mi. Vivamus condimentum mattis lectus, sit amet pharetra neque laoreet iaculis. Phasellus consequat aliquet diam, et aliquam nisi varius a. Sed sed metus eget nibh ultricies tempor. Phasellus purus leo, scelerisque non blandit vitae, vulputate quis metus. In pellentesque augue sem, ut interdum justo. Praesent metus mi, accumsan eget venenatis ut, mattis ut sapien. Cras molestie, velit et venenatis pretium, lectus justo sagittis lorem, a viverra enim odio vitae purus. Maecenas aliquet facilisis tortor. </div> </body> </html> how can i make this work??
  7. hi i have a css which works on all browsers except chrome and safari. I create a link when user clicks on that link it popups a dialogue box. the problem is with the style. I ll upload pictures that will explain better here is my code <!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/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style> .outer_border { position: fixed; margin-left: 115px; margin-top: 150px; width: 470px; height: 125px; border: 1px solid #b0c5cf; display: none; z-index: 1000px; } .plan_form { position: fixed; width: 460px; height: 115px; margin-top: 5px; margin-left: 5px; display: none; background-color: #b0c5cf; z-index: 1000; /*border: 1px solid #666;*/ } #share_plan { margin-left: 40px; margin-top: 15px; } .cancel_btn { float: left; } </style> <script type="text/javascript" src="lib/jquery-1.4.min(Production).js"></script> <script> $(document).ready(function() { $(".share_plan").click(function() { $('.plan_form').css('display','block'); $('.outer_border').css('display','block'); }); $('#cancel_btn').click(function() { $('.plan_form').css('display','none'); $('.outer_border').css('display','none'); }); }); </script> </head> <body> <div class="share_plan"><a class="share_plan" href="#">Share plan</a></div> <div class="outer_border"> <div class="plan_form"> <form id="share_plan" action="home.php" method="post"> <div class="plan_text"><textarea id="plan" name="plan" rows="3" cols="45"></textarea></div> <input type="hidden" name="posted" id="posted" value="true" /> <div class="cancel_btn"><input type="button" name="share_planbtn" id="cancel_btn" value="Cancel" /></div> <div class="plan_btn"><input type="button" name="share_planbtn" id="share_planbtn" value="Share" /></div> <div id="plan_chars_info"></div> </form><!-- share_plan --> </div><!-- plan_form --> </div><!-- outer_border --> </body> </html> the first image is taken from Firefox is working fine on firefox, IE and opera. the second one is taken from safari. its desgin is abit problem. how can it be solved to work on all browsers. [attachment deleted by admin]
  8. thanks JustLikeIcarus. it is working now. please tell how can i use html dataType so when all the validation on php side passed and then the user is taken to the user admin area. I am using json because i dont know how to achieve above
  9. this also does not work. It also has the same problem. To find out the problem i create a small login system. In the code below when i try to use dataType: 'html' then it does work on all browsers but when i change it to json then on firefox and chrome its fine but on IE8 and safari it is not working with the same problem. here is the code login_form.php <form action="main.php" method="post" id="login_form"> Email: <input type="text" name="email" id="email" /><br /> Password: <input type="password" name="pass" id="pass" /><br /> <input type="button" name="login" id="login" value="login"> </form> <div id="msg"></div> <script type="text/javascript" src="lib/jquery-1.4.min(Production).js"></script> <script src="js/script.js" type="text/javascript"></script> script.js $(document).ready(function () { $('#login').click(function () { var url = 'login.php'; var queryString = $('#login_form').serialize(); //alert(queryString); $.ajax({ type: "POST", url: url, data: queryString, dataType: 'json', success: show_msg }); }); }); function show_msg(result) { if(result.error=='no') { $('#login_form').submit(); } else { $('#msg').html(result.error); } } login.php <?php session_start(); $email = $_POST['email']; $pass = $_POST['pass']; //echo $email."<br>".$pass; //die(); $error = 'yes'; if($email) { $connect = mysql_connect('localhost','user','pass'); $db = mysql_select_db("db"); $password = md5($pass); $check_email = mysql_query("SELECT * FROM users WHERE email='$email'"); $count_email = mysql_num_rows($check_email); //echo $count_email; if($count_email > 0) { while($row = mysql_fetch_assoc($check_email)) { $dbemail = $row['email']; $dbpassword = $row['password']; } if($email == $dbemail && $password == $dbpassword) { $_SESSION['email'] = $email; $error = 'no'; $msg = "Welcome ".$_SESSION['email']."! You are now logged in."; } else $msg ="Wrong email or password."; } else $msg ="Email does not exist."; } else $msg ="Enter email."; $JSON_response = '{'; $JSON_response .= '"error": "'.addslashes($error).'",'; $JSON_response .= '"fieldErrors": "'.$msg.'",'; $JSON_response .= '}'; echo $JSON_response; ?>
  10. hi i wrote a code for login. it uses xhtml, ajax and php. the problem is when i try to login using firefox and chrome it does log me in and working fine but when i check it on IE8 and safari it does not log me in. it just displays loader and does not process the code and does not log me in. what am i doing wrong in this code. help please $(document).ready(function () { //This is function triggers when login button is clicked. $('#loginbtn').click(function (){ hideshow('loader',1); var url = "login.php"; //var queryString = $("#login_form").serialize(); var email = $('#email').val(); var password = $('#password').val(); var queryString = 'email=' + email + '&password=' + password; //alert(email); //alert(queryString); $.ajax({ type: "POST", url: url, data: queryString, dataType: 'json', success: show_login }); }); //This function triggers when loginbtn process is successfully completed. function show_login(resultData) { //alert(resultData.error); if(resultData.error=='no') { $('.error').css('visibility','hidden'); $('#login_form').submit(); hideshow('loader',0); } else { hideshow('loader',0); $('.error').html(resultData.fieldErrors).css('visibility','visible'); } } });
  11. hi i am facing problem, i dont know what is it, with the code that runs on firefox and chrome absolutely perfect but on IE 8 and safari it does not working. And i also dont know which code is making problem and where should i post this. so please help if you know what is the problem. This page is actually a login page consist of xhtml, ajax and php. When user enters email and pass and press login then a preloader appears and stucks there and doing nothing else. This happens on IE and safari. here is the code xhtml code <link type="text/css" rel="stylesheet" href="css/style.css" /> <title>remindme</title> <div class="loader"> <img src="images/ajax-loader.gif" width="27" height="27" /> <div class="processing">Processing...</div> </div> <div class="login_banner"> Welcome to <div class="banner"></div> </div> <div class="login_border"> <div class="login_form"> <div class="login_heading"> Login to <div class="remind"></div> </div><!-- login_heading --> <form id="login_form" action="main.php" method="post"> <div> <label>Email address:</label> <input type="text" name="email" id="email" class="login_input" /> </div> <div> <label>Password:</label> <input type="password" name="password" id="password" class="login_input" /> </div> <div> <input type="button" name="loginbtn" id="loginbtn" value="Login" /> </div> </form> </div><!-- login_form --> </div><!-- login_border --> <div class="error"></div> <script type="text/javascript" src="lib/jquery-1.4.min(Production).js"></script> <script src="js/script.js" type="text/javascript"></script> here is jquery and ajax part $(document).ready(function () { //This is function triggers when login button is clicked. $('#loginbtn').click(function (){ hideshow('loader',1); var url = "login.php"; //var queryString = $("#login_form").serialize(); var email = $('#email').val(); var password = $('#password').val(); var queryString = 'email=' + email + '&password=' + password; //alert(email); //alert(queryString); $.ajax({ type: "POST", url: url, data: queryString, dataType: 'json', success: show_login }); }); //This function triggers when loginbtn process is successfully completed. function show_login(resultData) { if(resultData.error=='no') { $('.error').css('visibility','hidden'); $('#login_form').submit(); hideshow('loader',0); } else { hideshow('loader',0); $('.error').html(resultData.fieldErrors).css('visibility','visible'); } } }); here is php <?php session_start(); $email = $_POST['email']; $password = $_POST['password']; $error = 'yes'; $connect = mysql_connect("localhost","user","pass"); $db = mysql_select_db("db"); if($email) { if(ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { if($password) { //echo $password."<br>"; $check_email = mysql_query("SELECT * FROM users WHERE email='$email'") or die(mysql_error()); $count_email = mysql_num_rows($check_email); if($count_email > 0) { while($row_data = mysql_fetch_assoc($check_email)) { $userid = $row_data['userid']; $email_db = $row_data['email']; $password_db = $row_data['password']; $active_db = $row_data['active']; } //$check_password = mysql_query("SELECT * FROM users WHERE email='$email' AND password='$password'"); $password = md5($password); //echo $password."<br>".$password_db; if($email==$email_db&&$password==$password_db) { //$check_active = mysql_query("SELECT * FROM users WHERE email='$email' AND active='0'"); //$count = mysql_num_rows($check_active); if($active_db == 1) { $get_data = mysql_query("SELECT * FROM profile WHERE userid='$userid'"); while($row = mysql_fetch_assoc($get_data)) { $fullname = $row['fullname']; }//end of while($row = mysql_fetch_assoc($get_data)) $_SESSION['email'] = $email; $_SESSION['fullname'] = $fullname; $_SESSION['userid'] = $userid; $error = 'no'; $msg = "You are in."; //header("Location: page_home/home.php"); //echo $_SESSION['email']."<br>".$_SESSION['fullname']."<br>".$_SESSION['userid']."<br><a href='logout.php>Logout</a>"; }//end of if($check_active) else $msg = "Please activate your account."; }//end of if($check_password) else $msg = "Email and password do not match."; }//end of of($check_email) else $msg = "User does not exist."; }//end of if($password) else $msg = "Enter password."; }//if(ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) else $msg = "Enter valid email address."; }//end of if($email) else $msg = "Enter email address"; $JSON_response = '{'; $JSON_response .= '"error": "'.addslashes($error).'",'; $JSON_response .= '"fieldErrors": "'.$msg.'",'; $JSON_response .= '}'; echo $JSON_response; ?>
  12. hi I am trying to create a textarea. There is a default text inside textarea. so when user clicks inside textarea then submit button appears and default text disappears and when user clicks somewhere else or outside textarea then it gets back to original state i.e, default text appears back and submit button disappears. here is what i did sofar. in this code when i click inside textarea then submit button does appear but text does not erase and when i click outside then button remains in sight. <!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/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style> #submit { visibility: hidden; } </style> </head> <body> <form> <label>Message:</label> <textarea name="message" id="message" rows="5" cols="30">write message here!</textarea><br /> <input type="button" name="submit" id="submit" value="submit" /> </form> </body> <script type="text/javascript" src="lib/jquery-1.4.min(Production).js"></script> <script> var flag = false; $(document).ready(function () { $('#message').click(function () { flag = true; $('#submit').css('visibility','visible'); if(flag == true) { //alert(flag); var msg = $('#message').val(); //alert(msg); msg = ""; //alert(msg); } }); }); </script> </html>
  13. hi i want to create a select menu where all the countries will reside. By making it through pure xhtml there will be lots of option tags. So what i want is make a php function so it generates all these countries name and by calling it in option tag it automatically fill the select menu with all these countries. Is this possible if yes then please help me how it can be done? I want to use functions not classes.
  14. hi is there any way to send a request to webserver after some interval of time to check if there is any latest data available if available then load it otherwise dont. if yes then how can we do this???
  15. hi I have a form in which there is a select menu for Date of Birth. There are three select menus. one for day one for month and for year. What do i want is how can we generate a php script so that all these menus fill automatically rather than making that many option tags. If you know any link for this particular please provide it here. Thanks
  16. scvinodkumar i did but the same error <?php function pagination($record_count,$get_data,$start,$per_page) { $max_pages = $record_count / $per_page; $start = 0; if(@$_GET["start"]!='') $start = $_GET["start"]; //display the data. while($row = mysql_fetch_assoc($get_data)) { $name = $row["name"]; echo $name."<br>"; } //naviagtion here //setup previous and next variables. $prev = $start - $per_page; $next = $start + $per_page; //show prev button. if(!($start<=0)) { ?> <a href='index.php?start=<?php echo $prev; ?>'>Previous</a> <?php } //show page numbers. //set variable for first page. $i = 1; for($x=0; $x<$record_count; $x = $x + $per_page) { if($start != $x) { ?> <a href="index.php?start=<?php echo $x; ?>"><?php echo $i; ?></a> <?php } else { ?> <a href="index.php?start=<?php echo $x; ?>"><b><?php echo $i; ?></b></a> <?php } $i++; } //show next button if(!($start>=$record_count-$per_page)) { ?> <a href='index.php?start=<?php echo $next; ?>'>Next</a> <?php } } ?>
  17. hi I create a script for pagination which works fine. Now what i want to do is to make a function of it so when i need it for any script i ll call that function so it ll work. I want to use function not classes. Here is the problem when i make a function of it then it displays this error Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\pagination\function.php on line 9 here is my index.php include("function.php"); $connect = mysql_connect("localhost","user","pass"); $db = mysql_select_db("pagination"); //max number of posts to display per page. $per_page = 10; //get start variable. @$start = $_GET["start"]; $recordCount = mysql_num_rows(mysql_query("SELECT * FROM data")); $getData = mysql_query("SELECT * FROM data LIMIT $start, $per_page"); pagination($recordCount,$getData,$start,$per_page); here is my function.php <?php function pagination($record_count,$get_data,$start,$per_page) { $max_pages = $record_count / $per_page; if(!$start) $start = 0; //display the data. while($row = mysql_fetch_assoc($get_data)) { $name = $row["name"]; echo $name."<br>"; } //naviagtion here //setup previous and next variables. $prev = $start - $per_page; $next = $start + $per_page; //show prev button. if(!($start<=0)) { ?> <a href='index.php?start=<?php echo $prev; ?>'>Previous</a> <?php } //show page numbers. //set variable for first page. $i = 1; for($x=0; $x<$record_count; $x = $x + $per_page) { if($start != $x) { ?> <a href="index.php?start=<?php echo $x; ?>"><?php echo $i; ?></a> <?php } else { ?> <a href="index.php?start=<?php echo $x; ?>"><b><?php echo $i; ?></b></a> <?php } $i++; } //show next button if(!($start>=$record_count-$per_page)) { ?> <a href='index.php?start=<?php echo $next; ?>'>Next</a> <?php } } ?>
  18. i cant see anything in my code which i am making output before header here is my code if you can see that output <?php session_start(); ?> <?php if($_POST['save']) { include("dbConnect.php"); //$_SESSION['userid'] = '1'; $sex = addslashes(strip_tags($_POST['sex'])); $showsex = isset($_POST['showsex']); $month = addslashes(strip_tags($_POST['month'])); $day = addslashes(strip_tags($_POST['day'])); $year = addslashes(strip_tags($_POST['year'])); $showbirth = addslashes(strip_tags($_POST['showbirth'])); $currentcity = addslashes(strip_tags($_POST['currentcity'])); $hometown = addslashes(strip_tags($_POST['hometown'])); $homeneighbor = addslashes(strip_tags($_POST['homeneighbor'])); $status = addslashes(strip_tags($_POST['status'])); $interestedin = addslashes(strip_tags($_POST['interestedin'])); $lookingfor = addslashes(strip_tags($_POST['lookingfor'])); $religiousviews = addslashes(strip_tags($_POST['religiousviews'])); $politicalviews= addslashes(strip_tags($_POST['politicalviews'])); $dob = date($year."-".$month."-".$day); $basicinfosave = mysql_query("UPDATE basicinfo SET currentcity='$currentcity', hometown='$hometown', homeneighborhood='$homeneighbor', relationshipstatus='$status', interestedin='$interestedin', lookingfor='$lookingfor', religiousviews='$religiousviews', politicalviews='$politicalviews' WHERE userid='$_SESSION[userid]' ") or die(mysql_error()); if($basicinfosave) { $agesave = mysql_query("UPDATE basicinfo_age SET sex='$sex', dob='$dob', sexprivacy='$showsex', dobprivacy='$showbirth' WHERE userid='$_SESSION[userid]' "); if($agesave) { header("Location: profile.php"); } } } else { header("Location: profile.php"); } ?> in above code i remove html tags but it still give the same error Warning: Cannot modify header information - headers already sent by (output started at /home/...../profileinfosave.php:3) in /home/...../profileinfosave.php on line 48
  19. hi i create a website when i checked it on my local computer everything was working fine. but when i upload it to webserver then something going wring there with header(). i.e, when the page calls header function it displays this error. Warning: Cannot modify header information - headers already sent by (output started at /home....../profileinfosave.php:10) in /home/......../profileinfosave.php on line 103 please help if you need some more info about this please ask
  20. in unlink($deletephoto[$i]); $deletephoto[$i] has the path as well as image. photos is the directory and image.jpg is the image in this variable. and where should use $_SERVER['SCRIPT_FILENAME']; in my code above.
  21. hi i want to delete image from the server using unlink function but it is not working. it does not delete the image and it does not display any errors as well. here is my code <?php session_start(); include("dbConnect.php"); $photo = @$_POST['photo']; $deletephoto = @$_POST['deletephoto']; if($photo) { $get = mysql_query("SELECT * FROM photos WHERE userid='$_SESSION[userid]' AND profile='1'"); $row = mysql_fetch_assoc($get); $profile = $row['location']; //echo $profile."<br>"; $make_profile = mysql_query("UPDATE photos SET profile='1' WHERE userid='$_SESSION[userid]' AND location='$photo'"); if($make_profile) { $unmake_profile = mysql_query("UPDATE photos SET profile='0' WHERE userid='$_SESSION[userid]' AND location='$profile'"); } } if($deletephoto) { $count = count($deletephoto); for($i = 0; $i < $count; $i++) { //echo $deletephoto[$i]."<br>"; $delete_photos = mysql_query("DELETE FROM photos WHERE userid='$_SESSION[userid]' AND location='$deletephoto[$i]'"); //echo $deletephoto[$i]; unlink($deletephoto[$i]); } } //die(); header("Location: photos.php"); ?> in second if statment i am using unlink as you can see. there $deletephoto[$i] variable has something like this "photos/image.jpg". how can this be solved to work?
  22. it displays this http://localhost/fileupload/uploadProcess.php
  23. i did that but still not working
  24. well where should i user var_dump i have never used this before. and secondly should i remove HTML header and footer?
  25. ok here is getExtension.php <!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/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } ?> </body> </html>
×
×
  • 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.