Jump to content

complex05

Members
  • Posts

    124
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://makincashonline.blogspot.com

Profile Information

  • Gender
    Not Telling

complex05's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, How do I remove an element from an array? Here is my current code $sql = mysql_query("SELECT suitenos FROM gssettings WHERE id=1"); $row = mysql_fetch_assoc($sql); $suites = split(",",$row['suitenos']); $number_of_suites = count($suites); for($i=0;$i<$number_of_suites;$i++) { if($suiteno == $suites[$i]) { $selected = "SELECTED"; } else { $selected = ""; } echo<<<endhtml <option value="$suites[$i]" $selected>$suites[$i]</option> endhtml; } Now I have another table in my database called "gsdays" that holds values of suite numbers that are already booked. What I want to do is remove any suite numbers that are already booked from my $suites array. To get the booked suites, I would do the following query. $query = mysql_query("SELECT suite FROM gsdays WHERE date='2007-03-24'"); $row = mysql_fetch_assoc($query); $booked_suites = $row['suite']; so basically what I want to do is remove $booked_suites from $suites. I tried using array_splice but I don't know what I'm doing
  2. Well since nobody helped me I managed to research it and find it myself... here are the answers.. no cache: Header('Cache-Control: no-cache'); Header('Pragma: no-cache'); then to get all the checkboxes to another page, name them as follows <input type=checkbox name=checkbox[$id]> then in the php page, treat $_POST['checkbox'] as an array. Hope this helps someone in the future.
  3. Two part question: #1. I've built a little AJAX app, but the problem is anytime I do an update, I have to delete my temp files before I can see the update. Is there anyway around this? #2. Is there a way to know all the variables submitted to a form without knowing what the variables are before hand? For example, I have a form, where there are checkboxes. Each checkbox's name is an ID value from the database. When I submit the form, I need to know all the rows that were checked...
  4. I highly recommend you read PHPFreaks' tutorial on file uploading. I have been using this class for years now and it works perfectly... and has a function to specify the file formats you want to allow. http://www.phpfreaks.com/tutorials/85/0.php Hope that helps!
  5. yeah I can't use move_uploaded_files() because the perl script has already uploaded it and moved it. I'm aware of the open, read, copy, save and delete method but some of these files are 25MB+... don't wanna break my server :(
  6. [code]$textarea = "this is some text with 15 words in it"; $words = split(" ",$textarea); for($i=0; $i<15; $i++) { echo $words[$i]; }[/code]
  7. what does your form look like? Are you sure you have the correct enctype?
  8. what does your 'stripurl' function look like?
  9. [code] $total = $amount1 + $amount2 + $amount3; $totalamount = number_format($total); mysql_query("INSERT INTO table (amount1,amount2,amount3,totalamount) VALUES ('$amount1','$amount2','$amount3','$totalamount')"); [/code]
  10. Hello, I'm currently using a perl script to upload files (i'm using perl so I can use an AJAX progress bar) however since I don't know perl at all and have no desire to, I would like to use a PHP script to do what I want to do. Right now, the perl script uploads the files to /uploads/ then redirects to a page called finished.php. I need the files to go to different directories depending on who is logged into the system. I need to know how to move a file to a different directory in PHP. Is there a function to do this? Thanks, Barry
  11. omg that saddens me to know that perl > php in this department :(
  12. Hello, I've searched all over the internet for an upload progress meter bar, and I found a few... but unfortunatley I can't get any of them to work because they all need different extensions and libraries that my server won't allow... so I need to write my own. I know how to do everything except, get the progress/status of an upload. Is there a function in PHP that lets you know how many bytes have been uploaded... or a way to constantly check the filesize of a file while it's being uploaded?
  13. well noone replied and i figured it out... if anyone was curious here was my solution: [code] if ($handle = opendir('/home/dtech/public_html/whereisit/maps/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { //echo $file; $image = exif_read_data("maps/$file",0,true); $images = array(); $images[$file]["lat"][0] = str_replace("/1","",$image['GPS']['GPSLatitude'][0]); $images[$file]["lat"][1] = str_replace("/1","",$image['GPS']['GPSLatitude'][1]); $images[$file]["lat"][2] = str_replace("/1","",$image['GPS']['GPSLatitude'][2]); $images[$file]["log"][0] = str_replace("/1","",$image['GPS']['GPSLongitude'][0]); $images[$file]["log"][1] = str_replace("/1","",$image['GPS']['GPSLongitude'][1]); $images[$file]["log"][2] = str_replace("/1","",$image['GPS']['GPSLongitude'][2]); print_r($images); } } } [/code]
×
×
  • 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.