Jump to content

npsari

Members
  • Posts

    393
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.npsari.com

Profile Information

  • Gender
    Male
  • Location
    United Kingdom

npsari's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Oh, cool, it worked, thank you
  2. Hi everyone, i have a problem, look at this small PHP code $currency_symbol = '£'; \\\ Thats £ print "Price: $currency_symbol5"; The item price is 5 pounds, but because the 5 is attached, the code thinks the string name is $currency_symbol5 It does not work, to solve this, i put a space between them, like this... $currency_symbol = '£'; \\\ Thats £ print "Price: $currency_symbol 5"; But it looks funny on my website, it looks like this £ 5 How to solve this, thank you in advance
  3. thank you ginerjem yes, php is my hobby, nothing serious, just making websites for fun or little money uploading images is the most annoying code on php, for the past 10 years, i never understoud this part, or never found a code online which does everything this code I am using above, i found online also, but it does not resize images, and it seems to have several issues i wonder how websites like eBay have such sophosticated image uploading tools, they must be really PHP gurus
  4. Thank you guys, thank you Gizmola So php is changing, I don't have time to learn this new mysqli or PDO Is it wrong saving all images as .jpg? It makes life little easier for me Yes $get_current_user is always small letters, because when the user creates an account, their username is converted to lower case first, then saved in the mySQL database, I really wonder how does it become capital letter later, i need to check my codes again, to make sure $get_current_user is always small letters
  5. Thank you, but where do I put this strtolower function? As you can see from the code above, it is already there, but it is doing nothing, because the first letter of the image name still becomes capital letter for some reason, even the $get_current_user is all lower case, so something in this code is turning the first letter of the image from a small letter into a capital letter
  6. Hi everyone, I have a script below, which uplads an image, however, the image name always starts with a capital letter, I want all letters to be small, how to adjust this please, thank you $target_dir = ""; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $target_file = "$get_current_user.jpg"; $uploadOk = 1; $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); // Check if image file is a actual image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo ""; /// was File is an image $uploadOk = 1; } else { echo "File is not an image<br>"; $uploadOk = 0; } } // Check file size if ($_FILES["fileToUpload"]["size"] > 10000000) { echo "Sorry, this image is too large, please resize using Paint<br>"; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" ) { echo "Only JPG, JPEG, PNG & GIF files are allowed<br>"; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "There was an error<br>"; } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "Uploaded successfully (You may need to clear Cache to see the new image)"; mysql_query("UPDATE user SET user_image = 'https://.../images/users/$get_current_user.jpg' WHERE user_name = '$get_current_user' "); } else { echo ""; /// was Select a suitable image, file not uploaded yet } }
  7. Okay, I've done it Thank you much guys <script type="text/javascript"> <!-- function delayer(){ document.getElementById("myDiv").style.display="block"; setTimeout("hide()", 5000); // 5 seconds } function hide() { document.getElementById("myDiv").style.display="none"; } //--> </script> <div id = "myDiv" style="display:none"><img id = "myImage" src = "/images/logo.png"></div><br> <body onload="setTimeout('delayer()', 8000)">
  8. okay, i've done the show but the hide i cant please help <script type="text/javascript"> <!-- function delayer(){ document.getElementById("myDiv").style.display="block"; } //--> </script> <div id = "myDiv" style="display:none"><img id = "myImage" src = "/images/logo.png"></div><br> <body onload="setTimeout('delayer()', 8000)">
  9. Thank you both I've done it like this, but it is not working: <script type="text/javascript"> <!-- function delayer(){ function show() { document.getElementById("myDiv").style.display="block"; setTimeout("hide()", 5000); // 5 seconds } function hide() { document.getElementById("myDiv").style.display="none"; } } <body onload="setTimeout('delayer()', 8000)"> //--> </script>
  10. Hello I have this code which shows an image for 5 seconds then it disapears However, instead of clicking a button, I want this to happen automatically 8 seconds after page load <input type = "button" value = "Show image for 5 seconds" onclick = "show()"><br><br> <div id = "myDiv" style="display:none"><img id = "myImage" src = "/images/logo.png"></div><br> <script type = "text/javascript"> function show() { document.getElementById("myDiv").style.display="block"; setTimeout("hide()", 5000); // 5 seconds } function hide() { document.getElementById("myDiv").style.display="none"; } </script> If there are any experts out there, please provide code
  11. ohhhh, ok ok, i get it, thank you for information By the way, what manual page? I thought you meant the link you are giving me where is this manual page you talking about?
  12. Thank you for the information, I thought the problem is solved :-\ I really loved this split function!!! I tried using parse_url() is giving me the whole thing v=ruJ1uFf9hy4&feature=g-vrec If you have some free time, why not share script, and I will do a favor back to you
  13. I never understood the PHP versions and packs, I use all PHP codes and they always work, never got an error message telling me this PHP code is too old. So you mean this script will not work in the future?
  14. Really? Why is it discouraged? It is amazing, the script i posted is doing the job, please explain!
  15. $a = "http://www.youtube.com/watch?v=ruJ1uFf9hy4&feature=g-vrec"; $a = split('[=&]', $a); echo $a[1];
×
×
  • 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.