I've read a lot of people discussing nested lists, but I was wondering how to iterate through an adjacancy list/tree in PHP.
I have a table with: id, title, parent_id
And I've selected all records out into an array called $pages.
Then using this php:
function makeList($pages, $used) {
if (count($pages)) {
echo "<ul>";
...
URL is here: http://www.thexsoft.com/DownloadFolder/download.php?file=P2PTransfer
This page is basically a way for me to have set url to download a certain problem i published. This page should never ever be cached, but it seems to be caching still.
I have set the following items:
<meta http-equiv="expires" content="0" >
<meta http-eq...
Hello,
I'm having some sessions problems after my ISP moved my site to a new server, supposedly setup the same. The problem appears to be browser-specific as well, which I don't quite understand.
First, my site uses sessions to login, this has been broken since they moved the site.
My ISP has set up a test page at http://launchcomplex...
Hello,
I haven't made any changes to the code affecting the COOKIE's and now I get the following:
Use of undefined constant COOKIE_LOGIN - assumed 'COOKIE_LOGIN'
//Destroy Cookie
if (isset($_COOKIE[COOKIE_LOGIN]) && !empty($_COOKIE[COOKIE_LOGIN]))
setcookie(COOKIE_LOGIN,$objUserSerialized,time() - 86400 );
I'm not sure what I ne...
We're preparing to rewrite/restructure our corporate website and are looking for a CMS to back it. I need the CMS to provide a way of giving certain users in our company control over certain sections of the web site (i.e., allow our Marketing department to update press releases, our HR department to update job postings, etc). It should a...
I am trying to make a few php scripts that will run among other things system calls commands like top and other custom scripts. You can see the code below is super simple. The problem that we are having with the php below is that when I call the php from the linux prompt like:
#php checkTOP.php
it will return the top -n 1 output in ...
I use a custom 404 page in a PHP application.
On that 404 page, I check for certain 'known' older pages that no longer exist, and then redirect user to newer or most relevant current page. Works great.
Now I am faced with a series of old images that have been removed, and am looking for a way to redirect the images to a new image (all ...
I have a table with say 20 rows each with a number for display order (1-20).
SELECT * FROM `mytable` ORDER BY `display_order` DESC;
From an admin area you can drag the rows around or type a new number manually for each row.
Surely it's not good to loop over an UPDATE query for every row, what's an alternative in one or very few queri...
OK when I save uploaded files with PHP via move_uploaded_file() I cannot use an absolute URL I have to use a relative one. My site has 2 root directories one for the http side and one for the https side: httpdocs and httpsdocs respectively. So if my script is on the https side how can I save the file to a location on the http side?
Than...
What is the best approach for setting up sequential output for a PHP installer script? Say I have a page, and want to display incremental output within a DIV provided by a PHP script.
So page.html might contain this:
<div id="output">
<!-- Script Output Here -->
</div>
And install.php might look like this (for testing purposes):
...
I am trying to submit a form using Ajax.Updater and have the result of that update a div element in my page.
Everything works great in IE6, FF3, Chrome and Opera. However, In IE7 it sporadically works, but more often than not, it just doesn't seem to do anything.
Here's the javascript:
function testcaseHistoryUpdate(testcase, form) {
...
I've seen a few tutorials about Phing out there, but does anyone have a really good recommendation for one. It definitely looks like a handy tool.
...
Hello,
Here is an example of a file that i use to create a mysql db. The delimiter is "," but in the description for a single column exist ",".
Header: City State Zip Description
Los Angeles, California , 98005, "welcome to california, were are living the dream","Please stay, a while."
The problem is that the description in "quotes"...
I was reading through the source code for MeioUpload to make sure I understand what it's doing, and for the most part the code is pretty easy to understand. However, I came upon a section of code which I just can't seem to figure out, and so I'm trying to determine if it's a mistake on the author's part or if I'm just missing something.
...
After a huge MySQL blunder on a production server (my fault, and yes I have learned), I am now looking at creating a dump of the MySQL database before I do a critical operation (about 15 queries to the db, insert/update/selects). I know phpMyAdmin can 'dump' the database to SQL queries, but I think this may be a feature of it, not a feat...
Trying to figure out whether PHP supports features like method overloading, inheritance, and polymorphism, I found out:
it does not support method overloading
it does support inheritance
but I am unsure about polymorphism. I found this Googling the Internet:
I should note that in PHP the
polymorphism isn't quite the way it
sh...
I keep getting empty files generated from running
$command = 'mysqldump --opt -h localhost -u username -p \'password\' dbname > \'backup 2009-04-15 09-57-13.sql\'';
command($command);
Anyone know what might be causing this? My password has strange characters in it, but works fine with connecting to the db.
I've ran exec($command, $r...
Hi, I'm looking for a good tutorial that describes how to create your own complete mysqli connection class, maybe demonstrating catching and all that good stuff. If your wondering I have in fact done some some searching of my own, but I have not found any articles that really go into detail.
,Thanks
...
I'm running on Mac OS X 10.5.6. I've built PHP 5.2.9 at /usr/local/php and enabled fast_cgi. I'm also using lighttpd as my server. I am confused as where the php fastcgi socket exists. My lighttpd server settings are:
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
...
I am looking at some solutions for building a site with a mix of free and paid/premium content (no, it's not porn).
I gather that Drupal has the Premium plugin which supports this. I'm also looking at Expression Engine, which seems to have some built in support for this, although Paypal is the only payment option.
I'm looking at aMe...