Advanced Php Counter
I am looking for a advanced php counter. I mean not to increase when I hit 'Refresh' button of the browser and NOT to use SQL database. All the PHP counters I found on the web use a text file that is modified (open, and increase value of the content) when the 'index.htm' is requested by browser (and of course if I request twice from the same browser, same machine it will increase).
View Complete Forum Thread with Replies
Related Forum Messages:
Advanced Regex Help
having a few problems with a script im developing for www.cockneyizer.com the script translates websites into cockney rhyming slang, ive got the translation bit working but grabbing images of the server isnt flawless, in addition, sometimes links dont get converted to link back to the cockneyizer translation url heres the code, if you have any ideas of how to make it work better please <?PHP // remove cockneyizer translate url from $file $file = str_replace("http://www.cockneyizer.com/translate/.php?file=", "", $file); if (!eregi("http://", $file)) { echo "Please enter a valid URL (missing http://)"; } else { $fp = @fopen("$file","r"); if (!$fp) { echo "Core Blimey, no such page mate"; } else { $input = implode("", file($file)); include('dictionary.inc.php'); while(list($text,$image) = each($replace)){ $input = str_replace(strtolower($text), strtolower($image), strtolower($input)); } $input = preg_replace("/name=movie value=(["'])(([a-zA-Z0-9/.-\_^'^"])+)(["'])/", "name=movie value=1$file/24", $input); //flash $input = preg_replace("/src=(["'])(([a-zA-Z0-9/.-\_^'^"])+)(["'])/", "src=1$file/24", $input); //images $input = str_replace("'//", "'/", $input); $input = preg_replace("/background=(["'])(([a-zA-Z0-9/.-\_^'^"])+)(["'])/", "background=1$file/24", $input); // background images $input = str_replace("'//", "'/", $input); $input = preg_replace("/([^w/])(www.[a-z0-9-]+.[a-z0-9-]+)/i","$1http://$2", $input); //make sure there is an http:// on all URLs $input = preg_replace("/href=(["'])([w]+://[w-?&;#~=./@]+[w/])/i","href=" http://www.cockneyizer.com/translate.php?file=2", $input); //make all URLs links $input = str_replace("'//", "'/", $input); echo $input; } } ?>
View Replies !
Advanced PHP Debugger
We 've installed ADP. But I have a problem. All generated trace file are empty (only 1 byte). Any idea what the reason could be ? Right/Permission issue ? I'm not sure cause the file is created without any problems.
View Replies !
Advanced PHP Graphs
I have to create graphs which you can zoom into and have more controls. I dont want to use a Java Applet and would love to use PHp and any of its library. I guess such thing can be done with PHP and Flash and/or Javascript etc. Please guide me. A point to a tutorial or an example will be highly appreciated.
View Replies !
Advanced OO Topic
I notice a strange behavior in PHP4 and wonder if anyone can explain it. Essentially, when I extend a class from a built-in module, I can add and access variables but can not access new functions I create within the extended class. This has only happened attempting to extend classes from ming, but I suspect it may be a universal problem (?). That is: <?PHP class foo { } class bar extends foo { function bar() { print "bar"; } } $bar = new bar(); $bar->bar(); //PRINTS "bar" ?> Works as expected, however, in: <?PHP class foo extends SWFSprite { var $x = 10; function bar() { print "bar"; } } ?> running: <?PHP $foo = new foo(); print $foo->x; //WORKS; PRINTS "10" $foo->bar(); //RETURNS "Undefined Function" FATAL ERROR ?> Can anyone explain this behavior? Will it be fixed in PHP5? Is it related to the Zend engine? Any workarounds?
View Replies !
Advanced PHP Pagination
Is there anyone who could help me create an advanced pagination code? The basic: 1. Data to paginate will be coming from msyql database. 2. 10 or 20 items per page. etc, etc... The problem: Limit the number of page numbers to 5 when pages reach more than 5 pages. Example: Total pages: 10 sample page listing output: start of pagination 1.) << 1 2 3 4 5 >> displayed when last page number is clicked (5) on start of pagination 2.) << 3 4 5 6 7 >>
View Replies !
Advanced Search
Im looking to do one of the more advanced searches where you have a form you can narrow the search by username, user type, date entered, etc. Everywhere I've looked all I can find is the basic searches. Can someone point me in the right direction or show me some code.
View Replies !
Advanced Form
I don't know how it's called, but I want to ask how to make a form which able us to make bold, quote, link or change font color by using [].. like in this forum.
View Replies !
Advanced SQL Query
I have built a script that checks if another server is up or down. If the server is down it stores the timestamp in a MySQL database – but if the server is running nothing is stored. The reason why I don’t store the uptime is because the scripts runs every minute, so the database would fill up really fast so Iamm trying to avoid string the uptime. The problem is when I want to select the last downtime I want to count how many minutes the server was down. The database looks something like this: Id – Date 01 - 2005-11-17 12:00:00 02 - 2005-11-17 12:01:00 03 - 2005-11-17 12:02:00 04 - 2005-11-17 12:03:00 05 - 2005-11-17 15:00:00 06 - 2005-11-17 15:01:00 07 - 2005-11-17 15:02:00 08 - 2005-11-17 15:03:00 Okay, according to the table the last downtime was November 11 @ 15:03 and then the server was down for 4 minutes.
View Replies !
Advanced Captchas
I know there are tutorials for making really simple captchas, but I think that most spambots today can probally crack them easily. How can I make an advanced one like the ones rapidshare uses?
View Replies !
Advanced 'include'
See, I read somewhere about only having one template file so layout design is easy to change, which I loved the idea. But right away I thought I might have a problem somewhere, so I tried it out, and of course, I did. What I'm doing is (mind you these tables and pages are just for testing): I have a php file that lists all the songs i have in a table and links each song title to $PHP_SELF?id={$row['id']} which displays different information which works just fine by its self. Code:
View Replies !
Advanced Order
Using PHP loops I have a screen print something like this: 1) Owners [1 1) Management [1 2)Manager [1 2)Supervisor [2 1) Programming [1 The table has a column called `tier` which corresponds to the #)'s, which are updated via the loop. Another column is `the_order` which is updated via select fields and it corresponds to the [#'s. Does anyone know some way using group by or something of that nature with to have a select field print out the results in that order. PHP Code: $query = "Query in question"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo "<option value="$row[id]">$row[name]</td>"; }
View Replies !
Advanced Graphing
I have a big fat database table full of records that include a date, a time and a value. The records look something like this: 7/7/2006 11:05 200 7/7/2006 11:10 300 7/8/2006 11:05 100 7/8/2006 11:10 50 How can I query this data and have it arranged as so: Code:
View Replies !
Advanced Arrays
i have been mucking around with my foreach loop for a while, but i need a way to generate tables, with php, just a table that i can put values into but depending on haow many values - $files - i need a square table Code:
View Replies !
File Uploads - Advanced
Is is possible to tell the OS what type of file to browse for? By default the 'Files of type' is 'All Files *.*' I'd like to set this so that it defaults to JPG file types.
View Replies !
Advanced Mysql Query
There are currently two queries in one of my scripts. One is: SELECT * FROM foo the other is: SELECT var FROM bar WHERE something = 'somethingelse' Is is possible to use a join statement and combine these two into one query? My reason is that I'm trying to speed up the script, and hopefully combining the queries will do that.
View Replies !
Email Validation (advanced)
so i know this can be done and i'm pretty sure PHP can do it, i'm just not sure if i need to set up a cron or something. I need a way to be able to send out emails when someone subscribes to a service (this i know how to do) and then when they recieve the email they need to respond to it, then when i recieve their response, their membership is confirmed.
View Replies !
Upgrading Php On WIN 2000 Advanced
I am currently using php 4.04 on a WIN 2000 advanced server and I want to upgrade. I downloaded the win32 4.3 installer and think its just a matter of running the installer to complete the process. Is there anything else I need to configure (besides the php.ini) to keep my existing scripts running correctly? I am running multiple sites on one domain so I don't want to screw up the upgrade and cause any downtime.
View Replies !
Advanced Search Replace
im developing a script which grabs remote html files and shows them on the local server, ive written some code which changes the path of image files to point to the files on the remote server, this code can be seen below: Code:
View Replies !
Advanced Dropdown Menu
I want to populate a dropdown menu with countries that are in one column of my table. I know how to do that, but I can't find how to eliminate multiple items. Some countries appear several times in different rows, but I only want each available country to be shown once in my dropdown list.
View Replies !
Advanced Email Validation
I need a script which checks if an email address exists. I've been testing a few scripts, but all of them only validates the domain, for example, the script says this email exists; foo_this_email_does_not_exist_123456789@hotmail.com Just because the domain exists. For example, Is it possible to check if the foo_this_email_does_not_exist_123456789 account exists on Hotmail's server? Or foo_account at usa.net's server?
View Replies !
Advanced Registration Forms
I'm trying to design a registration form so that when the user fills the form fields if he made a mistake i.e (forgot to fill the last name field) and then returned back to the form page he finds all the fields he has filled existing only the one with the mistake highlighted. So is there a way to design such a form using php?
View Replies !
Advanced Form Jiggerypokery?
Can any of you mySQL/PHP masters help me? What I wish to do is have a piece of text saying 'You have already filled out this form' when a user has previously filled out a form and submitted it. Our site (http://www.pickawin.net) uses quite a few forms and users have requested the functionality to be notified if they have already filled out a certain form on the site.. It is a PHP-fusion installation, using a mySQL DB. I understand it would require (something like) the form, once filled out and submitted, to create an entry against the user's name in the mySQL DB and the an entry for the form they have just filled out - then when the user goes back to the page, for a bit of script to be called to show whether they have prevously filled out this form or not.
View Replies !
Advanced XMLHttpRequest Usage
Please understand that I know how to code in both javascript and PHP and know how to use AJAX very well. I have an entire scheduling system set up with employee management and shift requests using the XMLHTTPRequest object. That said, here is my question/dilemma: Within said scheduling system, I have a span that is filled using the xmlhttprequest object. That span, once filled, is able to call javascript functions from the parent document (i.e. the page that is loaded into the span can call functions in the page that contains the span). However, if I would like to be able to access objects within the AJAX loaded span. Is there a way to do this? A specific basic example: page1.php contains a span with id="test_span" page2.php contains a table, with a cell that has an id='cell1' page2.php is loaded into test_span using AJAX page1 calls a javascript function that uses "document.getElementById('cell1') and changes its color...nothing happens (no javascript errors either)
View Replies !
Html_QuickForm Advanced Multiselect
Does anyone have any links / knowledge on how to limit the number of items that may be added the the "selected" box? eg: 50 items available for selection BUT only 6 items may be selected / in the "selected" box.
View Replies !
Advanced & OO PHP Book Recommendations
I can create fully functional websites, custom CMSs and so on. However, I would like my code to be more modular, easier to maintain, and generally "better." I'm not very good with object-oriented PHP at all, and I would like a book that can get me on that path, as I think it's the way to go, (correct me if I'm wrong), and generally get me thinking about advanced and/or different PHP techniques. I've read that Larry Ullman is a good author. Is this true for what I am looking for, or are his books more like "LAMP for Dummies" -type books? I've always just used the PHP manual to figure things out, but I want to advance my coding. I'm not looking for a reference manual of functions and stuff - I'm looking for techniques and ideas.
View Replies !
Advanced Countdown Timer
I'm not even sure of the script I'm looking for I was origonally looking at javascript but I think it needs to be serverside, I'm not sure why I think this though... I have very little experience in scripting. What I want is to have a countdown timer that will countdown till the end of an event, but will only count down while the event is in progress at my Local Time. (eg. hours left of grade 10: will only countdown when I'm actually at school)
View Replies !
Advanced Search Function
I'm trying to write an advanced filter function. Sofar I have 5 parameters which could lead to 25 possible queries. Instead of having to write them all, how do people normally tackle this problem?
View Replies !
Advanced Topics Book?
i'm sincerely in need for literature (in form of one or more books if possible) on advanced php topics like template systems, frameworks, MVC, ... can anyone provide a few titles or authors?
View Replies !
Export Data To CSV Advanced
I have a small script to export my customer data to a text file. I thought i'd make it a little more advanced for some friends of mine, but I'm getting lost in what's best. I want to add some dropdowns to the form that allows me to choose the order of the columns. Is this doable? I've been playing with it and so far I'm not successful: PHP Code: <?php if (!$HTTP_GET_VARS['submit']) { echo "Export and Save Customer Data onto your Local Machine"; echo '<form action="'. $phpself.'">' echo '<input type="submit" value="Export" name="submit"></form>' } else { $contents="Firstname Lastname Email Newsletter ................
View Replies !
Reordering Advanced Arrays
I have a form where user can send up to three pictures. <input type="file" name="imagefile[]"> <input type="file" name="imagefile[]"> <input type="file" name="imagefile[]">, etc... Now, this what's happening when someone post two pictures but escape the second input (that is use the 1st and 3rd input). I get this (you can see that [1] is empty) : Array ( [name]=>Array([0]=>photo.jpg [1]=> [2]=>photo2.jpg) [type]=>Array([0]=>image/jpeg [1]=> [2]=>image/jpeg) [tmp_name]=>Array([0]=>D:3F6.tmp [1]=> [2]=>D:3F9.tmp) [error]=>Array([0]=>0 [1]=>4 [2]=>0) [size]=>Array([0]=>24426 [1]=>0 [2]=>28712) ) Is there a way to rearrange the array so that empty key are at the end of the array (I need this: [name]=>Array([0]=>photo.jpg [1]=>photo2.jpg [2]=> )
View Replies !
Joins/Advanced SQL Concepts
I'd like to learn some advanced SQL concepts so that A) I understand them here on the board (if you notice, I tend to stay away from the DB forum ) and B) when the need arises, I can use them without hesitation. what type of data/database structure might be good for learning joins and more advanced SQL concepts? What I mean is this right now, I have no databases that use joins, nor can I think of any that will allow me to experiment with joins effectively. So what types of databases would be good? Like: library (check in/out system, reference books in one table and checked out in another), company, etc. I'd obviously be putting in some fake data so I can try to learn more about them.
View Replies !
Search In A File (advanced)
1. What do I want to do? I wish to create a search <FORM> to search in the contents of a text file located somewhere on the server. I wish to be able to: a) set a search criteria which is different from exact phrase Example: Searching Blue monkey happy should find Happy blue monkey b) set a search criteria with case INsensitive Example: Searching HAPPY BlUe MonKeY should find Happy blue monkey c) as the text file contains lines with a unique record on each; and on each line there are words separated by a TAB delimiter, I would like: - if a part of the line in the file matches the search criteria, the WHOLE line has to be printed; - results have to be printed in a <TABLE> with <TR> for every line match and <TD> for every word between the TAB delimiters in the file. Code:
View Replies !
Advanced Encryption Satndard AES In PHP
I cannot use mcrypt library bcos we are hosting the application in some one else server. there mcrypt is not configured. another thing i like to use Advanced Encryption satndard AES. How we can implement it through PHP. I feel AES is the latest encryption technology. PHP Application on server will encypt the data and at the clientside Javascript will be used to decrypt the data.
View Replies !
Advanced Search Engine
I have a couple of sites built with different databases because all these sites are under different subject. And the databases have been built for a long time already. I want to make a global search engine so if you search for ie. "berry", it would display results from all databases that have the search word. Right now, if people want to search for "berry", they would have to go to my A database to search for it. Then if they want to search for "berry" from my B database, they would have to go there to search. So it's very inconvenient. I know I could just incorporate all the databases together into one big database, but I don't want to do that.
View Replies !
Smarty Advanced Tutorial
I tried to find on google but most of them show only very basic functionality like assigning a variable and then displaying the template. These don't give me the taste of this template engine and I feel like missing something important and big.
View Replies !
MySQL Advanced Query Woes
I'm trying to figure how to begin on this. I have a mySQL db with a number assigned with user_id. There are multiple records for each user_id with different numbers. I can retrieve all the records or select by user_id and add the results. How do I grab all the records, sort by user_id, add the numbers while user_id = user_id, and sort the results from highest to lowest?
View Replies !
Advanced Search With Relevance Using Php And Mysql
I am working on a classifieds site that allows users to search for ads using many options. For example in the rentals area the user can select how many bedrooms, bathrooms, if pets are allowed, etc. There are currently 9 fields that i am allowing them to search on. I already found a great class on this forum that will make the dynamic mysql select statment, but i was unable to find much info on relevance displaying the best matching result first and the second best second and so on. I found a couple of tutorials but they were talking about matching a single word and the only relevance was that they were listing results higher depending on which result has the search string the most times. What i am trying to do is order relevance by having the top match be the one that matches closest to the 9 selections the user entered. So i would want any exact matches of all 9 fields at the top and then the list of matches would get less and less exact as you go farther down into the results. My initial thought was to make more than one mysql select, having the first select match all the searched fields exactly, and then the next select would do the same thing except one of the fields would be changed to find all of that one field that are not equal to what the user entered. example: PHP Code:
View Replies !
PHP Mail And WIN2k Advanced Server
I am running Win2k Advanced server and php and I am having trouble getting the mail function to work. I have modified my php.ini file to reflect the SMTP server name but when I run my php program that uses the mail ( ) function I get the following error: Warning: Failed to Connect in C:pathsubmit.php on line 33. Anyone know what I need to do here to get this to work? I am not currently using the default WIN SMTP server. I know the smtp server name is correct and I can telnet to the server port 25 from the outside. I either get a "failed to receive" or "failed to connect" issue. Is this a firewall issue? Are there any other ports that need to be open for the mail function to work?
View Replies !
Advanced Search Template -- About Programming.
I know nothing about programming but I am building a website (written with php) that allow people post some info. Is there a site I can get some templates or php scripts for an advanced search function? The Advanced Search function shall able to search any posted info by a postal code/zip code within certain kms and be able to search by map by clicking to US/Canada map to get to state, then to cities than to towns....
View Replies !
Super Advanced Max Array Function
i'm out here looking for a super fast function to find the max in an array. iterating through the entire array is just too slow. the max function won't work either because my arrays look like this: array( array(price1, item_id1, quantity1), array(price2, item_id2, quantity2), array(price3, item_id3, quantity3)) i'm trying to find the highest price...anybody have any genius ideas?
View Replies !
Gzip Advanced Implementation Considerations
i want to gzip my js and css files. However the thing is: - I would like to have a cached version of the gzipped version - I want to set expiration headers Option 1: Use mod_rewrite together with a php script to do just that. Problem is that it uses php for serving the javascript files. Im not sure what that does to the speed. Option 2: Only use the apache configuration to do the above. Problem is that mod_deflate (apache 2.0) has no way of caching the zipped file. Was considering something like using two different files Anyhow, what do you suggest?
View Replies !
How To Get Into More Advanced Object Oriented Stuff
I already know the basic principles of OOP, and though most of my code is procedural, I often write simple classes to handle problems that have an obvious object-oriented solution. However, I'd very much like to get into more advanced OOP techniques, and start exploring design patterns. I've scoured the web, but it seems like most OOP tutorials are either aimed at programmers who are just starting out with OOP, or those who are already gurus. I can't find anything that's intended for programmers (like myself) who are comfortable writing basic classes, but don't know how to push their entire architecture in a more OO direction. I'm gradually learning more about abstract classes, static methods, and so forth, but I can't find much information on architecture from an OO standpoint. As a learning exercise, I'd like to write a web-based game (patterned after Nethack) that is fully object-based - with the entire game session consisting of a single Game object, which is serialized and stored in a database between accesses. I'm having a little trouble figuring out the best model to use. It seems to me that each game "turn" will consist of two phases: a player phase, where the user selects an action, and a computer phase, where that action is processed, along with any other activity that needs to happen before the player is allowed to select another action (enemy activity, etc.). Questions: Does this sound like a viable and appropriate architecture?Can you guys recommend any sites/books/other resources that provide the kind of mid-level OO instruction that I need?
View Replies !
Sort Of Advanced Database Output
Having problems putting it down in Notepad just how to confront the following problem. I have a database table called tablename that I want to output into a html table just one of the columns called name and I want to skip the rows that has another column called other_name as NULL $result=mysql_query("SELECT * FROM tablename WHERE other_name IS NOT NULL"); Right, I know how to set up loops and such and have done so but not gonna take up space here to show it as it seems unnecessary. What I want is a html table to display three records of the name in one single table row or column(suspecting table row will be easier, but would prefer column.), one in each field and if there are more, create another table row/column and continue with new 3 fields.
View Replies !
I Want Advanced Chat Module For Drupal
I am new to drupal & dont have enough knowledge of PHP aswell. But I can mess with the coding thing. I recently developed a website using Drupal & now I am looking for an advanced chat module for Drupal with Smiley,custom chat room, banning & administration options. If you know about such module for Drupal, please let me know. I am badly in need of a good chat module.
View Replies !
Advanced Search - Listing Multiple Results
I created a seach function to search a database and retrieve the information based on the input. However only the first matching result is shown. The code is working fine but i want to show every matching result, one after another. Therefore, for example, if the user types into "country" the word "USA" every event will be shown. I have included the code i have used so far. Code:
View Replies !
Advanced Email / Excel Spreadsheet Writer
I have to run a script that generates a report into an excel document then emails the document simultaneous to the user with the spreadsheet attached! Although it needs to write a document for each users specific details in the database and mail that user his specific spreadsheet with his details in! Heres a sample of what im trying to do. Code:
View Replies !
Advanced: + HTTP/1.1 + Keeping Connection Alive
I need to maintain the connection between my PHP5 script and the client alive. A client issues a HEAD request. I answer back to the client with several HTTP headers, such as Conten-type of what the client would want, Content-length, etc. Without closing the connection the client will then respond with a GET request, to try to obtain a part of the file. Then I need to respond with 206 Partial content, and deliver the chunk of the file the client wants. My problem is, everything I've ever done in PHP has been only answering, the pages never listen to a response from the client, only to requests. Code:
View Replies !
|