php

Is it possible to use extract() with an array key name 'some.key'?

If I am going to use the code: extract( array( 'key.name' => 'value', 'somekey' => 'somevalue' ) ) Is there some way for me to retrieve the first value? E.g. ${'key.name'} or similar. I know I can retrieve the second value with $somekey but I am curious if its possible with . in the name. ...

How can I know which website the member has visited previously?

So, I can use getenv('HTTP_REFERER') to get an URL which the member has visited previously, but it works only if it's the same website. I want this: for example. the member firstly visits google.com then goes to my website. I want to show him, that previously he visited a google.com website. How can I do it if it's possible? ...

CSS 'active' does not work when converting HTML to PHP include

I realize a 'similar' question was asked but the other user is using a much different approach than I am. I am simply trying to include an HTML navigation on my PHP pages for easier modification down the road. When you hover over a button, it is highlighted while the 'active' page is always highlighted. The hover works on both the html a...

Body background switcher with jQuery

Hi there, I'm making a webpage that needs to switch between background images on a page, where the user can click on back and forth arrows to sift through each background while browsing. For each background there needs to be a dynamic description for each image. For example, the user may load the page and see the body background with a...

jQuery form duplicate email validation on exit

I have a site and I am using this plugin for validation in the registration process. I have seen sites where when you exit the email address field, it goes out and checks to see if the email address exists before you hits the submit button. I know this is ajax but I cannot figure it out. How do you validate if an email address (or a...

PHP class declaration

Is there any way to set explicit type to object field in php? Something like this class House{ private Roof $roof } ...

How to do this in a smart way

Hello SO. My websystem im coding with now is integrated from the originally phpBB system. With this i mean when you log on my websystem, you have actually logged into the forum from the login page. Now i came to the "log out" part, and i want to make it smart. Right now its a simply link with logout: <a href="<?php echo BASEDIR; ?>../....

consuming web service (for the first time) in php

It took me a while to get soap configured in php. Now I'm just trying to learn about it. I'm using the web service here to learn: http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=19 It says the WSDL is here: http://www.webservicex.net/stockquote.asmx?wsdl and this is my code: $client = new SoapClient('http://www.webservicex.ne...

how to use alert in php and js combined

have a need to alert through php, I have the code below. Problem is that it works as long as I dont use header redirect. But as soon as I use it..I loose alert. echo "I will do some functions here in php"; if($value == 1){ alert('ok working'); } header(location: 'someOtherpagethanthis.php'); ...

PHP or Javascript or other - Draw simple shapes onto images?

I basically have an image of a world map and i would like to place a pin image at a specified pixel co-ordinate ontop of this world map image. It's for a website, so ideally the solution should be in PHP or Javascript (i'm avoiding Java and Flash as i want it to be as simple as possible). I had a look at the processing.js library but i...

Can YAML have inheritance?

This question involves a lot of symfony but it should be easy enough for someone to follow who only knows YAML and not symfony. My symfony models come from a three-step process: First, I create the tables in MySQL. Second, I run a symfony command (symfony doctrine:build-schema) to convert my table structure into a YAML file. Third, I ru...

strtotime fails for valid date

i am doing a project where i need to output date of orders. and i do the following inside a for loop <?php echo date('M d, Y g:i A',strtotime($order['Order']['created']));?> for some strange reason, sttotime returns false. (Dec 31, 1969 7:00 PM appears instead.) i made sure $order['Order']['created'] is not empty and is valid. even ...

HTML, Javascript, PHP and Actionscript all in one Eclipse install (2010)

I just wanted to poll the community and see which plugins people are currently using to get all of these different technologies running in Eclipse. I saw this thread which mentioned Spket & WPT: http://stackoverflow.com/questions/1575617/eclipse-which-plugins-for-html-javascript But I noticed that Spket doesn't seem to have been updated...

I need to get form data from multiple forms on one page using $_POST

My project is a menu that displays daily specials at a cafe. The Pointy Haired Boss(PHB) needs to add/remove items from the menu on a daily basis, so I stored all dishes with MySQL, and created a page which will load all menu items as buttons. When clicked, the button will UPDATE the item, turning it on or off. I need form data to det...

Multiple login locations for an online app.

Hello, I am working on a browser based application that will have many users. The catch is that every user should have their own customized login page, but the actual application is the same for everyone, and needs to be in a central location. The login page is static. That is, if we have a user that requires a separate login, we will...

Code igniter authentication code in controller security question

I have a main controller to handle the very front-end of my authentication system, it handles login, logout, update user info, etc. functions that I anticipate calling by POST'ing from views/forms. What about something like a "delete_user" function though? My thoughts are a button in someones admin panel would say "Delete Account" and it...

Best practices for querying an entire row in a database table? (MySQL / CodeIgniter)

Sorry for the novice question! I have a table called cities in which I have fields called id, name, xpos, ypos. I'm trying to use the data from each row to set a div's position and name. What I'm wondering is what's the best practice for dynamically querying an unknown amount of rows (I don't know how many cities there might be, I wan...

Next and Previous MySQL row based on name

Hi everyone, I have a table with details on personnel. I would like to create a Next/Previous link based on the individual's last name. Since personnel were not added in alphabetical order, selecting the next or previous row based on its ID does not work. It is a hefty table - the pertinent fields are id, name_l, and name_f. I would li...

How to grab all variables in a post (PHP)

How to grab all variables in a post (PHP)? I don't want to deal with $_POST['var1']; $_POST['var2']; $_POST['var3']; ... I want to echo all of them in one shot. ...

PHP SVN functions

I've just discovered http://www.php.net/manual/en/ref.svn.php, which is actually what I've been looking for for a while. I am able to use svn_ls to correctly list directories and their files, which is perfect, but for the next part of my S3 deployment script, I need to be able to use svn_fs_file_contents. Unfortunately, I am unable to c...