php

dynamic menu generation in php

Possible Duplicate: how to generate an dynamic array how to generate an dynamic menu which have submenu so on which have store in database and on click show submenu. Please help me i am an fresher php developer. ...

How to show connectivity of nodes graphically with PHP?

To reflect: A-B A-C A-D .. B-D .. Is there an easy way to do this? ...

php/curl: Timeout problem when remote server curling itself

Hi! I have a simple "server" script that just echos a line: <?php echo "Server script on http://".$_SERVER['SERVER_NAME']." saying hello!"; And a "client" script curling the server script: <?php echo "Client script"; $url = "http://localhost/server.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CU...

AMFPHP: Serializing Flash Objects over HTTP without the gateway

Flash + AMFPHP is a great combination. But there are cases, when Flash Remoting with NetConnection isn't the right tool, for various reasons. Rob had a great post on this some time ago: http://www.roboncode.com/articles/144 He also has a nice example on how to deliver AMF to a http request, without the POST and AMF-request package to ca...

What kind of syntax is this in PHP?

if(true): echo 'good'; endif; I've only see it in PHP today! I've always been using: if(true) { echo 'good'; } ...

How to live update browser game attributes like the 4 resouces in Travian game ?

I would like to make a web-based game which is Travian-like (or Ikariam-like). The game will be in PHP & MySQL-based. I wonder how can I achieve the live updating of game attributes. For frontend, I can achieve by using AJAX calls (fetch the latest values from database), or even fake update of values (not communicated with server). Fo...

Send a file to a PHP script from a VB.NET app

I need to send some data from a SQL DB Server on an internal network to an external web server. I was hoping to accomplish this by writing a VB.NET app that is invoked once per day that sends about 1 MB of data to a PHP script on the web server, where it is deposited in a database. What is a good method to send data to a PHP script fro...

Controller print_r shows different from model print_r.

This is following up question from here. But the question is different. I have the following model and print_r is the following as well. This is Model MCalendar_one/getEvents($time) function getEvents($time){ ... $query = $this->db->query("SELECT DATE_FORMAT(eventDate,'%d') AS day,eventContent,eventTitle FROM eventcal WHERE event...

consuming jasperIntelligence services with nusoap(PHP)

Hello good people! i've been struggling the whole week end to connect to jasperIntelligence service in vain with a php client.Of course there is a sample php client in the jasperserver installation and that seems to be very very old. I've decided to write my own using the latest nusoap 0.7.3.It seems like i'm not getting well the struct...

Store all users info on login

Is it best to store all the users information in session cookies like this on login? Instead of using alot of querys $_SESSION['id'] = mysql_result($result, 0, 'id'); $_SESSION['name'] = mysql_result($result, 0, 'name'); $_SESSION['email'] = mysql_result($result, 0, 'email'); $_SESSION['ip'] = mysql_result($result, 0, 'regip'); $_SESSIO...

What does =& mean in PHP?

I realize this is a very basic question but I don't even really know what to search for to find out about it. $smarty =& SESmarty::getInstance(); What is the & for in the above? ...

Ajax file upload script overwrites my session variables PHP

Below is the script that my ajax file uploader uses. The uploader itself works fine but i need a method of storing the files that are uploaded and I am using session variables. The problem is if I upload more than one file the first session variable is being overwritten each time i upload a file and so i end up with only $_SESSION['hamha...

error php domDocument xml parsing

Hi, Does anybody know how I can get this xml into the domDocument? Right now, it throws an error saying it is missing a top level element. What I see is that feed is the toplevel element, so it's a mystery to me. This only happens if I run it threw the domDocument and not when I echo it out directly. The xml validator also gives no err...

Handling PUT/DELETE arguments in PHP

I am working on my and I am struggling to work out how to send PUT and DELETE arguments in PHP. In a few places I have seen people using the options: $this->option(CURLOPT_PUT, TRUE); $this->option(CURLOPT_POSTFIELDS, $params); Annoyingly, this seems to do nothing. Is this the correct way to set PUT parameters? If so, how do I set ...

How iterate through controls in a form?

Hey all, I'm pretty new to PHP and I'm currently working on my first PHP website. I have a need to display (and add/edit) rows in a table in a single form. What I'm going for is a row in the form for each row in the table plus one blank row so the user can add more items into the table. When they click the save button I want all the ...

Should a method ran several times in a PHP class be cached to a class variable instead?

In PHP I know many people will use a class to SET and GET session variables, I am doing this now in many classes, I need to know if I am doing it wrong though. So for example lets pretend I have A class that need to use this $session->get('user_id') Which gets this value $_SESSION['user_id'] Now in this class if I have 15 metho...

String to array without explode

Hello, I am using an api to retrieve data from another server the data returned is something like this: accountid=10110 type=prem servertime=1263752255 validuntil=1266163393 username= curfiles=11 curspace=188374868 bodkb=5000000 premkbleft=24875313 This is a whole string I need two values out of whole string, I am currently using pr...

move all files in a folder to another?

when moving one file from one location to another i use rename('path/filename', newpath/filename'); how do you move all files in a folder to another folder? tried this one without result: rename('path/*', 'newpath/*'); ...

PHP date comparison function

What is the best way to figure out if timestamp 1263751023 was more than 60 min ago? ...

calling function inside preg_replace thats inside a function

I have some code with the a structure similar to this function bbcode($Text) { //$Text = preg_replace("/\[video\](.+?)\[\/video\]/",embed_video($1), $Text); return $Text;} function embed_video($url){ if (preg_match("/http:\/\/www.youtube.com\/watch\?v=([0-9a-zA-Z-_]*)(.*)/i", $url, $matches)) { return ...