Jump to content

ali_kiyani

Members
  • Posts

    61
  • Joined

  • Last visited

    Never

Everything posted by ali_kiyani

  1. Yes this is a very good solution. I did this and it worked...it solved the problem of hiding the URL and direct access of file To force file download I used Content-Disposition: attachment and every thing is in order now. Here is the sample code for others. [code]<?     if(isset($HTTP_GET_VARS['file']))     {         $myfile = $HTTP_GET_VARS['file'];         header('Content-Type: application/octet-stream');         header('Content-Disposition: attachment; filename='. $myfile);         readfile("../../". $myfile); //you need to change this code according to your directory structure     } ?> <a href="testdownload.php?file=php_icon.gif">Click</a> <!-- In the above line replace php_icon.gif filename with PHP variable containing file name. -->[/code]
  2. Hello I am trying to uplaod a file using ftp_put method. It is working fine but when I use ftp_size method to find file size, it always returns -1. I have tried everything but it always returns -1!!!!!!!!!!! I have heard that this function doesn't work on some server so I am confirming if it works on IIS or not!? Thanks Ali
  3. Hello, I am developing a small application in PHP on Windows IIS. Using this application users can upload a file and then send the URL to another user so he/she can download the file. I want to know as to how can I hide the URL of uploaded file from users!? Further more how can I make sure that they can't access the file directly! One more thing is I want JPEG, TXT and other files which can be opened directly in a browser to be downloaded just like ZIP, EXE and other files when some user clicks on the URL. These are the techniques used by all email provides like Hotmail, Yahoo and Google where you cannot see the URL of attached file and when you click on it, it downloads the file irrespective of its extension. Similarly you cannot directly access the file by typing it in browser. Thanks Ali
  4. I am also discussing this thing in another thread so if anybody can help me out I will be grateful. http://www.phpfreaks.com/forums/index.php/topic,119709.msg500615.html#msg500615
  5. Ok I downloaded Ezmlm from here http://www.unixpimps.org/software/ezmlm-php/ It's ezmlm-php-2.0.tar.gz. I am not sure if I downloaded the correct version or not because the ones available here http://www.ezmlm.org/archive/5.1.1/ are very complex and I don't know which file to install and how. Is there a basic ezmlm tutorial available? Secondly after installing the above file I am getting an error. You can see it here http://www.loopfile.com/mailinglist/ I am getting this error because it cannot find the ezmlm archive folder!! I have no idea what it is so any help will be appreciated. You need to define it in ezmlm.php configuration. The example given in that file is /usr/home/lists/ragga-jungle. This seems like a directory where mailing list archives are saved!? Any idea!? Thanks
  6. thanks jesirose! OK that means there is no way that we can do such kind of thing in PHP efficiently? and we have to rely on 3rd party softwares like ezmlm?
  7. Hello I have a client who wants to send newsletter to 30,000 users. I told him that I can write a script that will send letter one by one but he asked if there is any way we can send letters at once? What is the best method to send out 30000 newsletters? Please advise.
  8. Hello, I have an application in PHP where users upload different files to server. Q1. Is there a way I can check those files for virus when user uploads? Q2. If a virus is found in some file, how can I display message to the user? Q3. Let's say if I have a dedicated server with antivirus installed, what do I need to do to integrate it with PHP? Q4. Can this be done on shared hosting environment? Thanks
  9. Hi I have an index.php page which contain some include files. When I run this page it doesn't run the PHP code. It just displays HTML code. All images are being displayed dynamically by getting image name from database but it doesn't show any of the images. When I right click on image in IE and check its properties the image path is shown as http://localhost/mysite/images/<? $image_name ?> I tried running the code on IIS 5 (Win2K) and IIS 6(WinXP) but same problem. Then I ran it on Linux but there it displays all the text in Chinese language (or some other) and also displays all the PHP code as it is without running it on server.
  10. aha!!!! that solved my problem. Many thanks man!!!
  11. I am new php user and trying to display records from mysql. This thing is so simple in ASP but here it is like a pain in the ass. I tried running it on LOCALHOST (my own computer) and HOSTING SERVER (where my site is hosted) but no luck. Localhost runs PHP version 5.1.1 and Hosting Server runs 4.4.2. Here is my code: [b]$username = "root"; $password = "root"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die("<BR><font face=arial size=3 color=red>Unable to connect to database. Please try again later.</font>"); mysql_select_db("MyDB",$dbh);[/b] The above connection works and I am able to connect to the database on both LOCALHOST and HOSTING SERVER. [b]$sql = "select * from tbl_wagest"; $result = mysql_query($sql); if ($result) echo "true"; else echo "false"; $numrows = @mysql_num_rows($result); echo $numrows;[/b] Now the above piece of code doesn't print $numrows and the IF condition says FALSE which I think means there are no records. But the records are there in the table infact more than 100 but it doesn't print $numrows. This is happening both LOCALHOST and HOSTING SERVER. What am I doing wrong? :(
×
×
  • 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.