Jump to content

invincible_virus

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Posts posted by invincible_virus

  1. Thanks teng84.

    Actually, I have a text-label & a combobox inside that <div> tab.

    Now, after using <div style="text-align:center"> -

    1. text-label is center aligned.

    2. combobox is still left aligned.

     

    text-align property only works for text & not for any html elements.

  2. I have a div tag, with some other HTML elements in it.

    <div align=center>
    ...
    <div>

    can I achieve the effect of "align=center" in the div tag using css somehow?

    I can align the text using text-align property, but it doesn't work for HTML elements.

    {text-align: center}

    Thanks,

    Saurabh

  3. I've seen the documentation of curl_init() and it says -

    Initializes a new session and return a cURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions.

    There is no option to set the session id.

    can you please tell me where can I pass that?

     

    Thanks...

  4. Hi,

     

    My requirement is to initiate a HTTP post request using php code.

    There are two ways I know, both having their limitations -

    1. Doing

    header("Location:./redirected.php");

    It will redirect the browser to redirected.php, but there is no way I can specify POST variables.

     

    2. Using cURL

    		$redirect_handler = curl_init();
    	curl_setopt($redirect_handler, CURLOPT_URL, SITE_ROOT."redirected.php");
    	curl_setopt($redirect_handler, CURLOPT_RETURNTRANSFER, 0);
    	curl_setopt($redirect_handler, CURLOPT_TIMEOUT, 60);
    	curl_setopt($redirect_handler, CURLOPT_POST, 1);
    	curl_setopt($redirect_handler, CURLOPT_POSTFIELDS, $post_fields_array);
    
    	curl_exec($redirect_handler);
    
    	if (curl_errno($redirect_handler)) {
    	    print "Error: " . curl_error($redirect_handler);
    	}
    	curl_close($redirect_handler);
    

    This one is pretty good as I can redirect the browser to redirected.php with some POST data. But, this will create a new session and I loose data set in the session.

     

    Is there any way using which I can preserve both POST & SESSION variables data ?

  5. Hi,

     

    I had developed a web-site using php 4. Now, I have upgraded to php 5.

    I have a form which is something like -

    <form name="formPG" method="post" action="search.php" style="margin: 0pt;" >
    <tr>
    <td colspan="2" align="left" valign="top"><select class=textboxes1 name="Budget">
    <option selected value="1">Select</option>
    <option value="2">1000-2000</option>
    <option value="3">2000-3000</option>
    <option value="4">3000-4000</option>
    <option value="5">4000-5000</option>
    <option value="6">Above 5000</option>
    <option value="7">Negotiable</option>
    </select></td>
    </tr>
    </form>

     

    and a php file acting on this form submit, which reads the request params as -

    $Budget

     

    Now, my problem is that after upgrading to php 5, this variable is never read by th action file properly and its value is always 0.

    I tried to read through the backward incompatibility issues with php5, but could not find this one listed there.

    Do I need to change the whole code to be like -

    $_REQUEST['Budget']

  6. Hi,

     

    I have apache2 http server installed on Fedora 8.

    I generally log in as non-root user, so I wanted to change document root in httpd.conf to "/home/saurabh/mysite".

    After changing the files, when I try to start http server, I get an error -

    Starting httpd: Syntax error on line 280 of /etc/httpd/conf/httpd.conf:

    DocumentRoot must be a directory

    Also, I get a pop-up error saying

    SELinux

    AVC denial. Click here to view.

    But, when I click, nothing appears.

     

    Any Ideas??

     

  7. I have two files, file1.php is having 5-6 utility functions to be used in file2.php
    One way to call any function of file1.php in file2.php is to
    [code]include "file1.php"[/code]
    in file2.php..

    Actually I only want to call only function in file2.php, can it be a performance issue to include the whole file??
    is there any other way of calling this function from file2.php
  8. Actually, I want to set these variable in some request object, so that I don't need to unset them on the destination page.
    Like in J2EE, there variables can be set in session object or request object, is there any equivalent of J2EE's request object in PHP ??
  9. We can redirect a request to another url using something like -
    header("Location:./xyz.php");
    Now, I want to redirect to xyz.php with some variables to be set in request object. I know one way of doing a redirect to xyz.php?name=value.
    But, I don't want all my variables to be visible in address bar.
    Any idea abt how to do it??
×
×
  • 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.