php

PHP session variables not carrying over to my logged in page, but session ID is

I'm using PHP 4.3.9, Apache/2.0.52 I'm trying to get a login system working that registers DB values in a session where they're available once logged in. I'm losing the session variables once I'm redirected. I'm using the following code to print the session ID/values on my login form page and the redirected page: echo '<font color="re...

Managing date formats differences between PHP and MySQL

I'm writing my first PHP app that has to directly deal with dates, and thus to directly deal with the fact that PHP and MySQL have different date formats. My question is: what's the most elegant way to manage this difference? I have the following two functions to manage the difference using php: function mysql_date($php_date) { r...

Passing form data from asp file to php

I have a form in an ASP file that I would like to pass to a php script for processing. Is this possible? I don't see why it wouldn't be, but I tried a dummy form on an asp file, with the action="phptest.php" and when submitting it just reloads the form page. ...

Auto generation of META tags in PHP

I was thinking of writing a PHP script that would analyse a CMS'd page's content (i.e. database field) and then auto-generate (X)HTML META description & keyword tags, but as always there's no point reinventing the wheel so I'm wondering if anyone knows of such a beastie? The former I imagine would be something like a relatively straight...

how to make $_POST persistent?

if i have a search function for my site and i want the user's former search preferences to be available at any page on my site where the search module is available all i can think of is to convert the $_POST variable to a cookie... but i am just modifying what was already constructed by another person whom i replaced, and i dont know if ...

PHP IRC Robot, Send Command, but now I need the bot to read the command.

Hello, I have a PHP IRC Robot that I use in my channel and I need it to make OPs to specific set users in the script by me. Anyways I want the robot to check if the user is logged into NickServ to prevent any sort of fraud or anything. Anyways, here is my connect and DO things code, followed by what I really need help with below it. All...

Is there any API to integrate with English dictionary in PHP ?

Is this possible to Integrate with any English Dictionary, so that every word entered in my text-box should be cross checked from the Dictionary and return me true/false. ...

Big Web 2.0 sites written in Python?

Hulu, Twitter, Techcrunch, etc are written in Ruby. Yahoo, Facebook, and tons of big social networks are written in PHP. But what are some big top-name enterprise sites written in Python? I am going to spend my time investing in either Python (w/ Django) or Ruby (w/ Rails) to create a data-intensive web application that has a personali...

Smarty Vs. Javascript/AJAX

I have a doubt: - Is there any standard/convention that when should I use "Smarty templating" and when should I use Javascript Ajax calls to produce the content? I can use Ajax/Javascript calls to produce the content dynamically. My application uses both Ajax and Smarty, but I want to set a rule for developers ...

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php any suggestion ...

Get variable from php to javascript

Hi friends, I want to use the php variable in javascript. How its possible? Please help me.. ...

DOMDocument: Ignore Duplicate Element IDs

I'm putting some page content (which has been run through Tidy, but doesn't need to be if this is a source of problems) into DOMDocument using DOMDocument::loadHTML. It's coming up with various errors 'ID x already defined in Entity, line X'. Is there any way to make either DOMDocument (or Tidy) ignore or strip out duplicate element IDs,...

What are php nested functions for?

In javascript nested functions are very useful: closures, private methods and what have you.. What are nested php functions for? Does anyone use them and what for? Here's a small investigation I did <?php function outer( $msg ) { function inner( $msg ) { echo 'inner: '.$msg.' '; } echo 'outer: '.$msg.' '; inner( $...

What is MVC, in relation to the Zend framework?

I'm learning the Zend Framework and it uses a MVC model. I still have not got my head around what MVC Model, View, Controller is. What are the three different areas for and what would the program flow look like? ...

Getting the € with htmlentities

I am really trying to show what htmlentities gives me, but it doesn't give & euro; for the € character. I am trying echo htmlentities(htmlentities("LISBOA-VIENA DESDE 99€ TAXAS INCLUÍDAS, RESERVE JÁ",ENT_COMPAT,ISO-8859-1),ENT_COMPAT,ISO-8859-1); echo '<br>'; echo htmlentities(htmlentities("LISBOA-VIENA DESDE 99€ TAXAS INCLUÍDA...

Using API/Function calls or going for the Cron Job approach - An inquiry into dealing with transactions - How would you handle it?

Hey Everyone, I wanted to run something by you guys. I am starting a new project which is roughly the following: Important information: I am using PHP and MySQL Every minute I get a list of to-do transactions from an API from different users. Example: user1 send $1 to user2 userx send $2 to usera userw send $0.50 to user2 etc.. ...

Forcing a SimpleXML Object to a string, regardless of context

Let's say I have some XML like this <channel> <item> <title>This is title 1</title> </item> </channel> The code below does what I want in that it outputs the title as a string $xml = simplexml_load_string($xmlstring); echo $xml->channel->item->title; Here's my problem. The code below doesn't treat the title as a string in ...

Current user in Magento?

I'm customizing the product view page and I need to show the user's name. How do I access the account information of the current user (if he's logged in) to get Name etc. ? ...

Optimizing PHP string concatenation

Hello there, This post is not really a question, but it could be useful to share some coding tips. Here is the one I'de like to share with you. I'm gonna show you 4 examples to do the same thing, but only the last one will be the best. $foo = 'John SMITH'; echo "Hello $foo, welcome on my website."; echo "Hello " . $foo . " welcome o...

Eclipse PDT Ant

I downloaded the Eclipse PDT 2.0 GA release (Eclipse 3.4), however, it doesn't look like the Ant tools are included in this package. How can I install the eclipse Ant tools (editor, executable, etc...)? ...