I want to loop through this array:
$securePages=array("admin.php","addslot.php","classpost.php");
$pagename="admin.php"
Then if admin.php is found then execute this code:
header("location:index.php");
exit();
How would I put together this looping statement?
...
I usually store dates as integers using PHP's time() function in a MySQL database rather than using MySQL's date format simply because it's easier to manipulate when I pull it back out, but are there any disadvantages to this?
...
I am getting the above error using PHP trying to update an MS SQL server. Any idea what may be happening here? I am using a stored procedure as the basis of the update. I can successfully execute the sproc against the SQL server away from the PHP application.
Any advice/help would be appreciated.
...
I have a view and I want to display data that would be generated by othe modules and controllers on the page.
What is the best way to do this?
For example: If on a certain page I want to pull in the latest news from the news module.
...
We're currently working on a major overhaul for our public website, transitioning from a pretty nasty static site to a new CMS. For some reason or another, Joomla was selected as the CMS despite the company being a very heavy MS shop. This would be fine, however we have multiple ASP.NET web applications which are currently running on the...
Hi guys I have a simple membership based website where users log in and have their own profiles. I woudl like to be able to tell at any given point in time how many users or rather which users are currently logged into my website.
Its a simple membership based system in php. One way I uderstand it creating a table in a db and storing l...
Hey everyone,
I'd like to implement a voting system on my site, without having to force them to create an account. They would ultimately be voting up/down a piece of content which has a unique ID.
I know that I could store entries in a table with IP/ID, but what if there are more than one user coming from the same IP?
Is there a way t...
Is it possible to create a connection in a PHP class file and use it in all of the different methods in the class? I am trying to open a connection in the constructor and i get an error when i get to the close connection method saying that the argument that I've provided in the mysql_close() statement isn't a valid MYSQL-Link souce.
...
I have in my bootstrap
public function initRoutes()
{
$router = new Zend_Controller_Router_Rewrite();
$route = new Zend_Controller_Router_Route_Static('register', array('module'=>'members','controller'=>'register','action'=>'index'));
$router->addRoute('register',$route);
}
and when I go to http://domain.com/register
I ge...
I'm currently working on a small application that works like this:
When the user clicks a link, an Ajax GET request is fired.
The request hits a server-side PHP script.
The script, which requests information for another domain, retrieves a JSON feed.
The feed is then echoed back to the client for parsing.
I'm not really a PHP develop...
What I thought was going to be an easy implementation of two lines of code and a function, turned out to be made of fail.
On my webpage, I want to be able to type [text]1[/text], and what it will do is pull the title of that ID.
function textFormat($text) {
$raw = array(
'\'\[text\](?P<id>.*?)\[/text\]\'is'
);
...
The user comes to this page from a different page where they click on a link and it is appended with a ?photo_id= and then the id number. I want certain information to be available to the viewer when they arrive at this page.
I want them to be able to see the photo, the photo name, and the photographers name. The first two are not a pro...
I would like to wrap form elements with labels as such
<label for="email">E-mail <input type="text" name="email" id="email" /></label>
The only option I could find is to alter the placement; however it only accepts 'prepend' and 'append':
<!-- prepend -->
<label for="email">E-mail</label> <input type="text" name="email" id="email" />...
In the MVC way of doing things, where is the best place to run, for example htmlspecialchars() on any input? Should it happen in the view (it sort of makes sense to do it here, as I should be dealing with the raw input throughout the controller and model?)
I'm not quite sure... What are benefits of doing it in the view or controller? Th...
Hi guys I would like to know of a simple banner management system php based - free to use which would have the facility for clients to log in and see their banner statistics.
...
I am working on a self project, where I am trying to convert a website written in php to ASP.NET(C#). I came across a php to ASP.net migration assistant, but this comes as an addon for VS 2003.
Is there a migration assistant add in for VS 2008.
Tips/tricks for going through the migration.
Are their any other open source/Commercial tool...
How to write this query using the find statement in cakephp
$this->Form->query("Select id from forms order by id DESC LIMIT 1")
...
I would like to use mysql query profiler in the php script. So that after i execute any queries it need to display the execution time of the query.
Suggest the best way to use this also share any other scripts like query profiler.
...
Is there any easy way to identify the file initially requested by the user, ignoring get arguments and handling (at least basic) mappings like / to /index.php?
Ideally what I'm looking for is something like $_SERVER['REQUEST_URI'], except it returns the same value regardless of the get arguments and that value is the file requested, not...
I have a contianer div around all the content in the site that dynamically streches, have also got severall other divs that strech (all using the same method as 20 other sites I have).
Not matter what method is use with jqueyr or javascript to get the height of the container, javascript and jquery seem to return a value bigger that heig...