Jump to content

jjmusicpro

Members
  • Posts

    290
  • Joined

  • Last visited

    Never

Everything posted by jjmusicpro

  1. Unknown: open_basedir restriction in effect. File(/var/tmp) is not within the allowed path(s): (/usr/local/www/vhosts/*****/httpdocs:/tmp) Ok this is weird, when ever i try to upload an image i get this, it happens on any of my domain on my private server. I checked to make sure a folder called tmp was in the root, etc. But same error, any idea? FYI my php.ini is set to open_basedir =
  2. Hi i have a login page that the user puts in there info, then through ajax it goes to a page to check the info on the database, how can i redirect the page if the result comes back good?
  3. I took out the form tag, since this is inside another form, is this a good idea? right now i have a bigger form where you can edit things etc. then inside that i have the upload photothing, i guess i can make it an iframe correct?
  4. I had a simple image uploading script working, where you search for your file, hit upload, it goes to another page and displays some data. However, i wanted to do this with ajax and cant seem to get it working now. for some reason it wont upload the form, it puts in the right values on the kick out div. so here is my form <input type="hidden" name="MAX_FILE_SIZE" value="100000" id="MAX_FILE_SIZE"/> <input name="uploadedfile" type="file" id="uploadedfile"/> <input type="button" value="Upload" onClick="getlinks(this.form)"> here is my page ajax hits to process data $q2= $_GET["str2"]; $q3= $_GET["str3"]; echo "1 value ".$q2."<br>"; echo "2 value ".$q3."<br>"; $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $i = 0; while(file_exists($target_path.$i)) { $i++; } if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path.$i)) { echo "<textarea cols=\"50\" rows=\"3\"><a href=\"http://www.blingtool.com\"><img src=\"http://www.blingtool.com/uploads/".basename( $_FILES['uploadedfile']['name'])."></a></textarea>"; } else{ echo "There was an error uploading the file, please try again!"; }
  5. I looked in my file directory and what its doing is, adding the number on the end of the file name, so if i uploaded me.gif already, its making a me.gif1 not me1.gif. Do you think it would be better to just add a 10 digit random number to the end?
  6. so this is what i have but its not changing name <? $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $i = 0; while(file_exists($target_path.$i)) { $i++; } if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path.$i)) { echo "<img src=\"/uploads/".basename( $_FILES['uploadedfile']['name'])."\"><br><br>"; echo "<b>Direct Link</b><br>"; echo "<textarea cols=\"50\" rows=\"3\">http://www.blintool.com/uploads/".basename( $_FILES['uploadedfile']['name'])."</textarea>"; echo "<br><br>"; echo "<b>Myspace / FaceBook / Hi5 / Orkut Links</b><br>"; echo "<textarea cols=\"50\" rows=\"3\"><a href=\"http://www.blingtool.com\"><img src=\"http://www.blingtool.com/uploads/".basename( $_FILES['uploadedfile']['name'])."></a></textarea>"; } else{ echo "There was an error uploading the file, please try again!"; } ?>
  7. i dont know how to reloop it back through, and keep checking if that file name already exsists. so if there is already a test.gif, it would go to test.gif1, however, if there is already a test.gif1..i need it to go to the next number. or cant i add some weird time hash on the end of the file name?
  8. Right now i have an uploading script working, a basic one. However, if someone uploads a file with the same name, it will overwirte the previous one. How can i make it so it checks to see if there is a file with the same name, if so, just put a number on the end that increments or something.? Thanks for your help $target_path = "uploads/"; $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.<br>"; echo "<img src=\"/uploads/".basename( $_FILES['uploadedfile']['name'])."\">"; } else{ echo "There was an error uploading the file, please try again!"; }
  9. how do i make it so it displays the file? Then a box underneith with a copy and paste imge tag with html.
  10. Hi, im not sure if php can do this, but i wanted to look at specific folder like /images/ and have it grab the last 10 that were added in there, is this possible? I then wanted to display them out on my page.
  11. Yep you bet Ajax Code: JS I see in the alert that it passes the right value, in the url it passes the right value, hower on my ajax page it wont get the value, however it will get value2 that i passed as a test. i tried to do some evalus on the ajax page, but it wont match anything i put, and it should. function showHint(str) { alert(str); var str2 = str; if (str.length==0) { document.getElementById("txtHint").innerHTML="" return } xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="ajax/gettweek.php" url=url+"?q="+str+"&str2="+str2 url=url+"&sid="+Math.random() alert(url); xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } $q2= $_GET["str2"]; $q = ""; $q = $q2; if ($q = ""){ echo 'Nothing Was Selected.'; } elseif ($q2 == "centeryourprofile"){ } fyi i didnt put all my code for the above, just a snippet, i tried getting the value of q in the url but it wont get it, so i passed another one called q2 and it gets that but, i cant do any evaluations on it, it wont match anything..even though it really does match stuff.
  12. I am trying to do a simple post with ajax to a new page. I checked the values being passed with javascript, and checked the url and it all seems fine however, my ajax page is not picking up the value in the query string. any ideas?
  13. I have a website where i wanted to auto fill crtain text boxs with information pulled from my database, and on the page hit enter automaticly. because i have a site rankbook.com where i wanted to auto add a bunch of people to get the db filled. But i dont want to sit here and add people all day.
  14. Hi, I was trying to make a select box, and based on what they pick, it would go to download link, or pop up the "download now" link. However, i dont want to expose the actual path by making a hyperlink etc. here is what i have if ($_SESSION['loggedin'] = "yes"){ if($db = mysql_connect("localhost", "xxxxxx","xxxxxx")){ if(mysql_select_db("xxxxxxxx",$db)){ $acc1 = "select * from videos where type='oog'"; $query = mysql_query($acc1); echo "<form name=\"select\" onSubmit=\"d.php?id\" method=\"post\">"; echo "<b>OOG Walkers</b><br>"; echo "<select name=\"dl\" id=\"dl\">"; while ($result = mysql_fetch_assoc($query)) { echo "<option value".$result["ID"].">".$result["title"]."</option>"; } echo "</select>"; echo "<input type=\"submit\" value=\"Download\">"; echo "</form>"; echo"<br><br><br>"; } } } else{ echo"Why dont you see any download links? <a href=\"joinustoday.php\">Become a member and get full access! </a></div>"; } ?>
  15. i assume there is something already made for this? do you know of any?
  16. Is there a good way to track visitors on a site? I was thinking of writing to a text file etc...however...how i make sure they are still on it etc... maybe go database way?
  17. Perfect that worked! Question, is this a good way to track hits? or should i do it in a DB?
  18. dont i have to put something to update the number and write it back to the file, so next time someone comes it will +?
  19. i am having trouble with this... i wanted to open a text file c.txt, get the number thats in there, add to it, and close the file here is what i have <?php $file = fopen("c.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { echo "NUMBER -".fgets($file). "<br />"; } fclose($file); ?>
  20. OMG I LOVE YOU! IT WORKED! THanks again PHPFREAK 4 LIFE! :-X
×
×
  • 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.