Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Make By Classes Iterable By Implementing Iterator Aggregate & Iterator Interfaces.


I am trying to make by classes Iterable by implementing Iterator Aggregate & Iterator interfaces. But whenever my class implemets any of these, I get a Class Not Found error for that class. So, how can I make my class Iterable?




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Iterator First Item?
Let's say I have the code:

foreach($data as $row)
{
do something with each $row
}

Is there a way to do something specific to the first item iterated?
Pseudocode:

foreach($data as $row)
{
if first time through iteration do something with $row
else do something which each remaining $row
}

Is this possible? I think I could use a regular 'for' loop, using the
length of the $data array as a guide, and then an 'if..else' structure
to see if it is the first time through the 'for' loop, but I was
looking for a more elegant solution.

View Replies !   View Related
Ftp_rawlist With Iterator
This is my first post and I couldn't decide if this should go into the PHP5 forum so I apologize if my post is misplaced. Let me know and I'll move it.

Some Background:
------------------------

I'm basically writing a script to connect to an FTP server and download any new files that I don't already have locally. My goal was to make the code as generic as possible.

One of the first necessary tasks for doing this is to get a list of files/directories from the FTP server. To do this I implemented the SPL Iterator interface and created my own FTPDirectoryIterator class. I also went the next step and extended that class into a RecursiveFTPDirectoryIterator class. The constructor for the iterator accepts an FTP stream resource. And it works great except for one problem:

ftp_rawlist()

Unfortunately I can't handle the problem gracefully because the EXACT issue is that my script will just hang on the ftp_rawlist() command or sometimes ftp_rawlist() returns an empty array. I was able to come up with a 'hack' solution to the empty array issue by looping the ftp_rawlist() call 3 times (seems to always work the second time it's called which is wierd) but if it hangs, I'm hosed and the script times out. This is NOT consistent. Sometimes it works and sometimes it hangs. There is no method to the madness.

Researching this in these forums and on the internet I see that ftp_rawlist() and ftp_nlist() have been a problem in PHP for a while.

What I've Already Tried:
------------------------------
- I tried ftp_nlist() with the same issues.

- I tried a quick inline approach for debugging, seeing if I could get ftp_rawlist() to hang. I couldn't, which makes me wonder if my OOP approach utilizing the SPL Iterator interface might somehow be causing this???

- I've verified that my FTP resource that I'm passing to ftp_rawlist() is valid every time.

- I tried different passive mode on/off. ftp_rawlist() seems to work more often with passive mode off, which I thought was strange. But it will still hang on occasion regardless.

- I tried going the ftp_raw() route and passing an 'LS' command. Unfortunately the server returns a 500 error: "command not recognized", which is BS since it's a Unix server and the 'pwd' and 'cd' commands work fine with ftp_raw()... sorry, I got a little upset there... I think the server admins have some remote commands restricted?

- Online I found a tip that some servers run extended passive mode and to run ftp_exec ($FTPresource, 'epsv4 off'); but I get the old "command not supported" message of doom.

Versions
------------------------------
- The FTP server I'm connecting to is a Unix server. That's all I know. I got this from the ftp_systype() function.

- When I run the script locally, I'm running on the Zend Core WAMP (v2.0), and I'm running PHP CLI 5.2.1

- The devel server I commit to is running LAMP (also Zend Core). I'm executing my script via PHP CLI (5.1.5).
NOTE: When I run my script on the development server the ftp_rawlist() will still hang but it eventually moves on and my loop 'hack' picks right back up where it should, so it 'sort of' works, but I don't have a lot of confidence in it because ftp_rawlist() still hangs for a good 20 seconds and then throws an error.

Conclusion
-----------------
Sorry for the long post. I am open to any ideas. Is there another way to get a directory listing from an FTP server other than PHP's FTP functions? Is there a magic call I do to make ftp_rawlist() work properly? Perhaps there is a freeware application that can do what I'm trying to accomplish to automatically synchronize a local server with the files on an FTP server?

View Replies !   View Related
Iterator Interface
<?php count($object) ?>. work when $object is of a class that implemets the Iterator interface. The reason I'm asking is that count() returns 1 when I know that it should return 0.(the objects returns all rows from a mysql table that in this case is empty.

View Replies !   View Related
SQL_Connect And Interfaces File?
What is the 'interfaces' file referred to here?

I defined the strings as $string = server, etc. But this connection string wont't connect to SQL7.

int mssql_connect(string [servername] , string [username] , string [password] );

Mssql_connect() establishes a connection to a MS SQL server. The servername argument has to be a valid servername that is defined in the ****'interfaces'**** file.

View Replies !   View Related
Get A List Of Network Interfaces In PHP?
I've got a utility I'm working on, and I want to be able to list for
the user all the current network interfaces on the machine. Is there a
way to do this in PHP? PHP 5.0.3, Mandriva Linux 2005 (2.6 kernel).
I'm not actually in front of the machine in question, and I don't
recall the minor kernel version, or the minor version of Mandriva...

Any thoughts? I'd prefer not to have to run the script as root,
incidentally. I realize I could run as root and then just parse the
output of ifconfig, but I assume there's a more intelligent way to go
about what I'm trying to do.

The purpose of this utility is to allow me to issue a ping, from a
specified interface (including virtual interfaces, e.g., eth0:1), and
test for connectivity from the webserver to the the address i am
pinging, through the specified network interface (rather than always
pinging from the default/primary interface of the machine).

Any thoughts? How would I go about this? I haven't been able to come
up with a way to do this, short of running as root and parsing
ifconfig, as I mentioned above.

View Replies !   View Related
Examples Of Using Inherance And Interfaces In PHP 5
As many of you knows, Zend has relased the Beta version of PHP 5. I
have allready make some tests of interfaces, classes inherance, static
and public variables, etc, and everything looks ok. Now, when you work
with PHP the most common thing is to do something with databases, you
have somehow the "same kind of pattern" like: logins, update, add,
delete data from de db, show data and that is it.

Now, I will like to use the new PHP 5 features in my next project. I
was trying to desing some clases and inferfaces for the "pattern" that
PHP use to have, and have not come with any good worthy idea. I know
Java too, so I was very happy about the the new features in PHP5 and
looking to use object model features. Im looking for very clear
examples on, how you have used the new features in PHP5 to do the "old
PHP thing"?

View Replies !   View Related
Java Or PHP 5.0 Question About Interfaces
Do interfaces enforce how many arguments can be passed to a method? If
two classes inherit from the same interface, can one have
formatThisText($text) and another have formatThisText($text,
$formatter) ??? I'm assuming the answer is yes, interfaces do enforce
the number of arguments.

View Replies !   View Related
Standard Interfaces And Objects? (Where Are They?)
I was wondering if there is a list some place of the standard interfaces
that are internal to PHP.

Specifically, I was looking for the docs on Iterators.

Is there a URL (or good search terms) one can use to find a list
of them?



View Replies !   View Related
Aggregate Functions
I'm trying to write some sql that groups by one value (a shop branch) from a subset of data (a set of sales, selected by tranasaction dates). Basically, I want to be able to set a date range and it adds all the sales up per branch,instead of grouping it by branch AND sales. So far I have the folowing non-working code.

SELECT [Tbl Transactions].Branch, Sum([Tbl Transactions].Nett), Sum([Tbl Transactions].Gross)
FROM [Tbl Transactions]
GROUP BY [Tbl Transactions].Branch
WHERE [Tbl Transactions].Ref = (SELECT [Tbl Transactions].Ref FROM [Tbl Transactions] HAVING ([Tbl Transactions].[Transaction Date] Between #10/30/2005# And #11/7/2005#))

The dates I have selected are just an arbitary test. Free pair of outdoor socks to the winner.

View Replies !   View Related
Aggregate Query
I combine these two queries to get the aggregate win total for the player from both tables? For example, I want to know how many games I have won as singles and as doubles. Code:

select PLAYER, sum(WIN)as W from singles PLAYER

select PLAYER, sum(WIN)as W from doubles PLAYER

View Replies !   View Related
Mysql_fetch For Aggregate SQL Function
I don't understand how I can fetch the result for an aggregate SQL
function. I have a query written like this:

$query = "select max(qno) from answers";
$result = mysql_query($query);

$maxqno = mysql_result($result);

$nextqno = $result + 1;

I initially tried to use the row$ = mysql_fetch_array($result)
function. But, my result isn't an element in an array, corresponding
to a table column in the database. I just simply want to get the
maximum value of "qno" from the table. How do I do it?

View Replies !   View Related
Creating A Hyperlink From An Aggregate Query
I have a query that produces an athletes ranking list across various events by performance. I would like to create a hyperlink to each athlete to show full results- the query only shows best performance over the season- so would like the hyperlink to bting up all athletes performances, showing date, meeting and performance-this is to overcome.

I am having where aggregate function at the moment produces results but brings up erroneous dates and meetings as I have non-aggregate ungrouped fields. Code:

View Replies !   View Related
Selecting Rows With Aggregate Functions
I have a table with race results in:

ResultID - Auto-increment unique result record ID
MeetID - Foreign Key - ID of Meet at which race was run
EventID - Foriegn Key - ID of race within Meet
Athlete - Foriegn Key - ID of Athelete owning this result
Distance - distance ran in this event
Time - race time for this result (0 if disqualified)

I want to get the Personal Bests out of this table - selecting the results which give the fastest time for each distance. This is for a report which will give athletes their PB times and when and where they were set. Code:

View Replies !   View Related
MySQL Sort/aggregate Problem
I have:

Desc   | +/- | Qty
A        | +   | 10
A        | +   | 10
A        | -   | 20
A        | +   | 5
B        | +   | 2
A        | +   | 3

I want the final output to be:
Desc   | +/- | Qty
A        | +   | 8
B        | +   | 2

Basically go through the table, and if something has been bought and sold completely, ignore that 'desc'. If not just display the final holding after all +'s and -'s. The first table will be in a mysql table, and the +/- will be 'B'/'S'.

View Replies !   View Related
Need To Aggregate Blog RSS Feeds Into A Single Site
I'm hoping to aggregate the RSS feeds of a number of blogs on a specific topic (with their permission, BTW!) so that they are collected on a single site.

I could use FeedDigest, which is great, but I'm looking for a more sophisticated solution, something that is searchable or at the very least stores older posts.

I could use Drupal I suppose, but wondered if anyone had any other suggetions?

I'm posting here as I would have thought PHP/MySql would probably offer the best solution. If I'm wrong, please let me know!

View Replies !   View Related
Which Tool To Use To Create Form For A Database? How To Build A Interfaces (or Web Pages) In Easy Way?
how to build a interfaces (or web pages) in easy way? how to build a form in easy way? how to automate and create web pages with a tool? which tool to use to create form for a database? I mean there is a way or a tool which help me to build an interfaces (web pages) to deal with the data in a database?

View Replies !   View Related
Static Classes Vs. Singleton Classes Vs. Globals
Sometimes I want to use certain data and functions anywhere in my code;
for example, when writing logging routines. In PHP5 I could write a
class with all static members and functions, a singleton class, or a
regular class assigned to a global variable. What would be the
advantages of each?

In Java web-apps (or in non-web applications), these classes persist
for much longer, so it's easier to see the reasons for using them. But
in PHP, it seems like you could do pretty much the same thing with all
three.



View Replies !   View Related
Classes Within Classes Scope Question
I have two classes, A and B. B is created as an object within A, but also needs to use a variable within A. How do you reference it? Example,

class A {
var somevar = "test";
A { $obj = new B (); }
}

class B {
B { print ( * $somevar from the A class * ); }
}

The class B is trying to use the variable $somevar declared in class A. I just don't know how to use the variable.

View Replies !   View Related
Implementing BBCODE?
I have been working on a system to add news and articles to a site, I have the core adding and removing out of the way and have had some very good advice from eelixduppy, the code for what i currently have is at the end of this post.

What i would to acheive is something where if i typed:

HELLO and wanted to make it bold i could wrap HELLO in something like the BBCODE on this forum. for example square brackets with a B inside to start the Bold area and square brackets with a /B inside to close the bold area, I would like to know how i can underline things with this too and perhaps add things such as font colours etc. a basic intro into how to get it to work would be great, here is the code i currently have if it helps in anyway at all.

<?php
include 'dbconnect.php'
$title = $_POST['title'];
$news = $_POST['news'];
$pattern = "/(http://[w.]+)/";
$replace = "<a href='$1'>$1</a>";
$title = preg_replace($pattern, $replace, $title);
$news = preg_replace($pattern, $replace, $news);
$title = mysql_real_escape_string($title);
$news = mysql_real_escape_string(nl2br($news));
$date = date("D d M Y, g:i a");
$sqlquery = "INSERT INTO tnews (Title, Body, Date) VALUES ('$title','$news','$date')";
header("Location: display.php");
//print $sqlquery;
$results = mysql_query($sqlquery);
mysql_close($dbc);
?>

View Replies !   View Related
Implementing [PHP] Tags
I was able to do is using string posistions, suprisied myself there. But how can I do it with regular expression? I have regex that looks like: PHP Code:

View Replies !   View Related
Implementing Security
Does any body know how to implement encryption in a web tranaction ,i mean credit card transactions using PHP ,is it advisible to do so or rather should i go for security certificates like verisign etc.Awaiting for your valid response.

View Replies !   View Related
Implementing A Tree
I'd like to implement a tree of "tags" for a blog I'm writing for fun in PHP.
Here's what a single tag looks like:

CREATE TABLE tags
(
name varchar(30) not null default '',
id_self integer(12) not null primary key,
id_parent integer(10) not null default 0,
);
INSERT INTO tags VALUES ('root of the tree', 0, 0);

Each tag has a name, a unique id to identify itself with and a parent's id,
and all this will be stored in a database, but stored in no particular order.

I'm a little stumped as to how to reconstruct the tree. Part of the problem
is that suppose my first read to the database yeilds:

name = "physics"
id_self = 21
id_parent = 2

but further down in the database, this record exists:

name = "science"
id_self = 2
id_parent = 0

in other words, it's possible that children may be read before parents.

I've noticed that some people have implemented a tree class. Since this is
supposed to be a *fun* project for me, I'd rather write it myself. But I
find myself staring at the keyboard, not knowing how to start.

View Replies !   View Related
Implementing The Paypal IPN
I have 2 problems, 1 of which is tied to PHP and 1 loosely tied, so
I'll put this out there.

Got a problem that I have been working on for a while now which
involves implementing the Paypal IPN. I am using PHP 4 to automatically
post back to Paypal and I am using curl package.

I am doing a Custom request and would like to know if anyone has
successfully posted data back to paypal with curl and got something
other than INVALID back. I am always getting INVALID!! :(

I am doign EVRYTHING they tell me to.. ie ordering the parameters and
adding the cmd=_notify-validate

I guess I have 2 questions:

1. Am I using curl properly with this paypal interface or is there
something I am not setting.
2. Has anyone a working version with HTTPS/curl/paypal. I am using the
https://www.eliteweaver.co.uk/testing/ipntest.php to test this.

The code is as follows:

// put all POST variables received from Paypal back into a URL $post =
array();

foreach ($this->paypal_post_vars as $field => $value) {
array_push($post,$field."=".rawurlencode(stripslashes($value)));
}

array_push($post,"cmd=_notify-validate");
$uri = implode("&",$post);
$ch=curl_init();
$this->error_out($uri);

curl_setopt($ch, CURLOPT_URL, $this->url_string);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $uri);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);

$this->paypal_response = curl_exec($ch);
$this->error_response = curl_error($ch);
curl_close($ch);

$this->error_out($this->paypal_response);

View Replies !   View Related
Implementing A Blog!
I have never written a script for a blog. I was wondering could someone
help me get started. What I mean is, could someone please explain to me
what is needed in order to implement a blog? How many database tables,
columns,and what type of database fields etc?

View Replies !   View Related
Implementing A Class
I found this class on the net, It breaks results of a query up into pages

I however know nothing of classes and have no idea how to implement this into my code

The class is: ....

View Replies !   View Related
Regarding Implementing A EULA
The first part of the project that I'm working on requires implementing a EULA.
When a user goes to my page, I want to see if they've already been there and have already agreed to the EULA at a prior time. If so, then it skips asking the question and goes directly to the main page.

If someone hasn't agreed to it before, then a page comes up asking if they agree to the terms of the EULA.

I'm assuming that I have to use some sort of combination of cookies/session variables. I tried doing some searches on EULA's, but wasn't able to come up with anything helpful. I was just wondering if someone here's already had to implement a EULA on their site and if so, how did you go about it? Are there better ways to go about it than using cookies?

View Replies !   View Related
Implementing A Calendar
I'm trying to add a calendar to my html text box similar to ones you can find on practically every travel site. A user clicks on the text box, the calendar comes up, the user clicks on a date, the calendar dissapears, and the selected date is entered into the text box. It really smacks of JavaScript, but I don't have to get that fancy.

View Replies !   View Related
Implementing A Thesaurus
I wanted to implement a thesaurus in a matching algorithm that I am writing, so that when it finds a word in inputted text, it then finds synonyms and looks for these in another person's inputted text aswell. So that, if I put in television and someone else puts in TV, it will find a match. Is there any way to do this?

View Replies !   View Related
Implementing Multiple Updates
I am looking for some perspectives (other than my own) on possible approaches to a task. Pretty straight forward, I have a mysql db, a few tables. Within these tables I allow users to enter data. One of the fields will track the date the item was added and I will be using other scripts to clean house so to speak when they get a certain age. I am currenlty playing around with some various implementations and have it so that users can display all of thier own "items". This results in a table being displayed showing many of the DB fields. User records are going to be in the range of 20-3000 so I have incorporated prev/next buttons using limits and offsets to retrieve the results. Since many times users may want to remove items prior to them being automatically removed by me due to age and on that same note, they may want to "refresh" the item as well so that it does not automatically get removed.

My initial thought was to use much of my current code to list a users "items" and allow them to refresh or delete items. My thought was to use 2 checkboxes, one to mark the item for deletion and one to mark it to be refreshed. Then the question arose, what would be an efficient way to maintain the status of the checkboxes for each record and how would that status best be preserved between pages? Should updates to the records be done as the user pages ahead/back or commited when the user reaches the last page?

Anyways, any ideas for an efficient, user friendly (hehe, and programmer friendly) approach would be greatly appreciated.

View Replies !   View Related
Having Problems Implementing Search
I'm trying to create a simple DVD shopping cart. I have
implemented a way to browse by genre and am trying to implement a way to
search by selecting title, director and actor and typing some text in the
text field for it to search the database.

As trying to implement the title, director and actor searches seemed to
complicated to try together, I am trying to make the title one work first
and then move on to the other two from there (2 more if statements
hopefully). Any help or advice would be great.

When I try to search with the code below, it just brings up all of the DVDs
again (I'm also not sure why the whole list of DVDs appears when the page is
first loaded).

Here is my code:

View Replies !   View Related
Implementing Password Protection.
How can I create a password prompt that comes up when someone tries to access the pages which can impact the database.

View Replies !   View Related
Problems Installing/implementing
i'm trying to set up php on my laptop at the moment. i have it located in e:program filesphp i've configured my webserver to point to the said location for php and php3 extentions.

when i try to load the page however, it is not interpreting corrctly. for example, the following code is outputting (part of) the 404 page when i request an existing page: Code:

View Replies !   View Related
Implementing Garbage Collection
so I am using the function session_set_save_handler with a mysql db to store the sessions. That all works. All I did was copy/paste and edit the example in the php manual. Now, the only thing is I have no idea how to implement the garbage collection. I tried putting just a print statement in my custom garbage collection and I don't get any output from it.

I thought that it was supposed to be called up whenever a session is started? atleast as long as session.gc_probability is equal to 1? which it is. Just to let you know, in the db table I have start_time and a last accessed time columns. The way I wanted to do garbage collection was like this. if current time - last accessed time is greater than maxlifetime delete the session. I guess my main problem is just that as far as I can tell the garbage function is never getting called up.

View Replies !   View Related
Implementing Tooltip In Code
i have this css code to make a tooltip in css PHP Code:

View Replies !   View Related
Help Implementing A User And Password Page
What I want to so is to restrict acces into a page, I was thinkin something as simple as this, having a Database in Mysql with fields user and pw use a kinda command like "where user='$user' and pword='$pword'" if the two fields match send the user to a webpage like admin.html, and the last thing how can I encript or hide the displayed url or page? like www.example.com/ or symbols etc... so a user cant cunsult the page jumping the loggin page?

Thanx allot, by the way, Im starting at this php and mysql, so please try to be the most explicit Ill apreciate it.

View Replies !   View Related
Implementing Shopping Cart/basket
i'm writing an online store using PHP/mySQL. to implement the basket, i decided to store parallel arrays in a cookie. one array holds item_id's, the other holds corresponding quantities. in my opinion, most recently added items should appear last on the list in the basket...so when adding an item to the basket, item_id's and quantities are pushed to the end of each array.

here comes the problem...when i want to query the database to get the name and price for each product i use the following SQL statement (where 888, 111, 444, is a list of item_id's in the basket):

SELECT `name`, `price` FROM `items` WHERE item_id IN (888, 111, 444)

i want to query the database only once. i think it would be foolish to run through the item array and query the database for each entry. but when i use that SQL statement, it automatically sorts the results by item_id...so i can't keep the information straight.

at first, i thought i could get the name and price when each item is added, and keep that information in the cookie as well...but what if the information is updated and the cookie info is old? so then i thought,

i could query it once (just like above) and store the information in a multidimensional array with item_id's as keys. i would still have to run a loop for each item in the basket...but it seems like the best solution because it only runs to the database once. what do you guys think?

View Replies !   View Related
Idea Behind Implementing Search Facility
I am building a website for an employer. They want to have a search
utility in it. I don't need a very complicated search utility.
Something simple which just searches through contents and products.
What's the idea behind it? I am thinking of putting everything in
database- all the contents that is. This makes it easy to search
through the fields in the database. Is this the correct way? Is there a
better way that you know of? Please point me in the right direction.

View Replies !   View Related
Implementing A Binary Permission System?
I'm attempting to figure out how to set up a sequential permission system using bitwise operators and such, and I'm having quite a time of it. I'm also having quite a time finding a good tutorial on how to do this.

My goal is to end up with a system that defines multiple permission levels (Admin, Accounting, Lead Tech, Tech, etc.) where if the permission level of a page is <= the user's permission level, the page is displayed (or the hyperlink is activated, etc.).

Does anyone have any pointers here on a sensical way to do this and/or a good tutorial that explains exactly how this works? I tried mucking around with the phplib authentication stuff but it's so poorly documented both in-code and on the web site that I'm lost.

View Replies !   View Related
Dreamweaver - Implementing User Authentication
I tried to implement user authentication using Dreamweaver 8.0 and php & mysql
I followed the steps accurately but when using a correct username and password it gives no response (not going to the specified php file in "if login success, go to").

View Replies !   View Related
Implementing A Transliteration Feature On A Php-based Discussionboard
How would you approach this task?
I have a phpBB forum on my site. The majority of participants are Russians
living in the US, who don't know Russian keyboard layout.
Is it possible to provide them with some sort of a button, in the posting
edit window to convert latin characters into cyrillic characters?

View Replies !   View Related
Implementing Search Within Files With Good Performance
Ive got 50-200 files with a total size of 3-10 MB which i need to be able to search.

How would you suggest the search code to be implemented?

These are some of my thoughts:
1) Since PHP is stateless i cant "upload" the file content to memory and perform search on it. Because of this im forced to open/read the files for every search. The best i could do is upload it into the users session, but large sessions can give severe performance problems. Code:

View Replies !   View Related
Using Classes Inside Of Other Classes
I'm wondering how to use another class inside a preexisting class, without passing the constructor in the preexisting class an object from a file that contains a new declaration.

IE: Instead of doing something like this...

View Replies !   View Related
Simple Way Of Implementing Bbcode Into A Php-based Website/database Design?
Can anyone recommend a simple way of implementing bbcode into a php-based website/database design? I'd like the user to be able to enter the data using bbcode's options (simple click and format options without having to know anything about code... like this site has) and have this display in pages when the results are pulled out of the database and displayed in HTML format.

View Replies !   View Related
No Libphp4.so File Created In Make Intstall Or Make.
I have done a make, and a make install on the 4.3.6 version, using
/usr/local/etc/php as the directory I make from. However, no matter what
I do, I do not see a php4lib.so that has been created. The documentation
I recieved (an IBM source) says that the following has to be added to the
httpd.conf file :

LoadModule php4_modulelib/apache/libphp4.so
..
..
..
AddModule mod_php4.c

here is the output from my make install :

[root@mail php]# make install
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR - already installed: 1.3.1
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] DB - already installed: 1.6.2
[PEAR] HTTP - already installed: 1.2.2
[PEAR] Mail - already installed: 1.1.3
[PEAR] Net_SMTP - already installed: 1.2.3
[PEAR] Net_Socket - already installed: 1.0.1
[PEAR] XML_Parser - already installed: 1.0.1
[PEAR] XML_RPC - already installed: 1.1.0
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
program: phpextdist

View Replies !   View Related
Implementing "Next10 - Prev10" In PHP3.
I have php/mysql code that fetches info from a mysql table. I need to implement code that shows only 10 at a time with "Next10" and "Prev10" buttons. I'm not sure how to implement the php3 part of it. Those buttons would call the same php3 module?

View Replies !   View Related
Implementing "search" On My Site
Where can I find information on implementing a search function on my site ?

View Replies !   View Related
Implementing Templates, Which Way Is "better"?
I'm adding templates to my PHP projects and I'm wondering which way is
better.

I have been doing small templates by creating a HTML frame and placing
PHP code to echo variables like this:

<div>Title: <?PHP echo $OutputTitle; ?></div>
The file containing the template would be saved and included when
running the code with require_once.

I have seen other approaches where the template contains strings such as
[OUTPUT_TITLE] and the template is parsed and the matched strings are
replaced with content.

I think that including the templates and echoing the variables should
produce less load compared to parsing the entire file multiple times to
find a string and replace it.

Does anybody have any input on templates?

View Replies !   View Related
Why Use Classes?
I feel that i mastered functions and now there is something called classes. What makes it superior to functions? Is it better to use them?

View Replies !   View Related
PDF , Classes, And PHP
I'm stuck at first base here. Currently working on turning a rather static PDF building script into a more modular, OO PHP app.

I have scaled this example down to the bare bones, trying to see what the heck is going wrong. It recognizes that is should spawn a pdf file, but then there is just no data. Nothing, no error, no helper app.

I'm only a week or so into PDFs and only a couple of days into OO with PHP, so I'm on the lookout for the obvious. I do have PHP/PDF apps that run fine off the same system.

Here is the class:
<?
error_reporting(E_ERROR);
/********************************************
pdfReport.class.php - description
********************************************/
/*
common functions / classes
*/
//class used to build rectangles - how exciting (-:
class pdfReport{
//define our common properties
//page properties
var $pdf;
function createPDF() {
header("Content-type: application/pdf");
header("Content-Dispositions: filename=report.pdf");
$this -> pdf = pdf_open();
pdf_begin_page($pdf, 612, 792);
}//end function createPDF
function closePDF() {
pdf_close($pdf);
}//end function pdf_close
function buildText() {
pdf_set_font($pdf, "Times-Roman", 15, "host");
pdf_show_xy($pdf, "Active Case Review Quarterly Report", 25, 780);
pdf_set_font($pdf, "Times-Roman", 26, "host");
}//end function buildText
}//end class
?>
And here is the page where I call the class:
<?
include("test.class.php");
//error_reporting(E_ERROR);
//create a report
$quarterlyPDF = new pdfReport;
$quarterlyPDF -> createPDF();
$quarterlyPDF -> buildText();
$quarterlyPDF -> closePDF();
//end pdf document
?>

thanks much for any input.

View Replies !   View Related
Value Of PHP Classes?
So PHP classes are pretty cool. But what is the value they provide? I understand the value of OO, but in the PHP environment, every class you instantiate lives only in the span of that request. There is no concept of singleton classes, or classes that remain across requests. The notion of allocating new memory for every instance of a class for every request seems wasteful. Thoughts?

View Replies !   View Related
Why Uses Classes?
I've read a DevShed article about classes in PHP, but still can't see a practical application for them considering you can use functions throughout your script, or (such as classes) include classes for certain scripts.

Can anyone tell me clearcut, what they are and why I'd use one, and in what instance?

View Replies !   View Related
Classes
I've been introduced to the concept of classes in PHP. Everyone says that they're the essence of object oriented programming and that they are extremely useful. Could someone give me an example of a good use of classes?

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved