php

what is difference between header and include, where which one should be used

Hello Everyone... I am confused with two terms 1.header ("Location:homepage_php"); 2.include("homepage.php"); I am guessing that header is used after checking password procedure and about include, you can use it anywhere. But i am not sure what is actual difference between them and at what place out of these two one should be used. ...

How can I dynamically check the number of arguments expected of an anonymous function in PHP?

Is it possible to get the number of arguments expected of an anonymous function in PHP? I'm aware of ReflectionMethod, but that seems to only work if the method is defined on a class. In my case, the anonymous function is either going to have 1 or two arguments. I'd prefer to do the checking correctly, rather than wrapping the first call...

Character encoding problem in PHP/MySQL/jQuery

Hello! I made some CMS in PHP which manipulates with data from MySQL. In my CMS, i have some input fields in which I would like to have jQuery's fancy autocomplete implemented. Basically, the idea is to create jQuery's arrays from MySQL tables... I'm working with PHP 5.3.0, MySQL 5.0.82 and Eclipse 3.4.2. My PHP project in Eclipse is UT...

warning: can not modify header information -header already sent by (output started at e:\xampp\htdocs\session.php 11) in e:\xampp\htdocs\home_page.php on line 7

Today first time i use cookie but i am facing a warning Warning: Cannot modify header information - headers already sent by (output started at E:\xampp\htdocs\session.php:11) in E:\xampp\htdocs\home_page.php on line 7 my code is like this... <?php include("session.php"); ?> <?php $Month = 2592000 + time(); //this add...

File uploads with Gears & PHP

We provide the ability to submit images to a user's gallery. While the normal method we have employed works just fine, some people will upload multiple files, which can take a long time, and is annoying in the selection process (one at a time). I started writing an alternate method using Gears for those that have it. Primarily the goal...

Not able to retrieve $_POST values

I have order a plugin which works fine on my local computer and on the developers test server. But the plugin is not working on my prod. server. After registretion, I should get $_GET = add_success. But I'm getting edit_success. In the code, they are cheking different $_POST values, one of them being 'mode'. Trying to output $_POST["mo...

can cookie do session task to check ur login status and some doubts in cookie and session and any spacial location for cookie in html page

Hi everyone I want to add remember me option in my login page.Now is it possible without using session or cookie and tell me which one should i use here cookie or session... Now if i am signed out and shut down my pc and then again start it as i enter the url of my login page either username and password muse be filled in both boxes or...

php and jquery click event problem

I'm having trouble firing a click event on an . When insertIntoInsertHolder() is called it adds a link to the content of div#swf_insert_holder - I then create the click event just below. However the event doesn't fire. $javascript = "javascript:;"; $swf_insert_box_link = "swf_insert_box_link"; echo " function insertIntoInsertHolder( f...

Do you know of any projects in PHP that use namespaces that I could study?

I know namespaces are new in PHP but have been around for a long time in other languages. I started out in PHP so I really have no experience using them, I have read many articles and post on here about namespace in PHP and I get thebasic idea of how to use it but it is still something that will probably take me a while for it to really...

Zend Framework - How do make a hierarchy without it being a module?

Here is my specific issue. I want to make an api level which then under that you can select which method you will use. For example: test.com/api/rest test.com/api/xmlprc Currently I have api mapping to a module directory. I then setup a route to make it a rest route. test.com/api is a rest route, but I would rather have it be test.com...

Switching my form submit to ajax-can I just change onsubmit action?

I see lots of jquery tutorials from building the submit form from scratch, and that is cool, but I'm wondering if I can convert my existing form. I'm using a typical form, and already have an email and blank values checking in place. Right now, on submitting the form, the user is taken to the confirmation php page withing form-submit.p...

mysql timediff to hours

Hi, I'm Trying to get the timediff from my table and convert it to hours (it's for an hourly billed service) SELECT TIME_TO_SEC(TIMEDIFF(endDate,startDate))/3600 FROM tasks > where endDate and startDate are in datetime format is there another way (more efficient) to do this task? Thanks ! ...

ok to include css and js files outside <html>?

i wonder if i could embed js and css files above the html document scope: <script type="text/javascript" src="../../media/js/jquery.js"></script> <script type="text/javascript" src="../../media/js/jquery-ui.js"></script> <link rel="stylesheet" type="text/css" media="all" href="../../media/css/cupertino/jquery-ui.css" /> <html> <head...

REMOTELY Debugging PHP Using Eclipse

I'm a self-taught noobie, trying to debug PHP on my GoDaddy hosted server. Is this idea even rational, or do I need to continue to do all development locally and just continuously re-ftp upload the changes? Is there some way that I can use eclipse to step through, and debug my php scripts that are hosted on a third party site? ...

Selecting from a MySQL DB based on parts of a timestamp.

Is there a way to select rows from a DB where the timestamp is in a certain year? I don't have a specific timestamp, just a range (ex. all timestamps within the year 2009). Is there a way to do this? How else might I go about doing something like this? Thanks for your help! -iMaster ...

Trouble with javascript if statement

Ok, I'm making a login and registration panel with jquery and php. In short, if there are errors with the registration it sets a few form errors, redirects back to the registration page, the javascript detects there are errors with the use of a php variable and forces the slider to show itself. The working code: Above the doc type $err...

Send all traffic a 404 error

What is the best way to send all traffic to your site a 404 page? I'm currently working on the site and would like it to just 404 for all requests. I've tried playing around with htaccess files but haven't been too successful in getting one working like this. Additionally, I would like traffic to a particular folder to still get through....

Access an element's parent with PHP's SimpleXML?

I'm iterating through a set of SimpleXML objects, and I can't figure out how to access each object's parent node. Here's what I want: $divs = simplexml->xpath("//div"); foreach ($divs as $div) { $parent_div = $div->get_parent_node(); // Sadly, there's no such function. } Seems like there must be a fairly easy way to do this. ...

Is there a MyPHP project much like MyPerl?

Here: http://freshmeat.net/projects/myperl/ I need to enable PHP in MySQL ...

Replace xml nodes and attributes with php

I have a "stuff.xml" file which basically looks like this: <?xml version="1.0" encoding="utf-8"?> <mystuff> <pic id="pic1" _level="1" _xpos="50" _ypos="50" _width="150" _height="150"> image.jpg </pic> </mystuff> And what I need is three php files: "image.php", "pos.php", and "size.php" which ba...