Jump to content

upperbid

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

upperbid's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm good at PHP but don't know much about JavaScript. I am stuck on this job because I cannot figure out how to pass the file name(s) (there can be more than one) from the one page to the next or even how to print the file name(s) cause the code for uploading the file to the server is all in JavaScript. I need to be able to identify the file names somehow, and then to pass them using PHP. I have already passed everything else on the page, I just can't get this. Any help would be appreciated. Here is the code for the function: function add_file(file) { var j = i - 1; var box = document.getElementById('file_list'); var num = box.length; var file_exists = 0; if (file_exists == 0) { // For Internet Explorer try { el = document.createElement('<input type="file" name="userfile[]" id="file_' + i + '" size="30" onChange="javascript:add_file(this.value);">'); } // For other browsers catch (e) { el = document.createElement('input'); el.setAttribute('type', 'file'); el.setAttribute('name', 'userfile[]'); el.setAttribute('id', 'file_' + i); el.setAttribute('size', '12'); el.setAttribute('onChange', 'javascript:add_file(this.value);'); } if(i==0){ document.getElementById('frontfiles').innerHTML='No file Selected'; } else { document.getElementById('frontfiles').innerHTML=i+' files Selected'; } document.getElementById('file_' + j).style.display document.getElementById('file_' + j).style.display = 'none'; if (document.getElementById('list_div').style.display == 'none') { document.getElementById('list_div').style.display = 'block'; } document.getElementById('files_div').appendChild(el); box.options[num] = new Option(file, 'file_' + j); i++; } } And here is the form part: </div> </div> <div class="Printing3_Box1"> <!--printContact--> <div class="uploadtxtCover"> <!--uploadtxt--> <div style="float:left; width:239px;"> <div class="chosefiles"> <!-- <img src="images/chosefile.jpg" alt="Chose file" /><br />--> <span class="chooseend"> Files to upload (FRONT) : <span id="frontfiles">No file selected</span></span><br /> </div> <div class="chosefiles"> <div name="files_div" id="files_div" style="float:left;"> <input type="file" name="userfile[]" id="file_0" size="12" onChange="javascript:add_file(this.value);"> </div> </div> <div class="chosefiles"> <div name="list_div" id="list_div" style="display: none;"> <select multiple name="file_list" id="file_list" size="8" style="width:190px; height:22px;"></select> <br> <input type="button" id="remove_file_btn" value="Remove Selected" onClick="javascript:remove_file();"> </div> </div> Please keep this simple if you can help. I need to get names like this: [folder]/[file name].[ext] e.g. files/108078.jpg If someone can tell me how to make the variable in PHP from the above code, I can probably easily pass the data along with the rest of the data I already got working. Thanks for any help Robert
  2. You know, Thorpe, your arrogance is ugly and your constant need to be critical of others in an attempt to make yourself look intelligent is annoying. These unnecessary statements: I'm sure were not going understand that concept. What other suggestions do you want? So you have a dedicated box but no idea how to administer it? show your true insecurity and some dire need to appear intellectual to others at the expense of others. As shocking as this may seem to you, I don't want your help, take your suggestions and arrogance to someone else. Believe it or not, I've done fine in server administration and programming long before you came along, as hard as that must be for you to believe.
  3. Hi ym_chaitu, I already found this script in other posts on the web. I just tested it again and it doesn't work for what I'm trying to do. The image from the source (a different website) does not appear on the page. Like I said, I've looked around and spent quite a bit of time on this and so far, I have not found a script or any code that accomplishes this. Anybody can test it by trying to display any image from any site on their site with a the display of a different URL. If anyone figures out how to do this with PHP, please let me know. Thanks.
  4. Thorpe, The first site already has the files in a designated folder and I am not able to change that folder without a lot of script work, so I can't move the images. Any other suggestion? Oni-Kun, I tried what you suggested, but it doesn't work. It's similar to other posts I've found. The page where I post the <img src='image.php?image=file.jpg'/> does not display the image that would be found at the URL in the image.php file with the code below: <?php $file = $_GET['image']; echo "http://www.othersite.com/images/". $file; > I wish that worked, because that is what I'm looking for--a simple solution.
  5. Hi Oni-Kun, I tried several of these solutions as well and I could not get them to work. I could get it to work when the source was on the same URL, but not coming from a different URL. Maybe I was doing something wrong, but I tried several different solutions I found in online posts and I just could not get them to work (but they were all talking about masking the image on your own URL).
  6. Hi Thorpe, I was hoping for something with a PHP solution, but I do have access to the server since I have the whole server, but I don't really know how to mask the image URL on the page so that it shows a different URL than the source. I've read posts about the access file but none of those worked when I tried them (my source is a different domain--though it is on the same server).
  7. Any other suggestions or help on this?
  8. I own several websites on the same server and I want to use images in one folder for a second site, but not show the URL of where my images are coming from on the second site. In other words, say the original images are at firstsite.com in a folder called images. I want to display them also on a second site we can call secondsite.com but show the image URL as secondsite.com (not firstsite.com where they are really coming from). I am pretty sufficient at php, but I have not been able to figure out how to do this. Any help would be appreciated. Thanks.
  9. As I already said, it saves fine, so the insert code is irrelevant. It saves exactly what it should to the database (exactly what I input). As for the display code, it is a simple select statement and I have removed all additional manipulations of the retrieved data to that for now since none of them worked on solving the problem. It happens from a simple select and while display. Since writing this, I have also discovered that this does the same thing in a text input box as well as textarea. It also sends this same weird text to the webpage, too.
  10. I am having a problem with a MYSQL update from a textarea box. Here is what happens, if I type in: <FONT face="Verdana"> then hit submit, it saves correctly, but returns this when I view it in a form textarea box: " ><FONT face="Verdana"> After a lot of trial and error, I narrowed it down to: "> then hit submit, it saves correctly, but shows below in the textarea box: " >"> Anybody got any tips on how I can display this correctly. I already tried strip slashes, mysql_real_escape_string, htmlentities, trim and none of those work. By the way, in case it matters, I have magic quotes on. Any help would be appreciated.
  11. I have been trying to solve this problem for hours, read all the posts and tried a few I found, but no luck. I have a form preloaded with data from a mysql database. The page pulls about 40 rows from the mysql database at this time. Each row has a checkbox and prefilled input in the fields that can be changed and then updated by checking the checkbox and then hitting the submit button. The problem is that no matter what boxes I check, it updates the wrong rows (unless I select the first row or first and second if updating two rows at once, etc.). It updates the rows starting at the first one displayed on the page, then the second one if I select more than one. Anyhow, I have placed the code into a simple script to simply display the right rows and I can't get it to work. The only thing that is displayed correctly is the ID, but not the sortid or the title. Any help would really be appreciated. Here is the code: while($r=mysql_fetch_array($result)) { $id = $r["id"]; $sortid = $r["sortid"]; $title = $r["title"]; echo "<tr><td>$id<input type=\"checkbox\" name=\"update[]\" value=$id/> <input type=text name=\"sortid[]\" value=$sortid size=1> echo "<input type=text name=\"title[]\" value='$title' size=45></BR></td></tr>"; } ///the form submit button is here, but I left it our to make this code simpler since the form submit is working fine. $checkbox2 = $_POST['update']; $usortid = $_POST['sortid']; $utitle = $_POST["title"]; if (isset($_POST['changes'])) { if (count($checkbox2) > 0) { for ($i=0;$i<count($checkbox2);$i++) { $up_id = $checkbox2[$i]; print $up_id; print $usortid[$i]; print $utitle[$i] . "</br>"; } } }
  12. I am wanting to run some php code within a page with a .cgi extension on a site that runs with perl. I have server access. How can I do this? Any help would be appreciated.
  13. I resolved this by using strictly MYSQL to pull the results with a SELECT statement for multiple tables with various WHERE requirements.
  14. I actually meant two different tables in the same database. I wanted to modify the original post, but I don't see an option to do so.
  15. Say I first generate a list of results of purchases from a specific user from a database showing the product number with all the other data, which I can already do successfully. For example, results currently are like: Product number, Description, Quantity, Price 7897797, chair, 1, $49.99 8797879, stool, 2, $24.99 6897679, table, 1, $149.99 I then need to further limit those results based on criteria from another database which only gives information on the product, such as the manufacturer but does not contain any of the purchase information. Say I wanted to only return the results of the purchases from that buyer that were from a manufacturer called Tom's Wood which would be stored in another database. I can use the product number from the first results since the product number is the common factor in both databases, but I'm not quite sure how to do this second part. I would like the result to return both parts for the specified criteria (in this case all purchases from the buyer with the specified manufacturer Tom's Wood) together like: Product number, Manufacturer, Description, Quantity, Price 7897797, Tom's Wood, chair, 1, $49.99 8797879, Tom's Wood, stool, 2, $24.99 Any suggestions would be appreciated.
×
×
  • 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.