Jump to content

timt

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

About timt

  • Birthday 02/21/1952

Profile Information

  • Gender
    Male
  • Location
    San Antonio, TX

timt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello Freaks, Trying to perform a simple image swap of some photos for a product. I am a js novice. 1. load glogal vars for photos. 2. define function to preload photos. 3. call preload function on load. 4. reference img tag with unique name (ex. name="prd7"). 5. on the swap link, change src (ex. document.pdr7.src=prd7photo2.src). Help please. Tim T. . . . <script type="text/javascript"> var prd7photo1 = new Image(); var prd7photo2 = new Image(); var prd8photo1 = new Image(); var prd8photo2 = new Image(); var prd9photo1 = new Image(); var prd9photo2 = new Image(); function loadPhotos() { prd7photo1.src='admin/upload/store7Photo1Sm.jpg'; prd7photo2.src='admin/upload/store7Photo2Sm.jpg'; prd8photo1.src='admin/upload/store8Photo1Sm.jpg'; prd8photo2.src='admin/upload/store8Photo2Sm.jpg'; prd9photo1.src='admin/upload/store9Photo1Sm.jpg'; prd9photo2.src='admin/upload/store9Photo2Sm.jpg'; } </script> </head> <body onload="javascript:loadPhotos()"> . . . <a href="admin/view_photo.php?p=7Photo1" target="_blank"><img src="admin/upload/store7Photo1Sm.jpg" alt="Lucky - Denim Shirt" name="prd7" width="200" id="prd7" /></a><br /> <div class="views"> <a href="javascript:void(0)" class="sub-menu" onclick="javascript:void('document.prd7.src=prd7photo1.src')">Front</a> • <a href="javascript:void(0)" class="sub-menu" onclick="javascript:void('document.prd7.src=prd7photo2.src')">Detail</a> </div>
  2. Ok, I agree it's not practical.
  3. I want to try FTP for large file uploads. How do I capture the pathname for the $source_file from the client? I want the client to browse for their file using the "type=file" then submit. When using $_FILES['file']['name'] it only provides the base filename without path. Here is the example from the manual that I am trying to use. <?php // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream ftp_close($conn_id); ?>
  4. The lag is probably due to the scaling time. I recommend you scale the image to the viewing size (80x80) and store it at that size.
  5. Looks Ok, except you need 3 different action values such as all, maint and over. Then test for each via $_GET[] just like you have and display your results. What else do you need help with?
  6. Ok, I'm confused. Usually the id field is for css formating or js scripts. Why are you using [] like an array? The name field is the posting variable. Are you posting then updating the table?
  7. If you are going use mysql, then reference the manual for the correct syntax: http://us.php.net/manual/en/ref.mysql.php If you are not familar, then go read a tutorial. There are plenty on the web.
  8. Ok. Where do you want to start?
  9. That means you do not have that class of functions available. Use mysql. Remove @ sign and try this. $db = mysql_connect( 'localhost', 'bookorama', 'bookorama123' );
  10. I read through it. $items appears to be an array of item id's that the customer selected. $contents appears to be an attempt to get rid of empty nodes (does not look right). I would code it directly like this: $contents = array(); $cnt = 0; foreach ($items as $item) { if (isset($item) { $cnt += 1; $contents[$cnt] = $item; } }
  11. I would build a function using switch, like this. It is much cleaner and faster than nested ifs. Normally you would use break; after a case: however you are returning immediately. function findLinkSource( $row3 ) { switch( $row3 ) { case "http://[webpagename].com": return 'A'; case "http://[webpagename].com": return 'B'; case "http://[webpagename].com": return 'C'; ... check all you need ... default: } } // call function like this $linksource=findLinkSource( $row[3] );
  12. Also, remove the "" from the string variables passed to mail(). It cause an extra transformation. Move your headers assignment before the while loop. same headers for every email.
  13. OOPS. The code was eaten by this browser. The code starts with &#x which means here comes a character in hex, the value is D (or 13 decimal) which is carrage return and it ends with ;
  14. The is a carriage return character expressed in html hex which was picked up at the end of the line you read. It marks the end of the line. Search for it and strip it off.
  15. Almost, you need a } before the else. Also, you have mixed variable results - text and numeric.
×
×
  • 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.