Getting a variable to work in function params


Posted on 16th Feb 2014 07:03 pm by admin

I have this fuction which is inside a class:

Code: public static function generateEmbedCode($callId, $width="425", $height="320", $swfobjectPath="SDK/js/swfobject.js", $inviteButton="1", $guestList="1", $observerMode="0", $displayName="$nick") {
Blah Blah
}
What i need to do is grab some info and place it into a variable for $displayName="$nick" using:
Code: $memberid = (int)$_COOKIE['memberID'];
$sQuery = "SELECT * FROM `Profiles` WHERE `ID` = '$memberid'";
$result = db_res($sQuery);
while ( $p_arr = mysql_fetch_array( $result ) ) {
//get profile data
$nick = $p_arr['NickName'];
}
But I can't get it to work, my question is how can I get a variable to work inside the params of a function?? i hope this makes sense.

Thanks

No comments posted yet

Your Answer:

Login to answer
307 Like 8 Dislike
Previous forums Next forums
Other forums

Trouble checking SESSION cookie
I am trying to use $_SESSION cookies to verify admin privileges .
I don't understand why this is

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

Blocking video streaming
Hello everyone,

I post a message here because i didn't find any solution yet.
I just finis

Basic Question Regarding PHP Includes
Hi

Just starting out with PHP.

Working on a site that uses some basic includes, these

Scrolling news bar and MySQL
I am not sure if this is the correct forum to post this on. If not, I apologize. I am still pretty

Using system() and bringing back the results
I am aware that you can use system() within PHP to execute system commands, but I was wondering if t

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

Request-URI Too Large
I have created a simple submit form for a mysql database that puts a piece of code into database.<

Connection Timeout
I'm using xmii 12.0

I'm calling a transaction as a web service from a windows application

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash