Jump to content

ali_kiyani

Members
  • Posts

    61
  • Joined

  • Last visited

    Never

Posts posted by ali_kiyani

  1. Hi,

     

    I have written this code to read from a text file line by line and print on screen. But problem is it prints all text in one line.

     

    $handle = @fopen("myfile.txt", "r");
    
    if ($handle)
    {
    while (!feof($handle))
    {
    	$buffer = fgets($handle, 4096);
    	echo $buffer;
    }
    fclose($handle);
    }
    

     

    The contents of myfile.txt are:

     

    line 1

    line 2

     

    So it should print them in this order but rather it prints in the following way:

     

    line1line2

     

    What is wrong with the code?

  2. Hi,

     

    I have a web page that displays CVs submitted by users (in DOC, PDF or RTF format). CVs are stored in a folder for e.g. user_cv

    Admin can select the CVs to be printed and then click on Print button. This should send all documents to printer for printing. How do I do that in PHP?

    Please check following screenshot.

     

    screenshotfe8.th.jpg

     

    Thanks

  3. Hi,

     

    How can I send any ringtone to a mobile phone using PHP? I am not looking for any conversion softwares that make ringtone compatible with mobile phone. Let's say I have the phone number, ringtone e.t.c and now I want to create a web page where I will enter that number in text field, attach ring tone and press the SEND button. How do I do that?

     

    Thanks!

  4. Cool...this one worked! thanks  ;D

    But there is one problem though

     

    In my user.php file I am printing $_GET["userid"] to see its value and this is happening

     

    1. When I go to URL www.mywebsite.com/ali_kiyani then it prints home

    2. When I go to URL www.mywebsite.com/ali_kiyani.php then it prints ali_kiyani

     

    I think that 'home' in first point is the base directory which it shouldn't be printing and rather it should print 'ali_kiyani' like in point 2 but with out having to write .php in the end.

  5. Ok I did as you said. Opened .htaccess file and wrote that code in it (there was already some code written in that file so I appended it with new code)

    Then I created a file user.php for testing in which I wrote

     

    if($HTTP_GET_VARS["userid"] == "1")
        print "ONE";
    else
        print "TWO";
    

     

    Now when I run this page http://www.mywebsite.com/user.php?userid=1 then I get the following error

     

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

     

    Please contact the server administrator, webmaster@mywebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

     

    More information about this error may be available in the server error log.

     

    Not only that the other PHP pages in the same directory which were working previously are also showing the same error.

  6. Hi

     

    I have a web page where user registers. Each member is given its own URL based on the user name he gives during sign up. So for e.g. if some one entered "Smarty" then his web page URL will become

    http://www.mywebsite.com/Smarty

     

    On this page user's image and other details are shown. So if my website has 1000 users then 1000 URLs will be created like above.

    How can I do this in PHP? Shall I use MOD_REWRITE or there is some other solution?

     

    Thanks

  7. Hello

     

    Is there a way of sharing sessions between PHP and ASP.Net 2.0 page if they are both in the same directory?

     

    Let's say I have a PHP page page1.php with the following code:

     

    <?
    $_SESSION['testing'] = "1";
    ?>
    
    <a href="page2.aspx">Go to Next Page</a>

     

    In page2.aspx (which is ASP.Net 2.0 page) following code is written:

     

    Response.Write("testing")

     

    But it doesn't print anything because sessions values between these pages is not shared. Any idea how to do that? I don't want to use query string or form methods because I want to hide the values being passed between pages.

     

    Thanks

  8. ello,

     

    My client wants to integrate Paypal in his website that I am developing in PHP. The process is simple, users adds one or more products in shopping cart, at the end he presses the CHECKOUT button which takes him to Paypal website where he enters credit card details.

     

    Now clients wants to know what exactly I need from him to integrate? Shall I ask him to provide his email!? that's it!? or some other paypal ID or number is also required!?

     

    Thanks

  9. Problem is solved. I didn't change anything in my code and it is working. May be host made some changes.

    But strange thing is....the code I am using above is for product images....and dir permissions are set to 755 and it is uploading!!

    But the same code is not working for category images (another directory).....I had to set dir permissions to 757 to make it work.

  10. Hello

     

    I developed a site for one of my client. The site was working fine on one host but when he moved to another host, file upload feature stopped working. I am using simple file upload code as below:

     

    if(isset($_FILES['image']))
    {
         $target_path = "../images/products/";
    
         $target_path = $target_path . basename($_FILES['image']['name']);
            
         $upload_result = move_uploaded_file($_FILES['image']['tmp_name'], $target_path);
    }
    

     

    I have double checked that the directory I am uploading to is writeable.

     

    When I contacted the host they say that I need to set following TMP dir for uploads to work

     

    /home/www/mysite.com/tmp/

     

    How do I make changes to my code!? I mean how can I set this dir in my code!? Or do I need to do something else?!

     

     

    Thanks

×
×
  • 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.