|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 5 Oct 2005 05:49:05 -0000 Issue 3720
php-general-digest-help
lists.php.net
Date: Wed Oct 05 2005 - 00:49:05 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 5 Oct 2005 05:49:05 -0000 Issue 3720
Topics (messages 223615 through 223637):
Re: displaying image from blog
223615 by: Jay Blanchard
223617 by: cc
223618 by: cron.odi.com.br
Re: PROGRESS SQL_CUR_USE_ODBC
223616 by: Kristen G. Thorson
223620 by: Kristen G. Thorson
223621 by: Programmer
Re: session_name("CCLTrolley")
223619 by: Robert Cummings
223634 by: John Taylor-Johnston
223635 by: Jasper Bryant-Greene
Non-Javascript PHP Onsubmit function?
223622 by: zzapper
223624 by: tg-php.gryffyndevelopment.com
223627 by: zzapper
PHP / LAMP Training
223623 by: Peter Jackson
possibly buffer problem, including a bit of code this time
223625 by: matt VanDeWalle
PHP5 and soap module crash
223626 by: Anish Mistry
Re: Change the order in which Objects are unloaded
223628 by: Niels Ganser
Re: Handling competing edits in a wiki engine?
223629 by: Silvio Porcellana
223630 by: Anas Mughal
Warning: Cannot send session cookie
223631 by: John Taylor-Johnston
223632 by: Jasper Bryant-Greene
223633 by: John Taylor-Johnston
223636 by: Stephen Leaf
query regerding copying files using php
223637 by: Suresh Pandian
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
[snip]
> On 10/4/05, blackwater dev <blackwaterdev
gmail.com> wrote:
> > I am querying a MSSQL db where an jpg image is stored as a blog.
> > But when viewed I just get all the junk code:
> >
> > !1AQaq"2B'¡±Á #3RðbrÑ
> >
$4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š'""•–—˜™š¢£¤¥¦
§¨(c)ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øù
> >
> > What is wrong?
[/snip]
Check this..
http://us2.php.net/odbc_binmode
attached mail follows:
you cant just mix html tags and image data and expect them to be on
the same page to get both html and images displayed.
if you want image, use a <IMG> tag, whose SRC attribute maybe a php
file, and this php file will output _only_ image data, i.e.
echo $obj->photo;
nothing more, except if you want to add a http header
header('Content-type: image/jpeg');
Good luck!
On 10/5/05, blackwater dev <blackwaterdev
gmail.com> wrote:
> I am querying a MSSQL db where an jpg image is stored as a blog.
>
> I have this code:
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="image/jpg">
> </head>
> <body>
> <?
> //Do the query
> include_once("../includes.list.php");
> $ms_sql= new ms_db();
> $my_sql=new Database();
> $query="select photo from cars where id=22";
> $data=$ms_sql->query($query);
> while($obj = $ms_sql->objects('',$data)){
> echo $obj->photo;
> }
> $data=$ms_sql->disconnect();
> ?>
> </body>
> </html>
>
> But when viewed I just get all the junk code:
>
> !1AQaq"2B'¡±Á #3RðbrÑ
> $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š'""•–—˜™š¢£¤¥¦§¨(c)ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øù
>
> What is wrong?
>
> Thanks!
>
attached mail follows:
You have to echo a single image and only the image(no html tags) as binary
for this to work. One must also set the header from the page to the correct
mime type for the image work.
ex:
Page: displayImg.php
header('Content-Type: image/jpeg'); // set correct header, more info
on:http://us2.php.net/manual/en/function.header.php
include_once("../includes.list.php");
$ms_sql= new ms_db();
$my_sql=new Database();
$query="select photo from cars where id=" $_GET["id"];
$data=$ms_sql->query($query);
while($obj = $ms_sql->objects('',$data)){
echo $obj->photo;
}
$data=$ms_sql->disconnect();
Page where image goes:
<html>
<head>
<meta http-equiv="Content-Type" content="image/jpg">
</head>
<body>
<img src="displayImg.php?id=22">
</body>
</html>
Angelo
----- Original Message -----
From: "blackwater dev" <blackwaterdev
gmail.com>
To: <php-general
lists.php.net>
Sent: Tuesday, October 04, 2005 2:14 PM
Subject: [PHP] Re: displaying image from blog
> Sorry, meant BLOB, not blog.
>
> On 10/4/05, blackwater dev <blackwaterdev
gmail.com> wrote:
> > I am querying a MSSQL db where an jpg image is stored as a blog.
> >
> > I have this code:
> >
> > <html>
> > <head>
> > <meta http-equiv="Content-Type" content="image/jpg">
> > </head>
> > <body>
> > <?
> > //Do the query
> > include_once("../includes.list.php");
> > $ms_sql= new ms_db();
> > $my_sql=new Database();
> > $query="select photo from cars where id=22";
> > $data=$ms_sql->query($query);
> > while($obj = $ms_sql->objects('',$data)){
> > echo $obj->photo;
> > }
> > $data=$ms_sql->disconnect();
> > ?>
> > </body>
> > </html>
> >
> > But when viewed I just get all the junk code:
> >
> > !1AQaq"2B'¡±Á #3RðbrÑ
> >
$4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š'""•–—˜™š¢£¤¥¦
§¨(c)ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øù
> >
> > What is wrong?
> >
> > Thanks!
> >
>
attached mail follows:
cybermalandro cybermalandro wrote:
>I am connecting to a PROGRESS DB through the MERANT ODBC driver, When I have
>the 4th parameter SQL_CUR_USE_ODBC as shown, my queries return nothing but
>if I have the 4th parameter as lower case it returns my query results but
>with a PHP error complainning
>*Notice*: Use of undefined constant sql_cur_use_odbc - assumed
>'sql_cur_use_odbc'
>
>Wtf? I don't get it, most of the documentation from people connecting to
>PROGRESS do have the 4th parameter uppercase can someone help me out ?
>
>Thanks!
>
>
>
Using PEAR:DB with this dsn I can connect and get results:
$dsn =
"odbc(Progress_SQL92_Driver)://$username:$password
$protocol+$ip:$port/$database?cursor=SQL_CUR_USE_ODBC";
kgt
attached mail follows:
cybermalandro cybermalandro wrote:
> Thanks for your prompt response! Are you using the pear DB class
> requiring odbc? I am not very familiar with this class and pear. I was
> trying to do it the old way. Perhaps you can give me some more
> examples? I really appreciate your help.
>
> Thanks
>
> On 10/4/05, *Kristen G. Thorson* <kthorson
allegroconsultants.com
> <mailto:kthorson
allegroconsultants.com>> wrote:
>
> cybermalandro cybermalandro wrote:
>
> >I am connecting to a PROGRESS DB through the MERANT ODBC driver,
> When I have
> >the 4th parameter SQL_CUR_USE_ODBC as shown, my queries return
> nothing but
> >if I have the 4th parameter as lower case it returns my query
> results but
> >with a PHP error complainning
> >*Notice*: Use of undefined constant sql_cur_use_odbc - assumed
> >'sql_cur_use_odbc'
> >
> >Wtf? I don't get it, most of the documentation from people
> connecting to
> >PROGRESS do have the 4th parameter uppercase can someone help me
> out ?
> >
> >Thanks!
> >
> >
> >
>
>
> Using PEAR:DB with this dsn I can connect and get results:
>
> $dsn =
> "odbc(Progress_SQL92_Driver)://$username:$password
$protocol+$ip:$port/$database?cursor=SQL_CUR_USE_ODBC";
>
>
>
>
> kgt
>
>
I think I was using iODBC and the PEAR DB class. I actually did this a
long time ago. I have this script sitting on my hard drive and I know I
had a working solution at one point in time, so I'm assuming this was
it. I don't have the test environment set up anymore, so I can't really
check. Following is the script I have to print the contents of the
Customer table in the Sports database. It looks like I took a PEAR:DB
example and just modified it to work with Progress, so I'm certain
there's much room for improvement.
require_once '/usr/share/pear/DB.php';
// Get the connection variables:
require_once 'dbinfo.php';
$dsn =
"odbc(Progress_SQL92_Driver)://$username:$password
$protocol+$ip:$port/$database?cursor=SQL_CUR_USE_ODBC";
// Creates a database connection object in $db or, a database error
object if it went wrong.
// The boolean specifies this is a persistent connection like
mysql_pconnect(), it
// defaults to FALSE.
$db = DB::connect($dsn, TRUE);
// Check whether the object is a connection or
if (DB::isError($db)) {
/*
* This is not what you would really want to do in
* your program. It merely demonstrates what kinds
* of data you can get back from error objects.
*/
echo 'Standard Message: ' . $db->getMessage() . "<br>\n";
echo 'Standard Code: ' . $db->getCode() . "<br>\n";
echo 'DBMS/User Message: ' . $db->getUserInfo() . "<br>\n";
echo 'DBMS/Debug Message: ' . $db->getDebugInfo() . "<br>\n";
exit;
// an error.
//die($db->getMessage()); // Print out a message and exit if it's
// an error object.
}
// Get a connection as above
$sql = "SELECT * from PUB.Customer"; // Build your SQL query
$res = $db->query($sql);
if (DB::isError($res)) { // Check the result object in case there
die($res->getMessage()); // was an error, and handle it here.
}
echo "<table cellpadding=0 cellspacing=0 border=0>";
echo "<tr><th>Cust Num</th>";
echo "<th>Name</th>";
echo "<th>Address</th>";
echo "<th>Address2</th>";
echo "<th>City</th>";
echo "<th>State</th>";
echo "<th>Country</th>";
echo "<th>Phone</th>";
echo "<th>Contact</th>";
echo "<th>Sales-Rep</th>";
echo "<th>Comments</th>";
echo "<th>Credit-Limit</th>";
echo "<th>Balance</th>";
echo "<th>Terms</th>";
echo "<th>Discount</th>";
echo "<th>Postal-Code</th></tr>";
while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
// Fetch a row from the result resource object $res.
// DB_FETCHMODE_OBJECT returns a row with column names as keys.
// Other possibilities are listed here:
// http://pear.php.net/manual/en/core.db.tut_fetch.php
if (DB::isError($row)) {
//fetchRow can return an error object like most PEAR::DB methods
die($row->getMessage());
} else {
echo "<tr><td>" . $row["Cust-Num"] . "</td>\n";
echo "<td>" . $row["Name"] . "</td>\n";
echo "<td>" . $row["Address"] . "</td>\n";
echo "<td>" . $row["Address2"] . "</td>\n";
echo "<td>" . $row["City"] . "</td>\n";
echo "<td>" . $row["State"] . "</td>\n";
echo "<td>" . $row["Country"] . "</td>\n";
echo "<td>" . $row["Phone"] . "</td>\n";
echo "<td>" . $row["Contact"] . "</td>\n";
echo "<td>" . $row["Sales-Rep"] . "</td>\n";
echo "<td>" . $row["Comments"] . "</td>\n";
echo "<td>" . $row["Credit-Limit"] . "</td>\n";
echo "<td>" . $row["Balance"] . "</td>\n";
echo "<td>" . $row["Terms"] . "</td>\n";
echo "<td>" . $row["Discount"] . "</td>\n";
echo "<td>" . $row["Postal-Code"] . "</td></tr>\n";
}
}
echo "</table>";
$res->free();
$db->disconnect(); // Close the connection.
attached mail follows:
I don't know if this will help you.
I use an openlink ODBC driver to connect to Progress via PHP like so:
$dbconn =
odbc_connect("MyDB_ODBC",$username,$password,SQL_CUR_USE_ODBC);
$strQry = "SELECT * FROM mytable WHERE mytable.field = ".$somevar;
$rsTable = odbc_do($dbconn, $strQry);
while (odbc_fetch_row($rsTable))
{
// do stuff;
}
Jeremy Schreckhise
-----Original Message-----
From: cybermalandro cybermalandro [mailto:cybermalandro
gmail.com]
Sent: Tuesday, October 04, 2005 11:48 AM
To: php-general
lists.php.net
Subject: [PHP] PROGRESS SQL_CUR_USE_ODBC
I am connecting to a PROGRESS DB through the MERANT ODBC driver, When I
have
the 4th parameter SQL_CUR_USE_ODBC as shown, my queries return nothing
but
if I have the 4th parameter as lower case it returns my query results
but
with a PHP error complainning
*Notice*: Use of undefined constant sql_cur_use_odbc - assumed
'sql_cur_use_odbc'
Wtf? I don't get it, most of the documentation from people connecting to
PROGRESS do have the 4th parameter uppercase can someone help me out ?
Thanks!
attached mail follows:
On Mon, 2005-10-03 at 18:08, John Taylor-Johnston wrote:
> >Use "foreach" to traverse the array and display each trolly entry nicely
>
> This might be cleaner? I'm not sure if I'm using while and list right,
> but somehting like that?
>
> $glquery = mysql_query($sql);
> while ($mydata = mysql_fetch_object($glquery)) {
>
> while (list($_SESSION['TrolleyContents'], $value) = $mydata->RNum)
> {
> echo "$mydata->RNum - $mydata->field1: $mydata->field2.";
> }
>
> }
If list() works for you it's fine. I don't really use it so not entirely
sure of it's functionality with respect to looping.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Robert Cummings wrote:
>On Mon, 2005-10-03 at 18:08, John Taylor-Johnston wrote:
>
>
>> >Use "foreach" to traverse the array and display each trolly entry nicely
>>
>>
>>
>If list() works for you it's fine. I don't really use it so not entirely
>sure of it's functionality with respect to looping.
>
>
I ended up going with this. Wasn't sure how to use list anyhow. Look good?
$sql = 'SELECT * FROM '.$table.' ORDER BY RNum;';
echo "<!--".$sql."-->";
$news = mysql_query($sql);
while ($mydata = mysql_fetch_object($news))
{
foreach ($_SESSION['TrolleyContents'] as $value)
if ($value == $mydata->RNum)
{
}
}
attached mail follows:
John Taylor-Johnston wrote:
> I ended up going with this. Wasn't sure how to use list anyhow. Look good?
>
> $sql = 'SELECT * FROM '.$table.' ORDER BY RNum;';
> echo "<!--".$sql."-->";
>
> $news = mysql_query($sql);
>
> while ($mydata = mysql_fetch_object($news))
> {
> foreach ($_SESSION['TrolleyContents'] as $value)
> if ($value == $mydata->RNum)
> {
> }
> }
>
Why not replace the foreach and if combo inside the while with:
if( array_search( $mydata->RNum, $_SESSION['TrolleyContents'] ) !==
false ) {
}
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
attached mail follows:
Hi,
I'd like to have a non-Javascript based general purpose "Are you quite Sure?" PHP form submitter,
conventionally done using the Javascript Onsubmit Event.
One way would be to store all the Form Variables in hidden fields generated by a foreach $_POST
but anyone have anything simpler?
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
attached mail follows:
Nope.. you're pretty much stuck using Javascript or processing it all on the back end with PHP as you described. You could store the data in a database or a $_SESSION variable but without using something client-side, you're going to have to juggle it all with PHP.
-TG
= = = Original message = = =
Hi,
I'd like to have a non-Javascript based general purpose "Are you quite Sure?" PHP form submitter, conventionally done using the Javascript Onsubmit Event.
One way would be to store all the Form Variables in hidden fields generated by a foreach $_POST but anyone have anything simpler?
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
attached mail follows:
On Tue, 4 Oct 2005 15:50:06 -0400, wrote:
>Nope.. you're pretty much stuck using Javascript or processing it all on the back end with PHP as you described. You could store the data in a database or a $_SESSION variable but without using something client-side, you're going to have to juggle it all with PHP.
>
Thanks
--
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
attached mail follows:
Has anyone been to good PHP and/or LAMP training?
I was looking around and saw on a blog where they
really liked the security aspects of this one:
http://www.sans.org/ns2005/description.php?tid=249
Has anyone been to classes by sans.org?
Thanks,
Peter
__________________________
Free 3000MB email. Stops spam 100%. No banner ads. No popup ads. http://www.cashette.com
attached mail follows:
oops, sorry about the lack of any code with my last problem message.
I am still having the same buffer problem where after asking for a
password, it doesn't stop and wait, just falling through to the next
prompt. here is basically what the new_user function looks like. I am
using php 4.3.10 on slackware 10.1
/* the new user function */
function new_user($sock, $username)
{
global $cdata;
/* shorthand of socket_write is now send_single */
send_single($sock, "please type the username you would like to go by ");
$username = socket_read($sock, 1024, PHP_NORMAL_READ);
/* i had to change to PHP_NORMAL_READ or else windows users couldnt get on
with more than 1 char */
$username = trim($username);
/* now comes the problem as far as i'm seeing it program execution-wise */
send_single($sock, "please choose a password");
$pwd = socket_read($sock, 1024, PHP_NORMAL_READ);
$passwd = trim($pwd);
send_single($sock, "email address to send your signup info");
$email = socket_read($sock, 1024, PHP_NORMAL_READ);
$email = trim($email);
/* do rest of function like fill array and write userfile etc */
..........
}
ok: as far as i can tell, it asks for the password, skips that, and goes
right onto the prompt that asks for the email address (totally skips that
as well), and proceeds to fill the array and write the file and then log
the user on, so of course half of the array variables seem to be blank and
the file doesn't contain the password or email)
obviously I'm doing something wrong but what?
matt
ps, hope that is enough of the code to tell
attached mail follows:
I'm running FreeBSD 5.4-STABLE with PHP 5.05 (I can also reproduce
this with the same version on 7-CURRENT) and something in the soap
module is causing php/apache to sig11.
I'm using the soap module to connect to MapPoint to retrieve location
coordinates. This problem doesn't happen with the 5.04 soap module.
Thanks for any help or suggestions. Let me know if I need to provide
any more debug information.
The backtrace follows:
(gdb) bt
#0 0x48c8f729 in php_openssl_sockop_cast ()
from /usr/local/lib/php/20041030/openssl.so
#1 0x080f0e6e in _php_stream_cast ()
#2 0x48c5c7a6 in stream_alive ()
from /usr/local/lib/php/20041030/soap.so
#3 0x48c5e376 in make_http_soap_request ()
from /usr/local/lib/php/20041030/soap.so
#4 0x48c4b449 in zif_SoapClient___doRequest ()
from /usr/local/lib/php/20041030/soap.so
#5 0x0810ebb4 in zend_call_function ()
#6 0x0810dd70 in call_user_function_ex ()
#7 0x0810dc93 in call_user_function ()
#8 0x48c49705 in do_request ()
from /usr/local/lib/php/20041030/soap.so
#9 0x48c49d58 in do_soap_call ()
from /usr/local/lib/php/20041030/soap.so
#10 0x48c4ae66 in zif_SoapClient___call ()
from /usr/local/lib/php/20041030/soap.so
#11 0x0813bb84 in execute_internal ()
#12 0x4850f822 in xdebug_execute_internal ()
from /usr/local/lib/php/20041030/xdebug.so
#13 0x0814639f in zend_do_fcall_common_helper ()
#14 0x081467e5 in zend_do_fcall_by_name_handler ()
#15 0x0813bce3 in execute ()
#16 0x4850f6ff in xdebug_execute ()
from /usr/local/lib/php/20041030/xdebug.so
#17 0x081190fd in zend_execute_scripts ()
When I try to compile with debugging, I don't get the sig 11, but when
I run the script with valgrind it does give the following:
> valgrind -v ./soap-crash.php
==76689== Memcheck, a memory error detector for x86-linux.
==76689== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
==76689== Using valgrind-2.1.0, a program supervision framework for
x86-linux.
==76689== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==76689== Valgrind library directory: /usr/local/lib/valgrind
==76689== Command line
==76689== /usr/local/bin/php
==76689== ./soap-crash.php
==76689== Startup, with flags:
==76689== -v
==76689== Reading syms from /usr/local/bin/php (0x8048000)
==76689== Reading syms from /libexec/ld-elf.so.1 (0x3C000000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /libexec/ld-elf.so.1 (0xB0000000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /lib/libc.so.5 (0xB0038000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/valgrind/vgskin_memcheck.so
(0xB0121000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/valgrind/stage2
(0xB8000000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading suppressions
file: /usr/local/lib/valgrind/default.supp
==76689== Estimated CPU clock rate is 1340 MHz
==76689== REDIRECT soname:libc.so.6(__GI___errno_location) to
soname:libpthread.so.0(__errno_location)
==76689== REDIRECT soname:libc.so.6(__errno_location) to
soname:libpthread.so.0(__errno_location)
==76689== REDIRECT soname:libc.so.6(__GI___h_errno_location) to
soname:libpthread.so.0(__h_errno_location)
==76689== REDIRECT soname:libc.so.6(__h_errno_location) to
soname:libpthread.so.0(__h_errno_location)
==76689== REDIRECT soname:libc.so.6(__GI___res_state) to
soname:libpthread.so.0(__res_state)
==76689== REDIRECT soname:libc.so.6(__res_state) to
soname:libpthread.so.0(__res_state)
==76689== REDIRECT soname:libc.so.6(stpcpy) to
*vgpreload_memcheck.so*(stpcpy)
==76689== REDIRECT soname:libc.so.6(strnlen) to
*vgpreload_memcheck.so*(strnlen)
==76689== REDIRECT soname:ld-linux.so.2(stpcpy) to
*vgpreload_memcheck.so*(stpcpy)
==76689== REDIRECT soname:ld-linux.so.2(strchr) to
*vgpreload_memcheck.so*(strchr)
==76689==
==76689== Reading syms from /usr/local/lib/valgrind/vg_inject.so
(0x3C03B000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms
from /usr/local/lib/valgrind/vgpreload_memcheck.so (0x3C03E000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /lib/libcrypt.so.2 (0x3C044000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /lib/libm.so.3 (0x3C05E000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libxml2.so.5 (0x3C07A000)
==76689== object doesn't have any debug info
==76689== Reading syms from /lib/libz.so.2 (0x3C1A6000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libiconv.so.3 (0x3C1B8000)
==76689== object doesn't have any debug info
==76689== Reading syms from /lib/libc.so.5 (0x3C2A6000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms
from /usr/local/lib/php/20041030-debug/fribidi.so (0x3C491000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libfribidi.so.0
(0x3C495000)
==76689== object doesn't have any debug info
==76689== Reading syms
from /usr/local/lib/php/20041030-debug/xdebug.so (0x3C4A3000)
==76689== object doesn't have any debug info
PHP Warning: Module 'fribidi' already loaded in Unknown on line 0
==76689== Reading syms
from /usr/local/lib/php/20041030-debug/simplexml.so (0x3C4C2000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/xml.so
(0x3C4CA000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/pgsql.so
(0x3C4D6000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libpq.so.4 (0x3C4F0000)
==76689== Reading syms from /usr/local/lib/libintl.so.6 (0x3C513000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libssl.so.3 (0x3C51D000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libcrypto.so.3 (0x3C5FA000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/valgrind/libpthread.so.1
(0x3C707000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/dom.so
(0x3C725000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/ctype.so
(0x3C748000)
==76689== object doesn't have any debug info
==76689== Reading syms
from /usr/local/lib/php/20041030-debug/tokenizer.so (0x3C74D000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/iconv.so
(0x3C753000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/pcre.so
(0x3C75C000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/mysql.so
(0x3C792000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/mysql/libmysqlclient.so.14
(0x3C7A0000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/lib/libssl.so.3 (0x3C7FD000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /lib/libcrypto.so.3 (0x3C831000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/gd.so
(0x3C942000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libt1.so.5 (0x3C9A7000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libfreetype.so.9
(0x3C9FD000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/X11R6/lib/libX11.so.6 (0x3CA69000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/X11R6/lib/libXpm.so.4 (0x3CB34000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libpng.so.5 (0x3CB45000)
==76689== object doesn't have a symbol table
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/libjpeg.so.9 (0x3CB6B000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/X11R6/lib/libXext.so.6 (0x3CB89000)
==76689== object doesn't have any debug info
==76689== Reading syms
from /usr/local/lib/php/20041030-debug/session.so (0x3CB98000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/soap.so
(0x3CBA6000)
==76689== object doesn't have any debug info
==76689== Reading syms
from /usr/local/lib/php/20041030-debug/sqlite.so (0x3CBF7000)
==76689== object doesn't have any debug info
==76689== Reading syms from /usr/local/lib/php/20041030-debug/posix.so
(0x3CC48000)
==76689== object doesn't have any debug info
==76689== Reading syms
from /usr/local/lib/php/20041030-debug/openssl.so (0x3CC4E000)
==76689== object doesn't have any debug info
==76689== Invalid read of size 4
==76689== at 0x3CBC87FE: stream_alive
(in /usr/local/lib/php/20041030-debug/soap.so)
==76689== by 0x3CBCAB04: make_http_soap_request
(in /usr/local/lib/php/20041030-debug/soap.so)
==76689== by 0x3CBB42F8: zif_SoapClient___doRequest
(in /usr/local/lib/php/20041030-debug/soap.so)
==76689== by 0x812BC7E: zend_call_function (zend_execute_API.c:900)
==76689== Address 0x3CD5E2B0 is 172 bytes inside a block of size 184
free'd
==76689== at 0x3C04068F: free
(in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==76689== by 0x811EC77: _efree (zend_alloc.c:288)
==76689== by 0x810625B: _php_stream_free (streams.c:394)
==76689== by 0x3CBD0025: make_http_soap_request
(in /usr/local/lib/php/20041030-debug/soap.so)
==76689==
==76689== Invalid read of size 4
==76689== at 0x8105EE6: _php_stream_free (streams.c:276)
==76689== by 0x3CBCAB22: make_http_soap_request
(in /usr/local/lib/php/20041030-debug/soap.so)
==76689== by 0x3CBB42F8: zif_SoapClient___doRequest
(in /usr/local/lib/php/20041030-debug/soap.so)
==76689== by 0x812BC7E: zend_call_function (zend_execute_API.c:900)
==76689== Address 0x3CD5E270 is 108 bytes inside a block of size 184
free'd
==76689== at 0x3C04068F: free
(in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==76689== by 0x811EC77: _efree (zend_alloc.c:288)
==76689== by 0x810625B: _php_stream_free (streams.c:394)
==76689== by 0x3CBD0025: make_http_soap_request
(in /usr/local/lib/php/20041030-debug/soap.so)
39.9993431382:-83.0282030224
==76689== discard syms at 0x3CC4E000-0x3CC61000
in /usr/local/lib/php/20041030-debug/openssl.so due to munmap()
==76689== discard syms at 0x3CC48000-0x3CC4D000
in /usr/local/lib/php/20041030-debug/posix.so due to munmap()
==76689== discard syms at 0x3CBF7000-0x3CC47000
in /usr/local/lib/php/20041030-debug/sqlite.so due to munmap()
==76689== discard syms at 0x3CBA6000-0x3CBF6000
in /usr/local/lib/php/20041030-debug/soap.so due to munmap()
==76689== discard syms at 0x3CB98000-0x3CBA5000
in /usr/local/lib/php/20041030-debug/session.so due to munmap()
==76689== discard syms at 0x3C942000-0x3C9A6000
in /usr/local/lib/php/20041030-debug/gd.so due to munmap()
==76689== discard syms at 0x3C9A7000-0x3C9FC000
in /usr/local/lib/libt1.so.5 due to munmap()
==76689== discard syms at 0x3C9FD000-0x3CA68000
in /usr/local/lib/libfreetype.so.9 due to munmap()
==76689== discard syms at 0x3CA69000-0x3CB33000
in /usr/X11R6/lib/libX11.so.6 due to munmap()
==76689== discard syms at 0x3CB34000-0x3CB44000
in /usr/X11R6/lib/libXpm.so.4 due to munmap()
==76689== discard syms at 0x3CB45000-0x3CB6A000
in /usr/local/lib/libpng.so.5 due to munmap()
==76689== discard syms at 0x3CB6B000-0x3CB88000
in /usr/local/lib/libjpeg.so.9 due to munmap()
==76689== discard syms at 0x3CB89000-0x3CB97000
in /usr/X11R6/lib/libXext.so.6 due to munmap()
==76689== discard syms at 0x3C792000-0x3C79F000
in /usr/local/lib/php/20041030-debug/mysql.so due to munmap()
==76689== discard syms at 0x3C7A0000-0x3C7FC000
in /usr/local/lib/mysql/libmysqlclient.so.14 due to munmap()
==76689== discard syms at 0x3C7FD000-0x3C830000
in /usr/lib/libssl.so.3 due to munmap()
==76689== discard syms at 0x3C831000-0x3C941000 in /lib/libcrypto.so.3
due to munmap()
==76689== discard syms at 0x3C75C000-0x3C791000
in /usr/local/lib/php/20041030-debug/pcre.so due to munmap()
==76689== discard syms at 0x3C753000-0x3C75B000
in /usr/local/lib/php/20041030-debug/iconv.so due to munmap()
==76689== discard syms at 0x3C74D000-0x3C752000
in /usr/local/lib/php/20041030-debug/tokenizer.so due to munmap()
==76689== discard syms at 0x3C748000-0x3C74C000
in /usr/local/lib/php/20041030-debug/ctype.so due to munmap()
==76689== discard syms at 0x3C725000-0x3C747000
in /usr/local/lib/php/20041030-debug/dom.so due to munmap()
==76689== discard syms at 0x3C4D6000-0x3C4EF000
in /usr/local/lib/php/20041030-debug/pgsql.so due to munmap()
==76689== discard syms at 0x3C4F0000-0x3C512000
in /usr/local/lib/libpq.so.4 due to munmap()
==76689== discard syms at 0x3C513000-0x3C51C000
in /usr/local/lib/libintl.so.6 due to munmap()
==76689== discard syms at 0x3C51D000-0x3C5F9000
in /usr/local/lib/libssl.so.3 due to munmap()
==76689== discard syms at 0x3C5FA000-0x3C706000
in /usr/local/lib/libcrypto.so.3 due to munmap()
==76689== discard syms at 0x3C707000-0x3C724000
in /usr/local/lib/valgrind/libpthread.so.1 due to munmap()
==76689== discard syms at 0x3C4CA000-0x3C4D5000
in /usr/local/lib/php/20041030-debug/xml.so due to munmap()
==76689== discard syms at 0x3C4C2000-0x3C4C9000
in /usr/local/lib/php/20041030-debug/simplexml.so due to munmap()
==76689== discard syms at 0x3C4A3000-0x3C4C1000
in /usr/local/lib/php/20041030-debug/xdebug.so due to munmap()
==76689== discard syms at 0x3C491000-0x3C494000
in /usr/local/lib/php/20041030-debug/fribidi.so due to munmap()
==76689== discard syms at 0x3C495000-0x3C4A2000
in /usr/local/lib/libfribidi.so.0 due to munmap()
==76689==
==76689== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from
0)
==76689==
==76689== 1 errors in context 1 of 2:
==76689== Invalid read of size 4
==76689== at 0x8105EE6: _php_stream_free (streams.c:276)
==76689== by 0x3CBCAB22: ???
==76689== by 0x3CBB42F8: ???
==76689== by 0x812BC7E: zend_call_function (zend_execute_API.c:900)
==76689== Address 0x3CD5E270 is 108 bytes inside a block of size 184
free'd
==76689== at 0x3C04068F: free
(in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==76689== by 0x811EC77: _efree (zend_alloc.c:288)
==76689== by 0x810625B: _php_stream_free (streams.c:394)
==76689== by 0x3CBD0025: ???
==76689==
==76689== 1 errors in context 2 of 2:
==76689== Invalid read of size 4
==76689== at 0x3CBC87FE: ???
==76689== by 0x3CBCAB04: ???
==76689== by 0x3CBB42F8: ???
==76689== by 0x812BC7E: zend_call_function (zend_execute_API.c:900)
==76689== Address 0x3CD5E2B0 is 172 bytes inside a block of size 184
free'd
==76689== at 0x3C04068F: free
(in /usr/local/lib/valgrind/vgpreload_memcheck.so)
==76689== by 0x811EC77: _efree (zend_alloc.c:288)
==76689== by 0x810625B: _php_stream_free (streams.c:394)
==76689== by 0x3CBD0025: ???
==76689== IN SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==76689==
==76689== malloc/free: in use at exit: 25688 bytes in 1256 blocks.
==76689== malloc/free: 17054 allocs, 15798 frees, 1803278 bytes
allocated.
==76689==
--76689-- TT/TC: 0 tc sectors discarded.
--76689-- 12196 chainings, 0 unchainings.
--76689-- translate: new 18231 (348936 -> 4090151; ratio 117:10)
--76689-- discard 5546 (112149 -> 1228612; ratio 109:10).
--76689-- dispatch: 6750000 jumps (bb entries), of which 1038840
(15%) were unchained.
--76689-- 394/57108 major/minor sched events. 23094
tt_fast misses.
--76689-- reg-alloc: 2771 t-req-spill, 736256+18439 orig+spill uis,
89674 total-reg-r.
--76689-- sanity: 311 cheap, 13 expensive checks.
--76689-- ccalls: 83904 C calls, 56% saves+restores avoided (279758
bytes)
--76689-- 119336 args, avg 0.88 setup instrs each (27234
bytes)
--76689-- 0% clear the stack (251712 bytes)
--76689-- 27617 retvals, 31% of reg-reg movs avoided (17002
bytes)
Here is snippet of the php code.
//MapPoint Web Service user name goes here.
$mapPointUserName = "MYUSERNAMEHERE";
//MapPoint Web Service password goes here.
$mapPointPassword = "MYPASSWORDHERE";
//A MapPoint Web Service evaluation account includes
//access to the MapPoint Web Service staging environment only.
$mapPointWsdl =
"http://staging.mappoint.net/standard-30/mappoint.wsdl";
$address = array(
'AddressLine' => $fields["address"],
'PrimaryCity' => $fields["city"],
//SecondaryCity is not required for U.S. addresses.
'Subdivision' => $fields["state"],
'PostalCode' => $fields["zip"],
'CountryRegion' => 'USA'
);
//Define the FindRange object, which determines the first result
we
//want returned and the number of
//results to return.
$findRange = array(
'StartIndex' => 0,
'Count' => 100
);
//Define a FindResultMask object to specify which
//properties should be returned along with the results.
$findResultMask = 'AddressFlag LatLongFlag';
//Define the FindOptions object.
$findOptions = array(
'Range' => $findRange,
'SearchContext' => 244,
'ResultMask' => $findResultMask,
'ThresholdScore' => 0.85
);
$findAddressSpecification = array(
'DataSourceName' => 'MapPoint.NA',
'InputAddress' => $address,
'Options' => $findOptions
);
$findAddress = array('specification' =>
$findAddressSpecification);
$options = array('login' => $mapPointUserName,
'password' => $mapPointPassword,
'authentication' => SOAP_AUTHENTICATION_DIGEST,
"connection_timeout" => 5);
try
{
$client = new SoapClient($mapPointWsdl, $options);
$method = 'FindAddress';
$ans = $client->__soapCall($method, array('parameters' =>
$findAddress));
$fields["latitude"] =
$ans->FindAddressResult->Results->FindResult->FoundLocation->LatLong->Latitude;
$fields["longitude"] =
$ans->FindAddressResult->Results->FindResult->FoundLocation->LatLong->Longitude;
}
catch (Exception $e)
{
trigger_error("SOAP Fault: (faultcode: {$ans->faultcode},
faultstring: {$ans->faultstring}). \n exception: ". $e->getMessage().
"Please contact UnitedWare.", E_ERROR);
}
print($fields["latitude"].":".$fields["longitude"]."\n");
--
Anish Mistry
amistry
am-productions.biz
AM Productions http://am-productions.biz/
attached mail follows:
Thanks for your reply, Jasper.
auto_append_file has been my first "alternative" approach too and so far
it seems to be the best option available. But the show-stopper to me is
that if you exit() out of your script, the file won't be appended.
I did write some sort of wrapper function to first append the file and
then do an exit(), however an error (obviously no notices or warnings)
will still prevent the file from being loaded.
You may argue that e.g. an E_ERROR will stop exection of the script
anyway and no shutdown handler will be called whatsoever but this is
only partially right as an error in an included file won't stop the
shutdown handler (registered in the including file) from being called.
So if i depend on objects (which have been initialized during script
runtime) even after an error occured, apparently there still is no way
to do it.
You may wonder what all the fuss is about, thinking that this is only a
theoretical problem. I'm collecting debugging information during script
runtime and store them in an object's properties. At the very end of my
script I want those information to either be displayed or logged. As you
can imagine, those information are a lot more valuable in an error
context.
I _could_ save them in a global variable which I could access without any
problem in my shutdown function, however I'm quite happy with the
flexibility of my object oriented approach and rather wouldn't like to
change it.
Anymory ideas?
Regards,
Niels
Jasper Bryant-Greene:
> Niels Ganser wrote:
> > I use a Debugger-Class to collect debugging information (now that was
a
> > hard guess, wasn't it..) during script runtime. In order to collect
> > everything there is to collect, I instantiate a debugger object right
at
> > the start of my scripts and unload this object at the very end of my
> > shutdown function.
> >
> > Unfortunately as of PHP 5.0.5 objects get unloaded before the
shutdown
> > function is even called and as Jani Taskinen pointed out [1] this
> > behaviour is very much intended and won't get changed (whatever the
> > reason for this decision might be..) with all related bugs marked
Bogus
> > [2] or a documentation issue [3].
> >
> > I have to admit that it wouldn't be much of a deal to store the
debugging
> > information outside the object but I like the approach I took and
fear
> > that I might run into other problems with objects getting destroyed
> > before others which depend on the previous ones, so my question is
> > (tadaa): Is there a way to sort of "customize" the order in which
> > objects are unloaded during the shutdown procedure? I have to stress
> > that defining the classes and/or instantiate the objects in a
specific
> > order is _not_ an option.
> >
> > [1] http://marc.theaimsgroup.com/?l=php-dev&m=112556389406774
> > [2] http://bugs.php.net/bug.php?id=34377
> > [3] http://bugs.php.net/bug.php?id=33772
>
> This is a really nasty bug, which has been preventing me from upgrading
> to PHP 5.0.5. Unfortunately it doesn't look like it will be fixed any
> time soon. The most descriptive bug report is [3], bug ID 33772, above.
>
> The only workaround I've come up with (although pretty ugly) is to use
> an auto_append_file [1] that executes the necessary destructors in the
> order you want them. This file will be executed before PHP starts
> destroying objects.
>
> HTH
>
> [1] http://php.net/ini.core#ini.auto-append-file
attached mail follows:
Murray
PlanetThoughtful wrote:
>
> Out of curiosity, does anyone know if it's possible to tell whether an
> individual session is still alive from PHP? I don't mean from within
> code being run for a particular user, but in code that, for example,
> might be executed by a cron job, which would examine a table in which
> session ids have been recorded automatically for each visitor, and
> determining which of those sessions are still theoretically alive? I
> suspect this isn't possible, but I've also learned to never
> underestimate the ingenuity of those faced with things that aren't
> possible.
>
[Ok, I AM an AJAX fan]
The problem with "normal" session management is that session data
(timestamp etc.) gets updated only when and if the user does something:
therefore, if he is reading an article and he doesn't click anywhere for
10 minutes, he still is on your site, but you "lose" him.
An alternative approach is the AJAX [1] one: you set up a JavaScript
'setInterval' and call an "AJAX" function that makes a query to the PHP
script that updates the session (with the current timestamp, user_id,
whatever...)
Ok, I don't know if this makes much sense, but you end up with a script
that gets executed (without user interaction) every 'n' microseconds, so
your session data is always up to date (at maximum, with a delay of 'n'
* 2 microseconds).
The bad side of this is that you have a script that gets executed quite
often for every user visiting your pages: but, if you keep it minimal (a
couple of queries) the overhead isn't that much and you get a
*near-to-real* number of open sessions.
I hope I made some sense: in any case feel free to ask, I just developed
something like this for a web site I'm working on (but we're still in
alpha), so if you want to see it in action, lemme know.
Ciao!
Silvio
[1] http://en.wikipedia.org/wiki/AJAX
attached mail follows:
I would like to see it in action, please.
Thanks.
--
Anas
On 10/4/05, Silvio Porcellana <sporc
tin.it> wrote:
>
> Murray
PlanetThoughtful wrote:
> >
> > Out of curiosity, does anyone know if it's possible to tell whether an
> > individual session is still alive from PHP? I don't mean from within
> > code being run for a particular user, but in code that, for example,
> > might be executed by a cron job, which would examine a table in which
> > session ids have been recorded automatically for each visitor, and
> > determining which of those sessions are still theoretically alive? I
> > suspect this isn't possible, but I've also learned to never
> > underestimate the ingenuity of those faced with things that aren't
> > possible.
> >
>
> [Ok, I AM an AJAX fan]
>
> The problem with "normal" session management is that session data
> (timestamp etc.) gets updated only when and if the user does something:
> therefore, if he is reading an article and he doesn't click anywhere for
> 10 minutes, he still is on your site, but you "lose" him.
>
> An alternative approach is the AJAX [1] one: you set up a JavaScript
> 'setInterval' and call an "AJAX" function that makes a query to the PHP
> script that updates the session (with the current timestamp, user_id,
> whatever...)
> Ok, I don't know if this makes much sense, but you end up with a script
> that gets executed (without user interaction) every 'n' microseconds, so
> your session data is always up to date (at maximum, with a delay of 'n'
> * 2 microseconds).
> The bad side of this is that you have a script that gets executed quite
> often for every user visiting your pages: but, if you keep it minimal (a
> couple of queries) the overhead isn't that much and you get a
> *near-to-real* number of open sessions.
>
> I hope I made some sense: in any case feel free to ask, I just developed
> something like this for a web site I'm working on (but we're still in
> alpha), so if you want to see it in action, lemme know.
>
> Ciao!
> Silvio
>
> [1] http://en.wikipedia.org/wiki/AJAX
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Anas Mughal
attached mail follows:
Any idea why I'm getting this error, and only on this page? I have the
same header on every other page?
http://testesp.flsh.usherb.ca/thingstodo.html
The page contains a \n before I start my <?php. Is this doing it?
<?php
session_name( 'CCLTrolley' );
session_start();
// Initialize the trolley.
if( !isset( $_SESSION['TrolleyContents'] ) )
{
$_SESSION['TrolleyContents'] = array();
}
?>
Warning: Cannot send session cookie - headers already sent by (output
started at /var/www/html2/thingstodo.html:2) in
/var/www/html2/thingstodo.html on line 4
Warning: Cannot send session cache limiter - headers already sent
attached mail follows:
John Taylor-Johnston wrote:
> Any idea why I'm getting this error, and only on this page? I have the
> same header on every other page?
> http://testesp.flsh.usherb.ca/thingstodo.html
> The page contains a \n before I start my <?php. Is this doing it?
Most likely, yes. Why didn't you try removing it before posting to the list?
> Warning: Cannot send session cookie - headers already sent by (output
> started at /var/www/html2/thingstodo.html:2) in
> /var/www/html2/thingstodo.html on line 4
> Warning: Cannot send session cache limiter - headers already sent
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/
attached mail follows:
Michael Crute wrote:
> The page contains a \n before I start my <?php. Is this doing it?
>
>
> That \n is it. You can't send ANYTHING to the browser before you send
> the headers and cookies are part of the headers. Take out the \n and
> all should be well.
Thanks. Dreamweaver screwed me over ;)
attached mail follows:
On Tuesday 04 October 2005 08:15 pm, John Taylor-Johnston wrote:
> Any idea why I'm getting this error, and only on this page? I have the
> same header on every other page?
> http://testesp.flsh.usherb.ca/thingstodo.html
> The page contains a \n before I start my <?php. Is this doing it?
yup
>
> <?php
> session_name( 'CCLTrolley' );
> session_start();
>
> // Initialize the trolley.
> if( !isset( $_SESSION['TrolleyContents'] ) )
> {
> $_SESSION['TrolleyContents'] = array();
> }
> ?>
>
> Warning: Cannot send session cookie - headers already sent by (output
> started at /var/www/html2/thingstodo.html:2) in
> /var/www/html2/thingstodo.html on line 4
> Warning: Cannot send session cache limiter - headers already sent
attached mail follows:
hello friends,
i have a query in writng the content of one file to another.
i attempted it.
it only writes the html codings.it could not write the php scripts inside the file.
i use the following code to accomplish my problem...
##############################################################
if (!defined('T_ML_COMMENT')) {
define('T_ML_COMMENT', T_COMMENT);
} else {
define('T_DOC_COMMENT', T_ML_COMMENT);
}
$source = file_get_contents('-.php');
$tokens = token_get_all($source);
foreach ($tokens as $token) {
if (is_string($token)) {
// simple 1-character token
$ourFileName = "/home/itempla1/public_html/links/".$pwd.".php";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
echo $token;
fwrite($ourFileHandle, $token);
fclose($ourFileHandle);
} else {
// token array
list($id, $text) = $token;
switch ($id) {
case T_COMMENT:
case T_ML_COMMENT: // we've defined this
case T_DOC_COMMENT: // and this
// no action on comments
break;
default:
// anything else -> output "as is"
$ourFileName = "/home/itempla1/public_html/links/".$pwd.".php";
$ourFileHandle = fopen($ourFileName, 'a') or die("can't open file");
echo $text;
fwrite($ourFileHandle, $text);
fclose($ourFileHandle);
break;
}
}
}
?>
################################################################
please give me some valuable tips to write the content of the php file to another newly created php file.
Thanks,
Suresh.P
---------------------------------
Yahoo! India Matrimony: Find your partner now.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]