Jump to content

searls03

Members
  • Posts

    907
  • Joined

  • Last visited

Everything posted by searls03

  1. how do I order two tables by date so that the most recent are first and the most unrecent last? like table 1 should be first then a table 2 then a table 1. does this make sense?
  2. how can I make it so that a new field will pop up when the field has value, the new one will come up? then same thing for the one after that, and after that, etc. here is the code I found: <script> var counter = 1; var limit = 10; function addInput(divName){ if (counter == limit) { alert("You have reached the limit of adding " + counter + " inputs"); } else { var newdiv = document.createElement('div'); newdiv.innerHTML = "<br><input type='file' name='uploadedfile[]'>"; document.getElementById(divName).appendChild(newdiv); counter++; } } </script>
  3. what would be a good google search? I cant seem to find anything at all
  4. what is the ajax called? I never used ajax before? or how do I set it up?
  5. Do you have any idea what it would be called?
  6. ok, so how can I grab $value before the form submits and I want to put it into the image field: <?php include_once "secure/connect_to_mysql.php"; function genRandomString($length = 20) { $characters = '0123456789'; $string =''; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } return $string; } if ($_POST['submit']) { $name = $_POST['name']; $id = $_POST['id']; $image = $_POST['image']; $event = $_POST['event']; $template = 'Templates/index.php'; $picture = '$name.png'; $id = genRandomString(); //this could be the uploaded picture //we need just the filename - no extension $picture_name = pathinfo($picture, PATHINFO_FILENAME); $sql = "INSERT INTO pictures (name, id, image, event) VALUES('$name', '$id','$image','$event')"; $rs = mysql_query($sql) or die ("Problem with the query: $sql<br>" . mysql_error()); echo mysql_error(); $target_path = "images/"; foreach ($_FILES["uploadedfile"]["name"] as $key => $value) { $uploadfile = $target_path . basename($_FILES[uploadedfile][name][$key]); //echo $uploadfile; if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'][$key], $uploadfile)) { echo $value . ' uploaded<br>'; } } copy($template, "$name.php"); } ?> <form action="new.php" method="post" enctype="multipart/form-data"><input name="name" type="text" /><input name="id" type="hidden" value=<?php echo $id; ?> /><br /> <input name="event" type="text" /><input name="image" type="text" value="images/<?php echo $value; ?>" /><input type="hidden" name="MAX_FILE_SIZE" value="900000000000000000000000000000000000000000000000000000000000000000000000000" /> Choose a file to upload: <div id="dynamicInput"> Entry 1<br><input type="file" name="uploadedfile[]"> </div> <input type="button" value="Add another text input" onClick="addInput('dynamicInput');"> <br /><input name="submit" type="submit" value="submit" /></form> if I do it after the form submits then it shows up, is there a way to make it appear before it submits....like a second field echoing what the first field has typed it and it updates "live"?
  7. one last question......how do I pull just the file extension from a picture name? I want it to go where I have put 5 * at in the code.....I hope this makes sense. $picture_name = pathinfo($picture, PATHINFO_FILENAME); $sql = "INSERT INTO pictures (name, id, image, event) VALUES('$name', '$id','$image','$event')"; $rs = mysql_query($sql) or die ("Problem with the query: $sql<br>" . mysql_error()); echo mysql_error(); } copy($template, "$name.php"); ?> <form action="new.php" method="post" enctype="multipart/form-data"><input name="name" type="text" /><input name="id" type="hidden" value=<?php echo $id; ?> /><br /> <input name="event" type="text" /><input name="image" type="hidden" value="images/<?php echo $name; ?>*****" /><input name="submit" type="submit" value="submit" /></form>
  8. never mind, I figured it out.......
  9. how do I make the $image piece so that it inserts "images/$image.php" into the database? VALUES('$name', '$id', '$image','$event')";
  10. so now I have it working.... <?php $template = 'Templates/index.php'; $picture = 'lolcat.png'; //this could be the uploaded picture //we need just the filename - no extension $picture_name = pathinfo($picture, PATHINFO_FILENAME); copy($template, "$picture_name.php"); ?> how can I make it so that I can post certain pictures with this page that will show up? I want to use a jquery object with this also. how can I do this? If it doesn't make sense let me know
  11. ok, I want this to post to the main, public folder............ how do I do that? and how would it be that I could apply a dreamweaver template for the template?
  12. I don't want to mark it solved quite yet.... Am not at a computer where I can try the code right now. I want to make sure it works be fore I mark it as solved.
  13. Sorry, I am nor really a describing type of person. I like more to show, but can't really do that. And thanks, I was just checking to see if that's what it does that you gave me.
  14. Will that create a new page from a form that people can enter the URL to see? And them the picture is on the page? I know the picture on page is a bit new thing I added here......
  15. i don't know what this would fall under, but it sounds like php..........is there a way to make a form make a new page from a template........like I have a picture page and I can upload pictures from a form with a picture name....and that name turns into a /name.php file? does this make sense?
  16. could you help me turn this into a correct array? I am new to arrays....thanks: <?php // Where the file is going to be placed $target_path = "secure/upload/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $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!"; } ?>
  17. would that also be what I could use to make it so a new one automatically pops up?
  18. how do I make document upload fields like the ones that are on this website where there is a link at the bottom to make another field appear, or make it so that a new field automatically appears when the first one has info in it. Does this make sense? and also how would i make these submit with the form seeing as that they would have different field names, wouldn't they?
  19. searls03

    links

    I forgot thats called an anchor, but how do I hide info until the anchor is clicked?
  20. searls03

    links

    how do I make content display according to a #link thingy.......like example.com/ex.html#1234. is this the correct format? how do I make thinks display according to it?
  21. Ok, so I am using a jquery lightshow, how do I make it so that the thumbnails will display for all images inside the folder, so that I don't have to enter the folder manually. does this make sense?
  22. That's mainly because I am so close to being done!!!! Any help?
  23. or make a document and upload it.....
×
×
  • 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.