 |
| Recent blog posts: | |
 |
| They have birthday today: | |
 |
| Forums: | | |
 |
| Discuss: | |
 |
| Recent forum topics: | |
 |
| Recent forum comments: | |
 |
| Модератор: | |
 |
Monday, 22 January 2007
|
| PHP Functions as XML or DB WeberSites LTD 11:06:58 |
| | Hi I'm looking to create a Table that holds all of the PHP Functions, their description and syntax.
It's all in the manual and I'm trying to extract it from there but I find it hard since the HTML template is not the same for all the functions.
I may be going about this the wrong way... is there an easier way? thanks berber
|
| | 2 answer | Add comment |
|
| [PHP-DEV] CVS Account Request: abdelmalek65 Ka Ka 00:35:04 |
| | abdelmalek65
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| [PHP-DEV] what means is 'CC' and 'DC' in the 'TSRMLS_CC' and 'TSRMLS_DC' ? yAnbiN 00:35:04 |
| | Hi! I know that the 'TSRMLS' is an abbreviation of 'Thread Safe Resource Manager Local Storage', but what means is 'CC' and 'DC' in the 'TSRMLS_CC' and 'TSRMLS_DC' ?
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 3 answer | Add comment |
|
| problems with sessions variables and virtual domains in apache Esteban 00:35:04 |
| | I have a windows 2000 server with apache 2.0 and php 5.1.2. I use session variables to validate users, each page have something like this:
if($_SESSION["validated"]==0){ header("Location: index.php"); exit; }
This worked fine when i had only one domain, but when i began to use virtual domains, sometimes, not always, the session variable lost the value or the session variable is distroyed, i don't know what really happens. I add this lines to httpd.conf for each domain and the main domain is first:
<VirtualHost *:80> ServerAdmin admin@domain.com DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/domain" ServerName www.domain.com ErrorLog logs/domain.com-error_log CustomLog logs/domain.com-access_log common php_admin_value upload_tmp_dir "C:/Program Files/Apache Group/Apache2/htdocs/domain/tmp" php_admin_value session.save_path "C:/Program Files/Apache Group/Apache2/htdocs/domain/session" </VirtualHost>
At the beginning i didn't use the two last lines with php_admin_value, i add the lines for trying to solve the problem but it doesn't work.
I have an application made with phpmaker and SquierreMail v.1.4.7 too, and i have the same problem in both. In both case sometimes, when i want to go to other page, the server ask me for the username and the password, it is not always.
Please help me
Thanks.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
Sunday, 21 January 2007
|
| Query Help Josh Johnson 23:08:06 |
| | I've implemented the scheme I briefly outlined in my last post (locking for data integrity), and now I'm writing queries to get totals from my logs, and I think I might be over-complicating things, and I'd like some alternative views on the subject.
My "grandiose scheme" works like this:
Problem: logging unique users that are authenticated for access to my companies website into a MySQL database table, only valid data to report is total number of unique authentications.
Solution: because of the high volume of unique authentications being logged (over 15k per day), I periodically "condense" the data into 3 tables beyond the main table that logs users as they come in.
My tables look like this:
+---------------------------+ | access_log | +-----------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+---------------+------+-----+---------+-------+ | timestamp | timestamp(14) | YES | MUL | NULL | | | code | text | | | NULL | | | refer | text | | | NULL | | | ip | varchar(64) | | | | | | access | varchar(128) | | MUL | 0 | | +-----------+---------------+------+-----+---------+-------+
NOTE: The access field in the access_log table correlates to the client field in the table below. Logging was an afterthought initially, but then it became very important, so I cannot change the field now without a lot of debugging. Doing this database cleanup wasn't a priority either until a couple of months later when the size of the access_log table grew out of control (over 1GB on disk, 800k records).
+-------------------------------------+ | access_log_daily/weekly/monthly | +--------+---------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+---------------+------+-----+---------+-------+ | client | varchar(32) | | | | | | total | bigint(20) | | | 0 | | | stamp | timestamp(14) | YES | | NULL | | +--------+---------------+------+-----+---------+-------+
I've set up a cron jobs that run these queries periodically: Daily: LOCK TABLES access_log WRITE, access_log_daily WRITE; INSERT INTO access_log_daily (client, total) SELECT access, COUNT(timestamp) AS total FROM access_log GROUP BY access; DELETE FROM access_log; UNLOCK TABLES;
Weekly: LOCK TABLES access_log_daily WRITE, access_log_weekly WRITE; INSERT INTO access_log_weekly (client, total) SELECT client, SUM(total) as total FROM access_log_daily GROUP BY client; DELETE FROM access_log_daily; UNLOCK TABLES;
Monthly: LOCK TABLES access_log_weekly WRITE, access_log_monthly WRITE; INSERT INTO access_log_monthly (client, total) SELECT client, SUM(total) as total FROM access_log_weekly GROUP BY client; DELETE FROM access_log_weekly; UNLOCK TABLES;
So this way, the access_log table is never bigger than the total number of users for a 24 hour period, but we can still look into it if a problem arises where we need someone's ip address or the auth code they were given, and the other tables can only be as big as the interval of "condensation", times the total number of clients, and store totals, so it *should* be easy to gather information from them.
In my reporting scripts, I need to be able to find the grand totals for the past hour, day, week, month, and year. My first idea was to use multiple queries and just add all of the results together, but I'm not sure if this is the best way, or if it will reflect the most accurate per-period results. I appreciate any input anyone has.
Thanks, -- Josh
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 135 answers | Add comment |
|
| First Character In A String Christopher Deeley 19:38:51 |
| | Can anyone tell me if there is a function to return the first letter in a string, such as:
$surname="SMITH"; $forename="ALAN";
Is there a function which I can use to make $forename "A", so I can display it as A SMITH?
Thank You In Advance
|
| | 7 answers | Add comment |
|
| Script to generate a site thumbnails Pablo L. de Miranda 17:29:00 |
| | Hi People,
I'm needing a script that generate a site thumbnail from a given URL. Anybody can help me?
Thanks,
-- Pablo Lacerda de Miranda Graduando Sistemas de Informa o Universidade Estadual de Montes Claros pablolmiranda@gmail.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 3 answer | Add comment |
|
| Access restrictions for Forum application Dirk H. Schulz 16:49:22 |
| | Hi folks,
I am looking for a possibility to have forum categories that can only be accessed by certain user groups.
Forum application seems not to be able to do that.
Fudforum cannot be administered because the /adm folder is not inside the /fudforum folder in the current tarball (by the way: is that on purpose?).
Any other idea? Or is it nowhere implemented?
Thanks for any help or hint.
Dirk
|
| | 1 answer | Add comment |
|
| Forced File Downloads Don 16:32:24 |
| | I've been having my forced downloads sometimes finish prematurely using readfile(). I'm downloading a Windows .exe file.
I've read several posts that have suggested the substitution of a fread/feof loop to write out the download in smaller chunks. I tried using a function (readfile_chunked) I found in the user comments on php.net.
But for some odd reason, every time the downloaded file is one byte larger than the original file, and it's not being recognized as a valid Windows file.
I'm using PHP 4.4.4 on a shared Linux server running Apache. IE and FireFox both exhibit the problem on the Windows end. I'm using WinXP SP2.
I've listed relevant snippets below. $file_name is the fully qualified path to the (.exe) file.
Any ideas? #=============================
# Download the File
#=============================
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Content-Disposition: attachment; filename=" . $file_name . ";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . @filesize($file_path));
header ("Connection: close");
@ignore_user_abort();
@set_time_limit(0);
// @readfile($file_path);
readfile_chunked($file_path, FALSE);
exit();
......
function readfile_chunked($filename, $retbytes = true) {
$chunksize = 8 * 1024; // how many bytes per chunk
$buffer = '';
$cnt = 0;
$handle = fopen($filename, 'rb');
if ($handle === false) {
return false;
}
while (!feof($handle)) {
$buffer = fread($handle, $chunksize);
echo $buffer;
ob_flush();
flush();
if ($retbytes) {
$cnt += strlen($buffer);
}
}
$status = fclose($handle);
if ($retbytes && $status) {
return $cnt; // return num. bytes delivered like readfile() does.
}
return $status;
}
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 2 answer | Add comment |
|
| Request for... Wikus Moller 16:09:29 |
| | Hi.
Since this is a mailing list for web developers, I thought I might as well post an o f f t o p i c request. Does anyone know of any website where I can get a exe or jar sitemap generating software? Particularly not GsiteCrawler as it uses too much system resources. A java applet would be nice. And, if possible, free of charge ^.^
And does anyone know how and if a j a v a applet can be extracted from a webpage?(also a class)
Thanks Wikus
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 10 answers | Add comment |
|
| Re: [PHP-DEV] Plz help me. I can not login my account. Nuno Lopes 13:40:28 |
| | We don't use cvs over ssl, just plain pserver auth. If you forgot your password, you can modify it at http://master.php.net/forgot.php
Nuno
----- Original Message ----- > Hi, all,>
Sorry for disturbing you.> I cant login in my account "mikespook" with the passwords that I set up > before.> I dont know if I type a wrong passwords or I need more setup with the> cvs client as SSL etc.> Another problem is how I can modify my password with the cvs account.> Thanks and Regards!> Mike -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
|
| one click - two actions? Mel 13:34:23 |
| | Could someone please help me figure out how to show some description (where applicable) at the same time as I show an image, when I click on a link, without repeating the entire query? The image and the description are both in the same table in my database.
I now show the image when I click on the link which is good, but the description stays on at all times instead of appearing only when active.
http://www.squareinch.net/single_page.php
This is the code I have for the image area: /* query 1 from client */ $query = "SELECT * FROM client where status='active' or status='old' order by companyName";
$result = mysql_query($query) or die ("Couldn't execute query");
while ($aaa = mysql_fetch_array($result,MYSQL_ASSOC)) { echo "<span class='navCompany'>{$aaa['companyName']}</span><span class='navArrow'> > </span>\n";
/* query 2 from job */ $query = "SELECT * FROM job WHERE companyId='{$aaa['companyId']}'"; $result2 = mysql_query($query) or die ("Couldn't execute query2");
foreach($aaa as $jobType) { $bbb = mysql_fetch_array($result2,MYSQL_ASSOC); echo "<span class='navText'><a href='single_page.php?art=".$bbb ['pix']."'>{$bbb['jobType']}</a></span>\n"; } echo "<br>"; } ?>
</div>
<div class="navbox3"><?php $image = $_GET['art']; ?> <img src="images/<?php print ($image) ?>" alt="Portfolio Item" border="0" width="285" height="285"></div>
This is the code I have for the description area:
/* query 1 from client */ $query = "SELECT * FROM client where status='active' or status='old' order by companyName";
$result = mysql_query($query) or die ("Couldn't execute query");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
/* query 2 from job */ $query = "SELECT * FROM job WHERE companyId='{$row['companyId']}'"; $result2 = mysql_query($query) or die ("Couldn't execute query2"); $url = mysql_query($result2);
foreach($row as $url) { $row = mysql_fetch_array($result2,MYSQL_ASSOC); if ("url={$row['url']}") echo "<span class='navText'><a href='{$row['url']}'>{$row['web']}</ a></span>"; }
echo "<br>"; } ?>
|
| | 12 answers | Add comment |
|
| Php / MySQL DESC tablename Beauford 13:25:08 |
| | Hi,
First off thanks to everyone for the previous help. I managed to get it sorted out and used several of the suggestions made.
I am trying to do a DESC table_name using PHP so it looks like it would it you did it from the command line.
i.e.
| Field | Type | Null | Key | Default | Extra | +-----------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(30) | NO | | NULL | |
What I have found is that the following does not work the way I would have thought.
$query = "DESC table ".$currenttb; $result = mysql_query($query);
while ($row = mysql_fetch_row($result)) { etc.....
I have found something that works, but it is still not like the above and is really bulky. I can not get the type (varchar, etc) to show like above, it will show string, blob, etc, and the last problem is it puts the last 4 fields in one variable (flags).
Does anyone know of a way to get this to output as shown above. I am putting this into a form for editing, so I need everything in the proper places.
Thanks
Here is the entire code:
mysql_select_db($_SESSION['currentdb']);
$result = mysql_query("SELECT * FROM ".$_SESSION['currenttb']); $fields = mysql_num_fields($result); $rows = mysql_num_rows($result); $table = mysql_field_table($result, 0);
for ($i=0; $i < $fields; $i++) { $type = mysql_field_type($result, $i); $name = mysql_field_name($result, $i); $len = mysql_field_len($result, $i); $flags = mysql_field_flags($result, $i); echo all the filds.... }
This outputs (depending on the order you echo them):
username string 50 [not_null primary_key auto_increment] value in [] is one value.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
| PHP Warning: session_destroy Andre Dubuc 13:11:11 |
| | Hi,
To stop bots from accessing secured pages, I've added the following code to a banner page that is called by every page. Furthermore, each page starts with <?php session_start(); ?> and includes the banner page:
'top1.php' [banner page]
<?php if((eregi("((Yahoo! Slurp|Yahoo! Slurp China|.NET CLR|Googlebot/2.1| Gigabot/2.0|Accoona-AI-Agent))",$_SERVER['HTTP_USER_AGENT']))) { if ($_SERVER['HTTPS'] == "on") { session_destroy(); header("Location: http://localhost/logout.php"); } } ?>
I'm testing on localhost with the browser set to 'Googlebot/2.1' - and the code works great. Any page that is set for https is not served, and if https has been set by a previous visit, it goes to http://somepage.
However, checking the live version, I get an secure-error_log entry:
"PHP Warning: session_destroy() [<a href='function.session-destroy'>function.session-destroy</a>]: Trying to destroy uninitialized session"
Question is: didn't the session_start(); on the calling page take effect, or is this some other problem?
Is there something like 'isset' to check whether 'session_destroy(); is needed? [I've tried isset, it barfs the code.]
Tia, Andre
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 4 answer | Add comment |
|
| non-blocking request to a url (via curl or file_get_contents or whatever)... Jochem Maas 12:56:55 |
| | hi,
I have a tradedoubler webbug to implement in site - not a problem as such - but I have a slight issue when it comes to online payments.
I have an order processing page that is requested *directly* by an online payment service in order to tell the site/system that a given order has successfully completely, this occurs prior to the online payment service redirecting the user back to my site...
at the end of the order processing the order (basically the order is marked as completed) is removed from the session in such a way that there is no longer anyway to know details about the order, so by the time the user comes back to the site I don't have the required info to create the required webbug url...
which led me to the idea/conclusion that I must (in the case of successful online payments) generate the webbug url in the order processing page while the relevant order details are still available and then make a request to the webbug url directly from the server...
I could make this request by simply doing this:
file_get_contents($webbugURL);
but this would block until the data was returned, but I don't want to wait for a reply and I definitely give a hoot about the content returned ... all I want is for the request to go out on the wire and then have my script immediately continue with what it should be doing.
I believe this would require creating a non-blocking connection in some way, but I'm stuck as to the correct way to tackle this. I've been reading about non-blocking sockets/streams etc but I'm just becoming more and more confused really, anyone care to put me out of my misery?
rgds, Jochem
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 8 answers | Add comment |
|
| Read Karl James 07:30:39 |
| | |
| | 6 answers | Add comment |
|
| easter_date() Oliver Block 00:37:16 |
| | Hello,
after a failed test of the easter_date() function I've taken a look at the test file. The test file sets the default timezone to UTC.
To make it short:
easter_date() does not return correct results, if the default timezone (set with date_default_timezone_set() or INI date.timezone) is "left" of the local timezone, i.e. the UTC offset is less than the UTC offset of the local timezone. (The local timezone is determined by the computer that runs the test.)
To illustrate it:
The timezone on my computer is "Europe/Berlin" which is UTC +200 (+ 2 hours) according to php. If easter_date() is called on a timezone with an UTC offset < +200 you will always get one day less, e.g. 2000-04-22 instead of the correct result 2000-04-23. That is because at 2000-04-23T00:00:00 (midnight) you have 2000-04-22 on every timezone with an offset < +200).
Regards,
Oliver
-- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
|
| | Add comment |
Saturday, 20 January 2007
|
| [PHP-DEV] PHP Cross Compilation for Arm Kiran Malla 22:23:34 |
| | Hello,
I am trying to cross compile PHP-5.2.0 for arm linux.
# export CC=/usr/local/arm/3.3.2/bin/arm-linux-gcc # export AR=/usr/local/arm/3.3.2/bin/arm-linux-ar # export LD=/usr/local/arm/3.3.2/bin/arm-linux-ld # export NM=/usr/local/arm/3.3.2/bin/arm-linux-nm # export RANLIB=/usr/local/arm/3.3.2/bin/arm-linux-ranlib # export STRIP=/usr/local/arm/3.3.2/bin/arm-linux-strip
# ./configure --host=arm-linux --sysconfdir=/etc/appWeb --with-exec-dir=/etc/appWeb/exec
Result of this configure is, . . .
Checking for iconv support... yes checking for iconv... no checking for libiconv... no checking for libiconv in -liconv... no checking for iconv in -liconv... no configure: error: Please reinstall the iconv library.
I have installed libiconv-1.11 on my system. The command 'which iconv' shows '/usr/local/bin/iconv'. I have no clue why configure is failing due to missing iconv.
Please throw some light on this issue. What are all the flags and variables to set to cross compile PHP for arm? If anyone has tried php on arm linux, please let me know the steps.
Regards,
|
| | 1 answer | Add comment |
|
| Storing values in arrays Ryan A 19:26:39 |
| | Hi,
I think its easier to explain what I want to do.. so here goes: I want to store values in arrays for one minute and then write them to file.
For example, everytime someone logs in I want their username to be in an array.... 1 or 100 or X people may login in 60 seconds...but it should only write all the usernames that logged in to disk every 1 minute.
Ideas? suggestions? starting points or a link to a specific spot in the manual with a RTFM would be appreciated
Thanks in advance, Ryan
------ - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. --------------------------------- It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. |
| | 12 answers | Add comment |
|
| nuSoap -method '' not defined in service Blackwater Dev 19:22:07 |
| | I have the following code but when I hit the page, I get the xml error of method '' not defined in service. I don't have a wsdl or anything defined. Is there more I need to do to get the SOAP service set up?
Thanks!
include("nusoap/nusoap.php");
$server=new soap_server(); $server->register('getColumns');
function getColumns(){
$search= new carSearch();
return $search->getSearchColumns();
} $server->service($HTTP_RAW_POST_DATA);
|
| | 2 answer | Add comment |
|
| email validation string. Don 18:11:16 |
| | I'm trying to get this line to validate an email address from a form and it isn't working.
if (ereg("^.+@.+\..+$",$submittedEmail))
The book I'm referencing has this line
if (ereg("^.+@.+\\..+$",$submittedEmail))
Anyway.. I welcome any advice as long as it doesn't morph into a political debate on ADA standards and poverty in Africa.
Thanks
Don
|
| | 19 answers | Add comment |
|
| Going back with multiple submits to the same page Otto Wyss 17:26:18 |
| | When values are entered on one of my page I submit the result back to the same page (form action=same_page). Unfortunately each submit adds an entry into the history, so history back doesn't work in a single step. Yet if the count of submits were known I could use goto(n). What's the best way to get this count? PHP or Javascript?
O. Wyss
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 5 answers | Add comment |
|
| Need tool to graphically show all includes/requires Daevid Vincent 16:57:19 |
| | We have a fairly complex product that is all PHP based GUI.
We're in need of some kind of "graphical tool" (web, stand alone, windows, linux, osx whatever) that will take a directory tree, recursively traverse all the files, look for 'includes' and 'requires' (and the _once versions too) and then map them out so we can see what files are calling what and where.
Anyone suggest something?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 3 answer | Add comment |
|
| Get the shortened browser / HTTP_USER_AGENT Wikus Moller 12:36:14 |
| | Hi.
I want to strip everything after a / in the HTTP_USER_AGENT for example: Opera 9.10/blah/blah would become only Opera 9.10
Lets say $user = $_SERVER["HTTP_USER_AGENT"]; $browser = ("/", $user);
Is this correct? Isn't something needed in the browser variable?
Thanks Wikus
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
| | 1 answer | Add comment |
|
|