php

add extra field to form not working

Hi, I have a working recommend to script, I just wanted to add a extra field named fename, now I get an error like this: Parse error: syntax error, unexpected $end in this is the html form: <form action="action.php" method="post"> Uw naam:<br /> <input type="text" name="name" size="25"><br /> <br /> Uw e-mail adres: ...

flash_set, flash_get in PHP?

Hi, so i got told in this question: http://stackoverflow.com/questions/2291413/php-javascript-passing-message-to-another-page to use flash_set and flash_get, concept called "Rails flash".. Now can you use them in php those function? I can really find them in php library site, so im not sure.. ...

read textfile with delimiter in php

I have three eintries in a textfile.txt: 20100220 Hello Here is Text \n blah \t even | and & and so on... I want to read each entrie (line) as a new string in php. I thought of using fopen and fgets. But: Since I'm using special characters like \n in the last line, fgets() would not work because it will terminate the string at \n, rig...

[PHP] Using cURL to download large XML files

I'm working with PHP and need to parse a number of fairly large XML files (50-75MB uncompressed). The issue, however, is that these XML files are stored remotely and will need to be downloaded before I can parse them. Having thought about the issue, I think using a system() call in PHP in order to initiate a cURL transfer is probably th...

Is there a library in php to handle and compress mp3 files in php..?

Hi Everyone... Is there anyway in php to handle i.e compress a mp3 file using php...? Is there any library out there like ZZIPlib library (To handle .ZIP files)...? Thanks for your suggestions...! ...

Action and confirmation - different pages, how do I pass text?

Hello. I have my integrated my site with phpbb, so you login into phpbb, and then you will be able to see my site, so I do not use normal sessions, so I do not know how to do this. My site is a design at index.php, and then I have an insert.php inside a frame. Now at my index.php, I want to receive a message, and at insert.php, I want ...

Zend framework - not entering values in database - garbage going in

Hi guys I'm in an emergency here. My code was working FINE for a while when ALL of a sudden somethings gone wrong and I havent a clue what! I store an object in my database by serializing it and then running a base64_encode on it. The result is an encoded serialised string which when I wish to retrieve I just decode and unserialise it. ...

PHP contact form with validation.

Hi, I need help creating the php for my contact form, here is the form = http://keironlowe.byethost17.com/contact.html What I need is, the text that says "This field is required" to only appear if the person didn't fill in them fields, and if the message was sent successfully I need it to redirect the user to another page. Thankyou s...

Post a event to application wall on facebook

Hi guys, the basic idea is, I created a application of which users will become fans and get the latest and greatest events from. For that I will need to post a event to the wall page of the application itself. Creating a event is not a problem (I'm using PHP5): $event_id=$facebook->api_client->events_create(json_encode($FB)); But ...

return User Quota with PHP from Linux OS

Hi, I need to find out quota details for the current user, I`ve tried exec("quota 'username'", $retParam) and also system() but nothing is returned. Any ideas ? Thank you. ...

What is the easiest way to implement a Comet serverside backend?

PHP as an Apache module or otherwise, would start one thread per pending request so it doesn't scale well. Are Java and Python my only other options? As a complete newbie to Python, is Twisted easy to use? ...

Does a PHP exception stop execution?

<?php function some_function($arg) { if($filter->check_for_safe_input($arg)) { throw new Exception("Hacking Attempt"); } do_some_database_stuff($arg); } ?> In the above code example, does do_some_database_stuff ever get called if check_for_safe_input fails, or does the exception stop t...

Config parser - static or not?

Hi, Imagine a strategy whereby you might want parsers for several formats of config file, say INI, XML and YAML for example. Parsing these will result in an instance of a common class say 'Config_Data'. My thoughts are that as the parser has a very simple mandate, and no state that I can see, it is best implemented as a static class, s...

Passing data between running PHP scripts

For multiple running PHP scripts to communicate, what is the least memory intensive solution? Monitor flat files for changes Keep running queries on a DB to check for new data Other techniques I have heard of, but never tried: Shared memory (APC, or core functions) Message queues (Active MQ and company) ...

Configuring APC with Drupal

I am working on a website which is hosted on a VPS with CENTOS 5.4 i686 virtuozzo installed. I have a drupal installation on the server which gets around 100s of authenticated users at the same time.But at a certain point of time the server stopped responding and the site went offline. So, I tried installing the opcode cache - Alternativ...

HTML Indentation in the mVc World

Here is a question that has been bugging me for a while, nowadays it's considered a good practice to indent HTML code but I've some reservations indenting code in a MVC pattern, here is a (silly) example: HTML Code: <!DOCTYPE html> <html> <head> <title>Testing MVC Indentation</title> </head> <body> <?php View('h1', 'I am a Level 1 He...

how to get the value of form input box in codeigniter

value of FORM INPUT Help!! //this is just a refrence of $nm and $fid from test_model// $data['fid']['value'] = 0; $data['nm'] = array('name'=>'fname', 'id'=>'id'); say i have one form_view with <?=form_label('Insert Your Name :')?> <?=form_input($nm)?> and a function to get single row function get($id...

php: get the name of an inheriting class in a static method

Okay, the post title might be a little confusing. I have this code: class A { public static foo() { return get_called_class(); } } class B extends A { } class C { public function bar() { echo B::foo(); } } Output: C WHat I want to get in foo() is the class name of B. How can I do this without chang...

what does " return $container->{$resource};" mean

What does the brakets mean and where to read more return $container->{$resource}; ...

$.getJSON and PHP file

Is it possible to hide name of *.php file in $(document).ready(function(){ $.getJSON("getdata.php", function(returned_data) { if(returned_data === "1") { $("div#wall").html('user has no subscription'); $("#message_wall").attr("disabled", "disabled"); return false; } }); }); Because that jquery code w...