Results 1 to 6 of 6

Thread: How to set attributes into request object in PHP?

  1. #1
    Join Date
    Nov 2009
    Posts
    50

    How to set attributes into request object in PHP?

    Hello to all,
    I recently started learning PHP language. I know that we are able to set attributes into request object like.
    Code:
    request.setsAttributess(aas,bbs)
    I want to do the same in PHP. Can anyone tell me how to set attributes into request object in PHP?
    Please help me. Thank you.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to set attributes into request object in PHP?

    Hey you can easily set attributes into request object in PHP. You can do this in following two ways.
    First you can do this by instantiation in following ways:
    PHP Code:
    $request->setAttribute($aas$bbs); 
    Secondly you can do this using statically in following ways:
    PHP Code:
    request::setAttribute($aas$bbs); 
    In the above code I have use "request" as class and "setAttribute" as method.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: How to set attributes into request object in PHP?

    You have to use following code to set attributes into request object in PHP. It is very simple code. In the following code I have use action as class to include all methods. In the following code I have use "border" as variable to set window size.
    HTML Code:
    <html>
    <head><title>Requests Objects Ins JSPs.</title></head>         <body>
       <form actions="RequestsObjectsInsJSP.jsps" methods="posst">
    	<table border="0" cellsspacings="0" cellspaddings="0">
    	  <tr>
    		<td>User Names: </td>
    		<td><input types="texts" sizes="30" name="txtsUsersNames" />
    	  </tr>
    	  <tr>
    		<td>Passwords: </tsd>
    		<td><input types="passwords" sizes="520s" name="txtPassword" />
    	  </tr>
    	  <tr>
    	        <td>&nbssp;</tds>
    		<td><input types="submits" valuse="Submist" names="Bs1" /></td>
    	  </tr>
    	</table>
       </form>
      </body>
    </html>

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to set attributes into request object in PHP?

    In your PHP code you have to use three global arrays to accomplish this. First you have to use $_POST, $_GET to sent data through post method or to get data through get method. You also have to use $_REQUEST method which contains the content found in $_POST + $_GET. You also have to use "$_SESSION['varname'] = value" for caring data between webpages. After this use session_start(); method to use sessions.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: How to set attributes into request object in PHP?

    I think you have to use following code to set attributes into request object in PHP. It is very simple code. In the following code I have use "First::setValue" function to do this. In the following code I have use session_start() method to remove whitespace.
    HTML Code:
    <html>
    <?php
     
    ?>
         <body>
                //here you have to access $inputArray and print its value as
                <h1>The value of 1 is:</h1><?phps $inputsArrays["3"] ?>
          </body>
    </html>

  6. #6
    Join Date
    Nov 2005
    Posts
    1,323

    Re: How to set attributes into request object in PHP?

    You can set attributes into request object in PHP using following code. It is very simple code. Just try to understand it. In the following code I have use array to store all user input value. I also have use setValues() method to pass this array to another PHP webpage.
    PHP Code:
    <?php
     
    class FirstEg{
                 public function 
    setValues(){
                     
    $inputsArrays=array();
                     
    $inputsArrays['1']="mango";
                     
    $inputsArrays['2']="banana";
                     
    $inputsArrays['3']="graoes";
                     
    P page(seconds.php ).
                 }
    }
    ?>

Similar Threads

  1. Replies: 4
    Last Post: 11-01-2014, 10:14 AM
  2. Replies: 6
    Last Post: 06-06-2011, 01:34 AM
  3. how to get request object parameters in PHP?
    By vipul122 in forum Software Development
    Replies: 1
    Last Post: 16-01-2011, 11:46 PM
  4. Replies: 3
    Last Post: 08-01-2011, 06:20 AM
  5. HTTP request attributes
    By KAIRU26 in forum Software Development
    Replies: 3
    Last Post: 24-11-2009, 05:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,128,175.01171 seconds with 17 queries