My code:
class Address{
public var $Street;
}
class Employee{
public var $ID:
public var $Name:
public var $Address;
}
$myEmployee = new Employee();
$myEmployee->Address = new Address();
How do I access the the street now?
$street = $myEmployee->$Address->Street;
$street = $myEmployee->Address->Street;
Both give me...
Hi I want to put an image into the pdf file I'm making using TCPDF. It is an image generated by an online API so I cannot store in my webhost. But when I put the image url for creating i'm getting error while generating the PDF file.
...
Duplicate of
What is the best open source wiki system ?
I need to setup a closed-wiki system, i.e.:
Any user can view everything
Only registered users can contribute
Even then their contribution must be approved by a moderator/editor/administrator before it is displayed to the public.
Anyone know of a wiki (preferably open sour...
I think I must be doing something wrong here because my code only sent an email to the last subscriber in the table. When I log the array of subscribers, its obvious that there are more than one that it is trying to send to. I think the problem has to do with trying to batch them together...What is the best way for me to do this? I'm try...
I am calling functions using dynamic function names (something like this)
$unsafeFunctionName = $_POST['function_name'];
$safeFunctionName = safe($unsafeFunctionName); // custom safe() function
Then I am wanting to wrap some xml around the returned value of the function (something like this):
// xml header etc already created
$resu...
So, in PHPDoc one can specify @var above the member variable declaration to hint at its type. Then an IDE, for ex. PHPEd, will know what type of object it's working with and will be able to provide a code insight for that variable.
<?php
class Test
{
/** @var SomeObj */
private $someObjInstance;
}
?>
This works great unt...
I have a button element that I've created like so:
$submit = new Zend_Form_Element_Button('submit');
$submit->setLabel('My Button');
$submit->setDecorators(array(
'ViewHelper',
array('HtmlTag', array('tag' => 'li'))
));
$submit->setAttrib('type', 'submit');
This generates the following HTML:
<li>
<label for="submit" clas...
Hello,
Is it possible to split the contents of file into parts that have specific pattern?
This is what I want to achieve:
Read the file using file_get_contents
Read only contents between similar commented areas.
I am not sure how complicated is that but basically If I am parsing a large html file and want only to display to the br...
When I go to some websites I notice that there is no file extension on the page. Actually, this site is a proper example. Anybody know how this is done? :]
...
I'm trying to move into OOP development and am turning to here as I'm sick of searching the web and finding only the very basic information about what classes are and how they can inherit from each other - that I understand.
What I don't understand as yet is how all these classes can be stored in different files, doted around a folder s...
Is it possible to run a php app using tomcat? Before you tell me to just use httpd, I already have a java application running on my webserver at host/myapp. Now I want to install RoundCube at host/roundcube. One is php however and one is java. I keep seeing offhand references saying this is possible but no real instructions. No, I do not...
I've go an absolute URL in my JavaScript that I have hard coded for window.location.
I don't want to have to change this every time I am testing my app. In PHP I would have handled this by testing the $_SERVER["HTTP_HOST"] variable to find out what server I am on, and adjust accordingly. However, I'm not as familiar with Java and am won...
Hi,
I have a sendemail.php set up for sending me information from a form.
The way I have it set to send the information is with
$_POST['variable name']
I cant figure out how to show the choice of a radio button array in the email that is sent to me. Thanks for any help.
...
Have a series of functions I am calling dynamically sort of like this:
$function = 'someFunction';
$x = $function();
.. however, if the function expects parameters, and I don't code it in the call, I seem to crash the page. For example:
function someFunction( $in_param1 ) {
return "SUCCESS";
}
$function = 'someFunction';
// this n...
How can I pass a arbitrary number of arguments to the class constructor using the Object() function defined below?
<?php
/*
./index.php
*/
function Object($object)
{
static $instance = array();
if (is_file('./' . $object . '.php') === true)
{
$class = basename($object);
if (array_key_exists($class, $instance) =...
Hi,
For a school project, I have installed MediaWiki on my local machine, and am required to have any database connection to the local MySQL database use SSL. I am unsure of how to connect all the dots. Here's what I have done so far:
I have installed OpenSSL, and created a self-signed certificate, and associated keys.
phpinfo() sho...
Okay, so the PHP script exists on serverA. ServerA has php safe-mode ON and WebDAV OFF. I can't change either of these factors. I want a script on serverA to get the user's login/password for another server, which we shall call serverB. ServerB has WebDAV ON.
The ultimate goal is that the user will go to the script on ServerA, put in t...
I'm passing a large dataset into a mysql table via php using insert commands and I'm wondering if its possible to insert approximately 1000 rows at a time via a query other than appending each value on the end of an mile long string and then executing it. I am using the codeigniter framework so its functions are also available to me.
...
I'm using PHP with MySQL database. The PCs are having a network to each other. My problem is I want to connect to the MySQL database on another computer. I want to store data on that MySQL database from another computer. How could i possibly do on this? Thanks so much for any suggestions.
...
How can I cut the string before '(' sign with php
For example:
$a = "abc dec g (gold)";
How can I cut the string become only "abc dec g"??
I tried to used this strstr($a, '(', true) but error display.
...