Jump to content

rkrathor

Members
  • Posts

    9
  • Joined

  • Last visited

rkrathor's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. Hi, Then what could be other reason. can you please elaborate little bit. thanks
  2. Hi all, i just change in the code and found working. old code echo "<script type='text/javascript'>alert('check message: $name :- $id');</script>"; New code echo "<script type='text/javascript'>alert(''check message: $name :- $id''); window.location.href='same page';</script>"; thanks all for suggestion.
  3. Hi, But by using javascript i will not able to get my PHP variable data in the alert box. Thanks
  4. Hi justsomeguy, Below are some message that coming , may it help to diagnose the problem. if you run the code in Chrome it give message that is."Confirmation message.The page that you're looking for used information that you entered.Returning to that page might cause any action that you took to be repeated.Do you want to continue?"But in case of Firefox (if i press F5 only) it don't give any message and show the same alert message again and again.but If i press CTRL+F5 then it show the below messageConfirm dialogue box,"To Display this page, Firefox must send information that will repeat any action ( such as a search or order confirmation ) that was performed earlier.Is there any solution to prevent this to happen?Thanks
  5. I am facing a problem, Below is the codeHTML 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></head><body><form id="abc" name="abc" action="" method="post"><table><tr><td>Name: <input id="name" name="name" type="text" /></td><td>Id: <input id="id" name="id" type="text" /></td></tr><tr><td><input type="submit" name="save" id="save" value="Save" /></td><td></td></tr></table></form></body></html> PHP code <?php if(isset($_POST['save'])) { $name=$_POST['name']; $id=$_POST['id']; echo "<script type='text/javascript'>alert('check message: $name :- $id');</script>"; } else { } ?> Step 1- Fill form and press save.Step 2- Get a alert message. press okStep 3- Now Press F5 (Refresh).Problem- Every time when i press F5 for refresh i am getting the old alert message, even before i fill the form and press save button.Can anyone tell me why this happening or is there any solution to get out of this?Thanks
  6. Hi, I am using a unlimited server for uploading some files but after using so many code , i am not able to achieve my goal. So now i want i use my current server to php code and upload my files into another server, where limit will not be any issue. Example. Let's say i have two server ( www.rajesh.com and www.rathor.com), now i am using below code into www.rajesh.com if (file_exists("http://www.rathor.com/demo/rajesh/" . $_FILES["uploadedfile"]["name"])) { echo $_FILES["uploadedfile"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], "http://www.rathor.com/demo/rajesh/" . $_FILES["uploadedfile"]["name"]); echo "Stored in: " . "http://www.rathor.com/demo/rajesh/" . $_FILES["uploadedfile"]["name"]; } So i just want to know, is it possible to do?if yes then how i can achieve this?Thanks
  7. Hi, that i know to but what i want to say, the whole code said that if the size go beyond 20000 then it will show invalid file but in this case every time it showing invalid file and if change it to > then its working fine but it taking every size either less then or more than 20000. Thanks
  8. I didn't get what you asking for? Thanks
  9. Hi, I am using this code from w3schools but it giving me error (Invalid file ). This is the code <?php$allowedExts = array("gif", "jpeg", "jpg", "png");$temp = explode(".", $_FILES["file"]["name"]);$extension = end($temp);if ((($_FILES["file"]["type"] == "image/gif")|| ($_FILES["file"]["type"] == "image/jpeg")|| ($_FILES["file"]["type"] == "image/jpg")|| ($_FILES["file"]["type"] == "image/pjpeg")|| ($_FILES["file"]["type"] == "image/x-png")|| ($_FILES["file"]["type"] == "image/png"))&& ($_FILES["file"]["size"] < 20000)// if i change this by ">" then it taking every size&& in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; if (file_exists("rajesh/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "rajesh/" . $_FILES["file"]["name"]); echo "Stored in: " . "rajesh/" . $_FILES["file"]["name"]; } }} else { echo "Invalid file";}?> Can you please check and give the correct code? Thanks
×
×
  • Create New...