php-general Digest 7 Jun 2003 14:53:06 -0000 Issue 2103
Topics (messages 150560 through 150582):
Scalable Vector Graphics
150560 by: Bob Strasser
150561 by: Hugh Bothwell
REDIRECT
150562 by: Dale
150563 by: Bobby Patel
150567 by: Boaz Yahav
150571 by: myphp
150572 by: myphp
Page loading time
150564 by: Adrian Teasdale
150566 by: Boaz Yahav
Re:[PHP] Re: REDIRECT
150565 by: fongming
Re: Gracefully dealing with Cookies OFF
150568 by: Bix
150575 by: Philip Olson
Visual Studio .Net PHP Registry Hack
150569 by: Ulrik
Re: Web Server Firewall Suggested
150570 by: Jason k Larson
150580 by: Vernon
Re: Capturing HTTP Response
150573 by: Jason k Larson
PHP Helpdesk
150574 by: Adrian Teasdale
selecting count and then dumping to an array
150576 by: Ryan A
150578 by: Peter Goggin
150582 by: Ryan A
Problems whit mysql_fetch_row
150577 by: Marcelo Luiz de Laia
GNU Distance Calculation - for the world in php
150579 by: Vernon
How to determine if output buffering is on?
150581 by: Shawn McKenzie
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I'm building a database visualization tool using SVG. Is it possibe to send
information from a form on one html page to another html page with a SVG
graphic enbedded in the page and have the php generated SVG graphic receive
the post information. I have been able to do it when the receiving page is
php generated and only the SVG graphic being displayed in the viewer but
this is very limiting as I want to make a complete HTML page with other
information on the page.
Any information would be greatly appreciated as I have spent about 2 weeks
experimenting with no luck.
Thanks in advance
Bob Strasser
--- End Message ---
--- Begin Message ---
"Bob Strasser" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm building a database visualization tool using SVG. Is it possibe to
send
> information from a form on one html page to another html page with a SVG
> graphic enbedded in the page and have the php generated SVG graphic
receive
> the post information.
Not directly...
If there is only a small amount of info to be passed,
you could embed it as a url parameter to the image-
generating script.
If there is too much for that, I would have the
form submit to a page which stuffs the needed
information into session variables, then
redirects to the page with the graphics.
This page then passes the session-id
to the script that generates the graphics.
--
Hugh Bothwell [EMAIL PROTECTED] Kingston ON Canada
v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+
PE++ Y+ PGP+ t-- 5++ !X R+ tv b++++ DI+++ D-(++) G+ e(++) h-- r- y+
--- End Message ---
--- Begin Message ---
Does anybody know of a way to redirect to another page once you have already
outputted html to the screen. In other words, I want to output some text to
the screen for 10 secs and then re-direct to another page.
Thanks,
Dale
--- End Message ---
--- Begin Message ---
not with php directly, but you can do that with HTML meta tags, check google
for "Meta refresh"
"Dale" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does anybody know of a way to redirect to another page once you have
already
> outputted html to the screen. In other words, I want to output some text
to
> the screen for 10 secs and then re-direct to another page.
>
> Thanks,
> Dale
>
>
--- End Message ---
--- Begin Message ---
To save you the search :
How to use META REFRESH to auto refresh an html page after x seconds.
http://examples.weberdev.com/get_example.php3?count=124
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Bobby Patel [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 07, 2003 9:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: REDIRECT
not with php directly, but you can do that with HTML meta tags, check
google for "Meta refresh"
"Dale" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does anybody know of a way to redirect to another page once you have
already
> outputted html to the screen. In other words, I want to output some
> text
to
> the screen for 10 secs and then re-direct to another page.
>
> Thanks,
> Dale
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
PUT THE CODE BELOW INTO < HEAD > TAG OF ANY PAGE TO
REDIRECT IT:-
<script language='JavaScript'>
setTimeout("location.href='http://www.your-page.com/index.php'",
200);
/script>
Change the number 200 to anything you want.
The following sample is what I use it for:
http://www.eastlothian.org/03eloG.php
Chris
----------
Quoting Boaz Yahav <[EMAIL PROTECTED]>:
> To save you the search :
>
> How to use META REFRESH to auto refresh an html page
after x seconds.
> http://examples.weberdev.com/get_example.php3?count4
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
>
>
>
> -----Original Message-----
> From: Bobby Patel [mailto:[EMAIL PROTECTED]
> Sent: Saturday, June 07, 2003 9:35 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: REDIRECT
>
>
> not with php directly, but you can do that with HTML
meta tags, check
> google for "Meta refresh"
>
>
> "Dale" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Does anybody know of a way to redirect to another
page once you have
> already
> > outputted html to the screen. In other words, I want
to output some
> > text
> to
> > the screen for 10 secs and then re-direct to another
page.
> >
> > Thanks,
> > Dale
--------------
--- End Message ---
--- Begin Message ---
Should have been:
http://www.eastlothian.org/03eloG.html
not .php page which was the page it redirected to.
Just have a look at source code of above page as this
list message has removed a tag.
Chris
-------
Quoting myphp <[EMAIL PROTECTED]>:
> PUT THE CODE BELOW INTO < HEAD > TAG OF ANY PAGE TO
> REDIRECT IT:-
>
> <script language='JavaScript'>
>
setTimeout("location.href='http://www.your-page.com/index.php'",
> 200);
> /script>
>
> Change the number 200 to anything you want.
>
>
> The following sample is what I use it for:
> http://www.eastlothian.org/03eloG.php
>
> Chris
> ----------
>
>
>
>
>
>
>
>
>
>
>
> Quoting Boaz Yahav <[EMAIL PROTECTED]>:
>
> > To save you the search :
> >
> > How to use META REFRESH to auto refresh an html page
> after x seconds.
> > http://examples.weberdev.com/get_example.php3?count4
> >
> > Sincerely
> >
> > berber
> >
> > Visit http://www.weberdev.com/ Today!!!
> > To see where PHP might take you tomorrow.
> >
> >
> >
> > -----Original Message-----
> > From: Bobby Patel [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, June 07, 2003 9:35 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Re: REDIRECT
> >
> >
> > not with php directly, but you can do that with HTML
> meta tags, check
> > google for "Meta refresh"
> >
> >
> > "Dale" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Does anybody know of a way to redirect to another
> page once you have
> > already
> > > outputted html to the screen. In other words, I want
> to output some
> > > text
> > to
> > > the screen for 10 secs and then re-direct to another
> page.
> > >
> > > Thanks,
> > > Dale
> --------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi
What is the easiest way to find out how long a page takes to load? I have a
client that is concerned about how long the pages are taking and I want to
find some way of analysing it. Is there a PHP script that can do this?
Ade
--- End Message ---
--- Begin Message ---
The time that a page takes to load is a client side issue.
Your php script can be done but the web server may still be sending
information such as
heavy graphics and such to the client.
There are applications that let you measure the time a site and all of
it's
parts take to load as well as view the headers, sizes of objects and
much more.
I'm working with TracePlus Web Detective :
http://www.sstinc.com/webanal.html
Sincerely
berber
Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.
-----Original Message-----
From: Adrian Teasdale [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 07, 2003 9:50 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Page loading time
Hi
What is the easiest way to find out how long a page takes to load? I
have a client that is concerned about how long the pages are taking and
I want to find some way of analysing it. Is there a PHP script that can
do this?
Ade
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi:
May be you can try javascript:
function goto($where,$string)
{
?>
<script>
alert(\"<?=$string;?>\");
location.href=\"<?=$where?>\";
</script>
<? exit;
}
if(true)
{
goto(\"http://www.yam.com\",\"thank you!\");
}
-----------------------------------
Fongming from Taiwan.
------------------------------------------
◆From: 此信是由桃小電子郵件1.5版所發出...
http://fonn.fongming.idv.tw
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Monty,
The best way to avoid SID "Hijacks" is to assign an IP variable, and an
expiration....
session_register("USERIP");
$_SESSION['USERIP'] = $_SERVER['REMOTE_ADDR'];
session_register("EXPIRES");
$_SESSION['expires'] = time() + 900; // 900 seconds (15 mins)
and then the session has the users Ip address assigned to it and an expirey,
then to check you simply...
if ($_SESSION['expires'] < time()){
die("Your session has expired after 15 minutes of inactivity");}
if ($_SESSION['remoteip'] != $_SERVER['REMOTE_ADDR']){
die ('This session is not valid for you");}
The only problem lies with people on AOL or those that use proxy's because
their IP address can cgange from minute to minute.
With the expirey, make sure you update the expirey on every page after
you've checked it to keep it 15 minutes in the future.
Any more help get in touch.
Bix.
"Monty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > both the cookie and URL based session passed over without SSL is
insecure.
> > i'd love to know who told you otherwise.
>
> I can't remember the exact sites now, but, the issue was about how much
> easier it is to spoof Sessions when IDs are passed via the URL as opposed
to
> being stored in a cookie.
>
> > perhaps now is the time to re-think all this stuff, decide if you are
going
> > to support everyone (which i would for any paying client with a wide
target
> > market), or skip over those who don't meet your definition of a web
visitor.
>
> After your indepth response, I've re-thought my re-thinking and have gone
> back to wanting to support all users whether or not they have cookies
turned
> on. And, miraculously, I've already got it working, so, thanks for your
> detailed reply.
>
> But going back to the first point, if I'm passing Session IDs via the URL,
> shouldn't I be doing something more to make the site a little more secure?
I
> don't store sensitive data in sessions vars, but, if it allows a
non-paying
> member to hijack a paying member's session, then this is going to be a
> problem. But I'm not sure what more I can do to make the session a little
> more secure and less likely that someone will hijack it. SSL is a little
> overkill for this, as this isn't a bank or financial institution, it's
just
> a little community website.
>
> The log-in for the site is fairly simple: After verifying the username and
> password against what's stored in the DB, it sets up a few session vars
with
> that member's access level and a few other preferences. This is so I don't
> have to continually query the DB for this info on every page.
>
> Is there anything more I can do to make it harder to spoof sessions?
>
> > just to throw another spanner into it all, what happens if I have JS
off?
> > will I still be able to access the content of the pop-ups? i bet not :)
>
> Well, I have to draw the line somewhere. Javascript is used throughout
this
> site for simple things like resizable popups. I'm not willing to dumb it
> down that much.
>
> Thanks!
>
> Monty
>
--- End Message ---
--- Begin Message ---
On Sat, 7 Jun 2003, Bix wrote:
> Monty,
>
> The best way to avoid SID "Hijacks" is to assign an IP variable, and an
> expiration....
>
> session_register("USERIP");
> $_SESSION['USERIP'] = $_SERVER['REMOTE_ADDR'];
> session_register("EXPIRES");
> $_SESSION['expires'] = time() + 900; // 900 seconds (15 mins)
[snip]
I've not followed this thread (nor do I want to get involved
with his touchy and difficult topic) but must make a general
comment on the above code. One should never mix use of the
deprecated session_register() function with $_SESSION. If
you're going to use $_SESSION, also use it to assign session
variables. There is NO need for use of session_register() in
the above code.
>From the manual (various versions of this text is also in
the manual):
"If you are using $_SESSION (or $HTTP_SESSION_VARS), do not
use session_register(), session_is_registered(), and
session_unregister()."
And btw, EXPIRES != expires.
And lastly, there is now session_regenerate_id() although it
won't set session cookies until PHP 4.3.3.
Regards,
Philip
--- End Message ---
--- Begin Message ---
Hello,
I while back somebody on this list posted me a link to a registry update
which enabled syntax highlighting of PHP file in Visual Studio .Net. Due
to some tragid data loss, I am now back with a unpatched Visual Studio
.Net and I can't find the mentioned registry hack on google. If anybody
knows what I am talking about it would be great if he or she could post
the link again!
Thanx in advance
Ulrik
--- End Message ---
--- Begin Message ---
How comfortable are you with IPTables?
I'm running several web, email, etc services behind a very detailed iptables firewall.
Granted for me though, the firewall is it's own server protecting a private net.
I wouldn't do it any other way, well except something similar using freebsd and ipfilter.
Personally, I don't trust those boxed firewalls, iptables is so configurable especially
into options where boxed firewalls don't protect, like source routed packets and other
routing trickery. Plus, I've yet to see one that can offer the nat'ing options to the
excess that I use, or prerouting tables, for that matter.
--
Jason k Larson
Luis Lebron wrote:
I know there is a lot of expertise on running web servers in this group. So,
I'm going to ask a couple of questions.
I am currently a public web server with an iptables firewall. A security
consultant has suggested that we buy a separate firewall for the firewall
instead of running iptables. He recommended a Symantec VelociRaptor or one
of their firewall appliances.
Does this sound like good advice? Are there any other models we sould look
at?
thanks,
Luis R. Lebron
--- End Message ---
--- Begin Message ---
I am very big on Internet security and anyone running a web server should
know IPChains and IPTables. If you don't get a couple of books and learn.
Once you understand how things work you we will be much better equipped to
handle any security issues that may come up.
Having said that you don't really need to know these items (but again anyone
running a web server that does not, IMHO, is crazy) when using
Bastille-Linux (http://www.bastille-linux.org/). This is lock down yor box
very well and create the scripts needed to protect your system. Be careful
though and read all prompts carefully as it can lock the box down so tight
it won't let you in. ;)
V
--- End Message ---
--- Begin Message ---
This is all dependent on how you are performing the transaction. Are you using raw
sockets to connect or perhaps cURL? The answer lies in that when whatever is making the
connection and reading the data returned, the headers will be sent there.
--
Jason k Larson
Ralph wrote:
Hi, I'm currently setting up a form for CC processing. At the moment I
am able to send the required flags to authorize the CC transaction, but
then I do not know how I go about parsing the returned headers.
After processing the transaction the merchant returns either HTTP 200
(ok) along with values or HTTP 400(ERRROR) with a string indicating
reason for error.
So how would I go about parsing these in my script?
--- End Message ---
--- Begin Message ---
Hi there
Anyone have a PHP Helpdesk that they'd recommend. We are using Perldesk at
the moment, so want something as good, but preferably better :)
Thanks
Ade
--- End Message ---
--- Begin Message ---
Hi,
Is there any way to get a COUNT of records (SELECT count(*) FROM main_my
where type=$t) for 5 types using hopefully one select statement and then
dumping that into an array?
The reason I am asking is running 5 selects on the DB at once is not a very
good idea...right?
Thanks,
-Ryan
http://MrSahaf.com - The Iraqi (Dis)information ministers site ("We will
slaughter you all!")
--- End Message ---
--- Begin Message ---
Try
select type, count(*) from table group by type;
This should return a count for each distinct type value.
Regards
Peter Goggin
----- Original Message -----
From: "Ryan A" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 08, 2003 12:13 AM
Subject: [PHP] selecting count and then dumping to an array
> Hi,
>
> Is there any way to get a COUNT of records (SELECT count(*) FROM main_my
> where type=$t) for 5 types using hopefully one select statement and then
> dumping that into an array?
>
> The reason I am asking is running 5 selects on the DB at once is not a
very
> good idea...right?
>
> Thanks,
> -Ryan
>
> http://MrSahaf.com - The Iraqi (Dis)information ministers site ("We will
> slaughter you all!")
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Thanks guys,
will give it a shot and write back if i have any problems.
Cheers,
-Ryan
--- End Message ---
--- Begin Message ---
People,
I have two blocks for phpnuke 6.5.
These blocks show registers inside one marquee, of the left for the right.
The first block is functioning normally. However, if I make some alterations
in it, so that it pass to show registers of another table, it does not
function and presents the error described after thise codes (in the end of
this message).
I consulted several experts in PHP and them they had not known to say which
is the problem.
Now I am submitting the problem to you!
This is the code that functions funny:
$usemarquee = 1;
$scrolldirection = "left";
global $prefix, $multilingual, $currentlang, $dbi;
if ($multilingual == 1) {
$querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
} else {
$querylang = "";
}
$content = "<table width=\"100%\" border=\"0\">";
$content .= "<Marquee Behavior=\"Scroll\"Direction=\"$scrolldirection\"
$width=\"100%\" ScrollAmount=\"3\" ScrollDelay=\"90\"
onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\">";
(Line 40) $result = sql_query("select sid, title, comments, counter from
".$prefix."_stories $querylang order by sid ASC limit 0,100", $dbi);
(Line 41) while(list($sid, $title, $comtotal, $counter) =
mysql_fetch_row($result, $dbi)) {
$content .= "<img src=\blocks/images/diamond.gif> <a
href=\"modules.php?name=News&file=article&sid=$sid\"><font
color=\"#096C88\"><b>$title</b></a> ";
}
$content .= "</table>";
?>
+++++++++++++++++++++++++++++++++
This is the code that does not function (see that I made very little
alterations):
$usemarquee = 1;
$scrolldirection = "left";
global $prefix, $multilingual, $currentlang, $dbi;
$sql = "DELETE FROM ".$prefix."_anuncios WHERE datafim<NOW()";
sql_query($sql, $dbi);
if ($multilingual == 1) {
$querylang = "WHERE (alanguage='$currentlang' OR alanguage='')";
} else {
$querylang = "";
}
$content = "<table width=\"100%\" border=\"0\">";
$content .="<center> <STYLE=\"text-decoration: none\"><font
color=\"#666666\"><b>犋timos 10 Concursos</b></center>";
$content .= "<Marquee Behavior=\"Scroll\" Direction=\"$scrolldirection\"
$width=\"100%\" ScrollAmount=\"3\" ScrollDelay=\"90\"
onMouseOver=\"this.stop()\" onMouseOut=\"this.start()\">";
(Linha 40) $result = sql_query("SELECT categoria, nombre FROM
".$prefix."_anuncios ORDER BY RAND() LIMIT 0,30", $dbi);
(Linha 41) while (list($categoria, $nombre) = mysql_fetch_row($result,
$dbi)) {
$content .= "<img src=blocks/images/diamond.gif> <a
href=\"modules.php?name=Concurso\"><font color=\"#096C88\"><b>$categoria
<br> $nombre</b></a> ";
}
$content .= "</table>";
?>
+++++++++++++++++++++++++
This is the error message showed:
Warning: Wrong parameter count for mysql_fetch_row() in
f:\webdoc\html\blocks\block-Concurso.php on line 41
Thanks very much
Marcelo
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003
--- End Message ---
--- Begin Message ---
I have a way of getting the distances from one zip code to the next in the
US, but I need to be able to do that for other countries as well.
I've found a web site on the net that sells a database of all postal codes
and their longitude and latitudes but they want a $1000 which I am not
willing to pay, especially since I got all the US zips for free.
Anyone know where I can get a database with all the postal codes and so
forth or perhaps a couple different ones and hopefully the code in php to
calculate the distances. I need to be able to at least do major countries in
the world from one place in that country to the next.
Thanks
--- End Message ---
--- Begin Message ---
O.K. so how can I determine if output buffering has been started???
Thanks!
Shawn
--- End Message ---