Jump to content

kool_samule

Members
  • Posts

    169
  • Joined

  • Last visited

Everything posted by kool_samule

  1. Hi, thanks for the reply, sorry if this is a stupid question but where would I set UTF-8, I have a form where users can select a file to upload, which is posted to a script page, which does the work. So is it the select (form) or script page that needs to be told to use UTF-8?
  2. Hi Chaps, I have a PHP FTP app where users can up/download files. Our company deals with foreign languages, so some of the files may have special characters, such as (German) umlauts. Uploading files with umlauts seems fine, but when I download a file, it goes from: to Is there any way to get round this, so it keeps the correct file name? Cheers
  3. Hi Wolphie, thanks for the link, I take it this is a plugin itself, what I'm after is much simpler. Even a 'Please Wait' animated gif would do the job, but I don't know how to impliment it. . . .
  4. Hi Chaps, I'm looking for a 'preloader' progress bar to appear whilst a file is uploaded/downloaded from my php app. Not sure whether this is a Java/Flash question, but any help would be appreciated. Cheers
  5. Cheers dude, I'm sure I'll have another question soon!
  6. Hi Chaps, I have a basic PHP/FTP Application, which will be accessible to some of my company's freelance workers. // FTP Credentials $ftpServer = "www.domain.co.uk"; $ftpUser = "UserName"; $ftpPass = "Password"; set_time_limit(0); // Connect to FTP Server $conn = @ftp_connect($ftpServer) or die("Couldn't connect to FTP server"); // Login to FTP Site $login = @ftp_login($conn, $ftpUser, $ftpPass) or die("Login credentials were rejected"); This will take me to the root of 'www.domain.co.uk', but it will give everyone access to everyone else's folders, which I don't want. Freelance workers have a 'freecode' which is unique to them, so I'm looking for is to change the default 'root' directory to 'www.domain.co.uk/'FREECODE''. I've tried this already, but I get a connection to FTP error. Is there anyway of getting round this.
  7. Hi Chaps, I've managed to view the contents of an FTP site and have upload files successfully. I'm using the ftp_nlist/ftp_rawlist to build an array of the files in a given directory, but how can I browse through the directories (in a similar way to deault FTP / Windows)? Cheers
  8. Booooom! Awesome, works like a charm. . . .Cheers Dude!
  9. Hi Chaps, I've got access to my FTP site through my PHP App, can create a directory, and read the contents of the directory. I'm now trying to upload files to a directory: // Upload // Local File $local_file = 'C:/01.pdf'; // Remote File $remote_file = $workingDir.$dir.'01.pdf'; // Upload File to Active Directory $upload = ftp_put($conn, $remote_file, $local_file, FTP_ASCII); // Check Upload Status: print (!$upload) ? 'Cannot upload' : 'Upload complete'; print "\n"; Locally, 01.pdf is 2630Kb but the upload takes for ever and never reaches the same file size on the FTP site. I've tried it with word docs (24Kb), the upload takes no time at all, but appears as 1Kb on the FTP site and is obviously corrupt and fails to open. How can I make sure that the file is copied correctly to the site? Cheers
  10. Looks like I had my FTP path wrong, it was trying to create a directory on the root, rather than in one of the accessible directories within the FTP site. Now sorted!
  11. I have just tested creating a new directory using CuteFTP Pro and I got an error: Do you know what I should look for to get both FTP Client and my Web App to work correctly?
  12. Hi Chaps, I'm tyring to make a PHP / FTP Application, where users can view/download/upload files in a given FTP site. I can connect to the FTP server, login using the credentials, but when I try to upload, or create a directory, I get: Line 16: if (ftp_mkdir($conn_id, $dir)) { echo "successfully created $dir\n"; } else { echo "There was a problem while creating $dir\n"; } As before, the credentials are correct, but I think there is a security issue somewhere what is blocking access. If anyone has any ideas what this could be, please share the wealth! Cheers
  13. thanks for the reply, I think I'll dump the data only, then when restoring the data, truncate the tables, then load the data
  14. Hi, thanks for the reply, I found TRUNCATE, but don't think you can add it to the dump options ????
  15. Hi Chaps, I have a CMD prompt script that will dump only the data from my database (dbjobs): mysqldump -u 'username' -p'password' --no-create-info --complete-insert dbjobs > c:/database_data_only.sql But when I try to restore the data, I get multiple errors: e.g. ERROR 1062 (23000): Duplicate entry '1' for key 1 Is there something that I can add to the mysqldump command that will solve this issue?
  16. Hi bugcoder, thanks for the link, but in the XML DataFeed bit it says to sign up for $540. I'm looking for a free service.
  17. Hi Chaps, I'm looking for an PHP script that will read an XML feed/file to show the current exchange rate from Euros into US Dollars and GB Pound Sterling. I've found an XML file: http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml But I'm not sure how to just pull through the values for USD/GBP, into PHP variables. If there is an easy/better way to get the same result, then I'd be glad to learn.
  18. OK chaps, Currently, I have a database with a (translation) projects table, and 3 jobsheet tables linked to the projects table by a foreign key. Each jobsheet can only have 1 'target' language, along with 'wordsgross'. What I'm after is a 4th table which can contain multiple 'target' languages, along with corresponding 'wordsgross', something like this: //TABLE: jobid (int) jobname (varchar) FK_projid (int) FK_langid (int) wordsgross (int) The FK_langid and wordsgross are the columns that need to be linked together, then repeated for each 'target' language. I'm not sure if this makes sense, the only other thing I can think of is a Car Insurance website when you need to 'Add Another Driver', then another, and another . . . .these multiple entries are still linked to same account, but allow 'unlimited' drivers (just like I need 'unlimited' languages). If my understanding of how to do this is completely wrong, please set me straight. Cheers
  19. Hi satya61229, thanks for the reply. That sounds like what I'm after, I know very little about js, so don't know to: a: pull through the customerid b: get js to recognise the customerid and show if = $something Can you give me a few pointers, or some informtion so I can research it further? Cheers
  20. Hi Chaps, I have a PHP form, with a Customer Select List. Once an option has been selected, the 'custid', is passed to Javascript that collects all the contacts linked to that customer and populates another Select List. This works fine, but what I'm after is an extra two inputs to appear when a particular customer is selected, but I'm not entirely sure how to go about it. Here it goes: Table/Form: <script type="text/javascript"> var ajax = new Array(); function getTextList(sel) { var Customer = sel.options[sel.selectedIndex].value; document.getElementById('text').options.length = 0; if(Customer.length>0){ var index = ajax.length; ajax[index] = new sack(); ajax[index].requestFile = 'getText.php?custid='+Customer; ajax[index].onCompletion = function(){ createText(index) }; ajax[index].runAJAX(); } } function createText(index) { var obj = document.getElementById('text'); eval(ajax[index].response); } </script> <table> <tr valign="baseline"> <th>Customer:</th> <td colspan="2" class="normal"><span id="spryselect1"> <select id="customer" name="FK_custid" onchange="getTextList(this)"> <option value="">Select Customer</option> <?php $result = mysql_query("SELECT DISTINCT custname, custid FROM tbl_customers ORDER BY custname") or die(mysql_error()); while($cust = mysql_fetch_array( $result )) { echo '<option value="'.$cust['custid'].'">'.$cust['custname'].'</option>'; } ?> </select><br /> <span class="selectRequiredMsg">Please select Customer</span></span></td> </tr> <tr valign="baseline"> <th>Customer Contact:</th> <td colspan="2" class="normal"><span id="spryselect6"> <select id="text" name="projcontact"> <option value="">--Select Customer First--</option> </select><br /> <span class="selectRequiredMsg">Please select a Project Contact</span></span></td> </tr> <tr valign="baseline"> <th>Purchase Order Ref:</th> <td colspan="2" class="normal"><input type="text" id="count" name="projporder" value="" size="32" /></td> </tr> <?php if ('CustomerID'=='XX'){?> <tr valign="baseline"> <th>Cost Centre:</th> <td colspan="2" class="normal"><input type="text" id="count" name="projcostcentre" value="" size="32" /></td> </tr> <tr valign="baseline"> <th>Cost Centre Contact:</th> <td colspan="2" class="normal"><input type="text" id="count" name="projcostcentrecontact" value="" size="32" /></td> </tr> <?php }; ?> </table> GetText.php: <?php require_once('../../Connections/conndb2.php'); $Customer = $_GET['custid']; if(isset($_GET['custid'])){ $result = mysql_query("SELECT * FROM tbl_contacts WHERE FK_custid='$Customer' ORDER BY contactname") or die(mysql_error()); while($text = mysql_fetch_array( $result )) { echo 'obj.options[obj.options.length] = new Option("'.$text['contactname'].'","'.$text['contactname'].'");'; } } ?> I know that I need the 'custid' to be set somewhere, but not sure at which point to do it. Any ideas welcome! Apologies if this is a Javascript question, if so I'll move this to a different forum.
  21. Hi Chaps, I have a form where a user can edit a quote, when the form is submitted, the info is POSTed to a script file, which processes the information and runs an SQL Query. The form has an OPTIONAL edit feature, when selected, POSTs an 'jobadminquote' array to the script. My local Apache server can handle the option either ticked or unticked, my live IIS server throws up an error when unticked: Line 65: Script Code: <?php $allowed_tables = Array('table1','table2','table3'); // to prevent SQL injection foreach($_POST['quote'] as $var) { $arr = explode(':', $var); if(in_array($arr[0], $allowed_tables)) { $table = $arr[0]; $rowid = $arr[1]; $projid = $arr[2]; $setprice = $_POST['jobquote'][$rowid]; $adminoverride = $_POST['jobadminquote'][$rowid]); if(is_numeric($rowid)){ if($adminoverride=='y'){ // Run SQL Query here to update $table where row matches $rowid } else { // Run Something Else } } else { $mess = "<p>There was a problem</p>"; } } } ?> My question is: is there a way to tell the script to ignore the $adminoverride = $_POST['jobadminquote'][$rowid]); if the $_POST['jobadminquote'] doesn't exist?
  22. Am I correct in thinking that if I change: Then I'll have to change the $i value (in the script file) in some way? ..In order to link the arrays correctly to update the database?
×
×
  • 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.