Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

how can we pass arguments from one class to another in php

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

how can we pass arguments from one class to another in php

Postby stephenrodrics » Fri Mar 29, 2013 2:13 am

I have 2 classes

1 parent class and 2nd child class which has controls

I want both class controls to show same text.

is there any way i can send combobox info like index or text inside combo from one class to other

example:

classP.php has one combo and function

<script type = "text/javascript">

function Monday()
{

parent.frames['iframe1'].Test1(); // this works perfect



}

class2.php

has one function

<script type = "text/javascript">

function Test1()
{


}


but when I try to some data like

But when you try to send some data


<script type = "text/javascript">

function Monday()
{

var comboid = parent.document.getElementById("SatCom1");
$test11= comboid.options[comboid.selectedIndex].value;
alert($test11);
parent.frames['iframe1'].Test1($test11); // IT FAILS



}

class2.php

has one function

<script type = "text/javascript">

function Test1(var ss)
{


}


when i call like this parent.frames['iframe1'].Test1($test11); // IT FAILS

the code fails, is there anything wrong with passing data from parent class to IFRAME
stephenrodrics
New php-forum User
New php-forum User
 
Posts: 53
Joined: Thu Mar 14, 2013 6:10 am

Re: how can we pass arguments from one class to another in p

Postby seandisanti » Fri Mar 29, 2013 7:16 am

your options for passing values are via post,get, session,cookie, and files. here are a few quick videos explaining those methods. http://jream.com/learning/videos/php-ba ... et-request and http://jream.com/learning/videos/php-ba ... e-security
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 775
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron