php-general Digest 26 Apr 2001 22:33:39 -0000 Issue 651
Topics (messages 50443 through 50522):
how to get var value
50443 by: AJDIN BRANDIC
50451 by: Johannes Janson
50457 by: PHPBeginner.com
50460 by: AJDIN BRANDIC
form variables: back and forth
50444 by: meling
Problem with the HTTP_REFERER
50445 by: Rosen
50454 by: Yasuo Ohgaki
50455 by: Rosen
50458 by: PHPBeginner.com
50459 by: PHPBeginner.com
50464 by: Yasuo Ohgaki
Parse error: parser stack overflow in...
50446 by: Christoph Hunscher
Re: OOP and Future of PHP
50447 by: Andi Gutmans
50452 by: Yasuo Ohgaki
50453 by: Yasuo Ohgaki
Parsing HTML files from an external web server
50448 by: James Kneebone
HTTP authentication for username & password
50449 by: Thomas Edison Jr.
50450 by: Jon Haworth
Re: Big Problem
50456 by: Michael Geier
Re: PHP+MS Access and/or MS SQL
50461 by: Andrew Hill
50514 by: John Monfort
Mcrypt
50462 by: Alex Piaz
50466 by: Curtis Maurand
simple form validation
50463 by: Jamie Saunders
50467 by: Pavel Jartsev
50470 by: PHPBeginner.com
Tough comparison problem.
50465 by: blawson.vvm.com
50468 by: Pavel Jartsev
50471 by: PHPBeginner.com
odbc_cursor
50469 by: Scott Fletcher
writing a time to mysql????
50472 by: Shane McBride
50475 by: PHPBeginner.com
Re: Recursive Childs
50473 by: Krznaric Michael
online site builder
50474 by: kaab kaoutar
50476 by: John Platte
Array question
50477 by: Mike Tuller
fsockopen question
50478 by: Michael Conley
50481 by: Matthew Luchak
50482 by: Matthew Luchak
50483 by: Michael Conley
50502 by: Nuno Silva
Build problems
50479 by: Curtis Maurand
Re: Transfering an image
50480 by: Steve Werby
cell iterations in loop
50484 by: Jerry Lake
50493 by: Jack Dempsey
50497 by: Jerry Lake
50498 by: Jerry Lake
50499 by: dempsejn.georgetown.edu
50506 by: Jerry Lake
50507 by: dempsejn.georgetown.edu
math calculations query
50485 by: sean.networkdata.co.uk
50486 by: David VanHorn
50488 by: sean.networkdata.co.uk
50496 by: Jack Dempsey
where are the mailing lists listed?
50487 by: Matt Wong
50495 by: Jack Dempsey
Re: Filesystem security
50489 by: ..s.c.o.t.t.. [gts]
50491 by: Kurth Bemis
Re: Can I install Lihnux on My Windows 95 machine ?
50490 by: sono.selectcomm.ab.ca
50494 by: ..s.c.o.t.t.. [gts]
50500 by: B. van Ouwerkerk
50520 by: sono.selectcomm.ab.ca
mcrypt module for Win32
50492 by: Carsten Gehling
--enable-trans-sid and forms
50501 by: Boget, Chris
50503 by: Johnson, Kirk
Messaging to a simple server?
50504 by: Andy - Interlync
alter table name with php and mysql
50505 by: Augusto Cesar Castoldi
50510 by: Kevin A Williams
50521 by: Andreas D. Landmark
in_array() function not supported on my server... anything else?
50508 by: Richard
NEWBIE Mail()
50509 by: Tym Rehm
50512 by: Kevin A Williams
check if an url is valid
50511 by: Black Dragon
Array & Javascript?
50513 by: Marcus Ouimet
Ultradev PHP Server Model
50515 by: John Monfort
setting the name of the file in Save As windows
50516 by: Black Dragon
xpath_eval causes Segmentation fault error
50517 by: Grishick
Re: File Transfer from non-browser client using POST??
50518 by: nik
[Help:] Problem with regex patterns when getting Title, Description and Keywords from
HTML files...
50519 by: DHEA
Re: Problem in sending mail with mail() function
50522 by: nik
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]
----------------------------------------------------------------------
Hi,
(this is just an example)
I have on one page
$test=1;
$var1='test';
on another page I want to be able to construct variable from the value in
$var1 (test in this case) and print its value. So,
$newvar=$;
$newvar.=echo"$var1";
now $newvar contains string '$test' but not the value of $test (1 in this
case).
There has to be way aroud this but I am just cannot find it :(.
Regards
Ajdin
hi,
by .= you assign the value to a var in this case a string.
$test = 1;
$var = "test";
$newvar = $$var;
echo $newvar; // outputs "1"
Johannes
"AJDIN BRANDIC" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
Pine.OSF.3.91.1010426114338.17213A-100000@leofric">news:Pine.OSF.3.91.1010426114338.17213A-100000@leofric...
> Hi,
>
> (this is just an example)
> I have on one page
>
> $test=1;
> $var1='test';
>
> on another page I want to be able to construct variable from the value in
> $var1 (test in this case) and print its value. So,
>
> $newvar=$;
> $newvar.=echo"$var1";
>
> now $newvar contains string '$test' but not the value of $test (1 in this
> case).
>
> There has to be way aroud this but I am just cannot find it :(.
>
> Regards
>
> Ajdin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
try
$newvar = ${$var1};
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: AJDIN BRANDIC [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 7:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how to get var value
Hi,
(this is just an example)
I have on one page
$test=1;
$var1='test';
on another page I want to be able to construct variable from the value in
$var1 (test in this case) and print its value. So,
$newvar=$;
$newvar.=echo"$var1";
now $newvar contains string '$test' but not the value of $test (1 in this
case).
There has to be way aroud this but I am just cannot find it :(.
Regards
Ajdin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thanks
Ajdin
On Thu, 26 Apr 2001, PHPBeginner.com wrote:
> try
>
> $newvar = ${$var1};
>
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
>
> PHPBeginner.com (Where PHP Begins)
> [EMAIL PROTECTED]
> www.phpbeginner.com
>
>
>
>
> -----Original Message-----
> From: AJDIN BRANDIC [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 7:53 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how to get var value
>
>
> Hi,
>
> (this is just an example)
> I have on one page
>
> $test=1;
> $var1='test';
>
> on another page I want to be able to construct variable from the value in
> $var1 (test in this case) and print its value. So,
>
> $newvar=$;
> $newvar.=echo"$var1";
>
> now $newvar contains string '$test' but not the value of $test (1 in this
> case).
>
> There has to be way aroud this but I am just cannot find it :(.
>
> Regards
>
> Ajdin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
Hi all,
Here's a snippet of a code for a spell checker that I am working on. I've done
all the checking correctly, except that after checking and correcting, I have
absolutely no idea how to return the modified message back to the previous
form. Can anyone please help?
Thanks in advance,
--mel
--code--
function spellcheck($word)
{
if ($word == "") {
return false;
}
$pl = aspell_new("english");
if (aspell_check($pl, $word)) {
return true;
} else {
return false;
}
}
function suggest($word)
{
$pl = aspell_new("english");
$suggestions = aspell_suggest($pl, $word);
if (count($suggestions) == 0) {
$suggest = "Sorry, no suggestions available";
}
else {
/* temp solution for IE */
$suggest = "<option selected>$suggestions[0]</option>";
for ($i = 1; $i < count($suggestions); $i++) {
/* javascript does not like quotes... */
if (!preg_match("/[a-zA-Z]'[a-zA-Z]/", $suggestions[$i],
$parts)) {
$suggest .= "<option>".$suggestions[$i]."</option>";
}
}
}
return $suggest;
}
$org_message = $message; /* message is from previous form, in a textarea */
$message = stripslashes($message);
$message = preg_split("/\s+/", $message);
function spellwin($word, $suggestion, $count)
{
$mistake = "foo".$count;
$len = strlen($word);
$tmp = "$suggestion";
$ret = "<input type=\"text\" name=\"$mistake\" value=\"$word\" size=$len>";
$next = "<input type=\"button\" value=\"C\"
onClick=\"javascript:suggest('$word', document.speller.$mistake.value, '$tmp',
$len, $count)\">";
//document.speller.$suggestion.options[document.speller.$suggestion.selected
Index].value)\">";
//$next = "<input type=\"button\" value=\"C\"
onClick=\"javascript:suggest(document.speller.$mistake.value)\">";
$ret .= $next;
return $ret;
}
echo "<html>";
?>
<script language="JavaScript">
function suggest(word, mistake, suggestion, len, num)
{
var kiosk;
kiosk = window.open("", "speller",
'resizable=yes,scrollbars=yes,status=0,width=300,height=160');
kiosk.document.writeln('<head><title>Spell Check</title></head>');
kiosk.document.writeln('<body bgcolor="#ffffff">');
kiosk.document.writeln("Misspelt word:");
kiosk.document.writeln("<form name='f0'>");
kiosk.document.writeln("<font size=-1> Replace with: </font><input
type=text value='"+word+"' name='manual' size='"+len+"'>");
kiosk.document.writeln('<input type=button value="change"
onclick=\'window.opener.document.speller.elements["foo'+num.toString()+'"].val
ue=document.f0.elements["manual"].value;window.close();\'><br>');
kiosk.document.writeln("<font size=-1> Suggestions: </font><select
name='s0'>" + suggestion);
kiosk.document.writeln("</select>");
kiosk.document.writeln('<input type=button value="change"
onclick=\'window.opener.document.speller.elements["foo'+num.toString()+'"].val
ue=document.f0.s0.options[document.f0.s0.selectedIndex].text;window.close();\'
><br>');
kiosk.document.writeln('<br><a href="javascript:window.close()">Skip
Changes</a>');
kiosk.document.writeln("</form>");
kiosk.document.writeln('</body>');
kiosk.document.close();
return true;
}
</script>
<?
echo "<form name=\"speller\" action=\"spcheck.php\" method=\"post\">";
for ($i = 0; $i < count($message); $i++) {
if (!is_url($message[$i]) && !is_email($message[$i])
&& !is_apros($message[$i]) && !is_num($message[$i])
&& !is_sign($message[$i]) ) {
$w = has_sign($message[$i]);
$res = spellcheck($w);
if ($res == false) {
$suggest = suggest($w);
$message[$i] = spellwin($w, $suggest, $i);
}
}
echo "$message[$i] ";
//echo "No spelling error found";
}
/* !! now what do I put here? */
echo "<input type=\"hidden\" name=\"corrected\"
value=\"WHAT_DO_I_PUT_HERE?\">";
echo "<input type=\"submit\" name=\"submit\" value=\"Done\">";
echo "</form>";
?>
-------------------------------------------
The Fastest Browser on Earth now for FREE!!
Download Opera 5 for Windows now! Get it at
http://www.opera.com/download/
-------------------------------------------
Hi,
I have BIG problem using "HTTP_REFERER".
I have two pages:
main.php:
<A HREF=test.php target= _blank>Click here</A>
test.php:
.........somecode
echo "<SCRIPT
language=\"javascript\">window.location.href=\"http://$web\";</script>";
$web - some website.
But on the $web site (some site) I can't get the REFERER !!!
You cannot rely on HTTP_REFERER, it all upto client.
So I suggest to change code to handle, empty or bogus HTTP_REFERER value.
Regards,
--
Yasuo Ohgaki
""Rosen"" <[EMAIL PROTECTED]> wrote in message
9c912a$had$[EMAIL PROTECTED]">news:9c912a$had$[EMAIL PROTECTED]...
> Hi,
> I have BIG problem using "HTTP_REFERER".
> I have two pages:
>
> main.php:
> <A HREF=test.php target= _blank>Click here</A>
>
> test.php:
> .........somecode
> echo "<SCRIPT
> language=\"javascript\">window.location.href=\"http://$web\";</script>";
>
> $web - some website.
>
>
> But on the $web site (some site) I can't get the REFERER !!!
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
The problem is thath:
I don't want to reflect to "REFERRER" on the client's site.
I want the REFERER on the client site to be my site !
Tnahks
Rosen marinov
""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message
9c974s$o3n$[EMAIL PROTECTED]">news:9c974s$o3n$[EMAIL PROTECTED]...
> You cannot rely on HTTP_REFERER, it all upto client.
> So I suggest to change code to handle, empty or bogus HTTP_REFERER value.
>
> Regards,
> --
> Yasuo Ohgaki
>
>
> ""Rosen"" <[EMAIL PROTECTED]> wrote in message
> 9c912a$had$[EMAIL PROTECTED]">news:9c912a$had$[EMAIL PROTECTED]...
> > Hi,
> > I have BIG problem using "HTTP_REFERER".
> > I have two pages:
> >
> > main.php:
> > <A HREF=test.php target= _blank>Click here</A>
> >
> > test.php:
> > .........somecode
> > echo "<SCRIPT
> > language=\"javascript\">window.location.href=\"http://$web\";</script>";
> >
> > $web - some website.
> >
> >
> > But on the $web site (some site) I can't get the REFERER !!!
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
$HTTP_REFERER does not work with javascript this way.
the value is as it would be inside your "back button", in other words, you
have to CLICK on a link, then you'll see it.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Rosen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 8:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with the HTTP_REFERER
Hi,
I have BIG problem using "HTTP_REFERER".
I have two pages:
main.php:
<A HREF=test.php target= _blank>Click here</A>
test.php:
.........somecode
echo "<SCRIPT
language=\"javascript\">window.location.href=\"http://$web\";</script>";
$web - some website.
But on the $web site (some site) I can't get the REFERER !!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Just to add,
as Yasuo said, $HTTP_REFERER is VERY, VERY unreliable.
PHPBeginner.com logs user accesses into a database, $HTTP_REFERER is there
only 30% of times. This is because:
not everyone necessarily CLICKS,
not every browser supports it,
many are reading emails,
many are typing it in.... etc ...
never rely on it, make it ALWAYS optional, or your codes will be screwed up
without that you even know it.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: PHPBeginner.com [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 11:13 PM
To: Rosen; [EMAIL PROTECTED]
Subject: RE: [PHP] Problem with the HTTP_REFERER
$HTTP_REFERER does not work with javascript this way.
the value is as it would be inside your "back button", in other words, you
have to CLICK on a link, then you'll see it.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Rosen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 8:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with the HTTP_REFERER
Hi,
I have BIG problem using "HTTP_REFERER".
I have two pages:
main.php:
<A HREF=test.php target= _blank>Click here</A>
test.php:
.........somecode
echo "<SCRIPT
language=\"javascript\">window.location.href=\"http://$web\";</script>";
$web - some website.
But on the $web site (some site) I can't get the REFERER !!!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
It's a Browser and JavaScript issue.
You would like to make your site as REFERER site with following line, right?
echo "<SCRIPT
language=\"javascript\">window.location.href=\"http://$web\";</script>";
As I write previous post, it's all up to browser if it is going to send REFERER
or not and it is nothing to do with PHP, so how about ask in JavaScript related
list/news?
As far as I know, many browser will not send HTTP_REFERER with this or like.
There may be the way to do, though.
Regards,
--
Yasuo Ohgaki
""Rosen"" <[EMAIL PROTECTED]> wrote in message
9c9869$tjh$[EMAIL PROTECTED]">news:9c9869$tjh$[EMAIL PROTECTED]...
> The problem is thath:
> I don't want to reflect to "REFERRER" on the client's site.
> I want the REFERER on the client site to be my site !
>
> Tnahks
> Rosen marinov
>
>
> ""Yasuo Ohgaki"" <[EMAIL PROTECTED]> wrote in message
> 9c974s$o3n$[EMAIL PROTECTED]">news:9c974s$o3n$[EMAIL PROTECTED]...
> > You cannot rely on HTTP_REFERER, it all upto client.
> > So I suggest to change code to handle, empty or bogus HTTP_REFERER value.
> >
> > Regards,
> > --
> > Yasuo Ohgaki
> >
> >
> > ""Rosen"" <[EMAIL PROTECTED]> wrote in message
> > 9c912a$had$[EMAIL PROTECTED]">news:9c912a$had$[EMAIL PROTECTED]...
> > > Hi,
> > > I have BIG problem using "HTTP_REFERER".
> > > I have two pages:
> > >
> > > main.php:
> > > <A HREF=test.php target= _blank>Click here</A>
> > >
> > > test.php:
> > > .........somecode
> > > echo "<SCRIPT
> > > language=\"javascript\">window.location.href=\"http://$web\";</script>";
> > >
> > > $web - some website.
> > >
> > >
> > > But on the $web site (some site) I can't get the REFERER !!!
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
... perm.inc on line 56
Hi all,
this message some ppl get when they try to connect to a mysql database.
i use php3 with phplib.
the problem is, when i try it over lan and with dialin over isdn, there
are no probs with win95, win98, winme and nt4.0 clients. neither with
ms-ie nor with netscape. only a special combination with nt4.0 and ie5.0
or netscape4.5 seems to have this probs. so, whats going on? can a stack
overflow beeing a result of the browser/operating-system??
any hint?
thanks for answers
chris
At 02:10 PM 4/26/2001 +0900, Yasuo Ohgaki wrote:
>"Steven Haryanto" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > At 4/25/2001 09:02 PM, Reuben D Budiardja wrote:
>
>*SNIP*
>
> > What I *really* like to see in PHP is:
> >
> > - NAMESPACE
> > - TRACEBACK INFO
> > - exception (try-except block)
> > - $obj->method()->anotherMethod()
> > - real destructor would be nice, but not extremely important for
> > the time being, due to the nature of PHP usage in Web pages
>
>I agree, but
>
>$obj->method()->anotherMethod()
>
>works for me. What does not work to be specific?
I don't know how it works for you because it's not supported :)
Andi
> At 02:10 PM 4/26/2001 +0900, Yasuo Ohgaki wrote:
> >"Steven Haryanto" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > At 4/25/2001 09:02 PM, Reuben D Budiardja wrote:
> >
> >*SNIP*
> >
> > > What I *really* like to see in PHP is:
> > >
> > > - NAMESPACE
> > > - TRACEBACK INFO
> > > - exception (try-except block)
> > > - $obj->method()->anotherMethod()
> > > - real destructor would be nice, but not extremely important for
> > > the time being, due to the nature of PHP usage in Web pages
> >
> >I agree, but
> >
> >$obj->method()->anotherMethod()
> >
> >works for me. What does not work to be specific?
>
> I don't know how it works for you because it's not supported :)
>
I got it what you and he means.
I thought $obj->anotherObj->method(), but it was
> >$obj->method()->anotherMethod()
He means calling anotherMethod() from a method(), it does not work :)
Is there any good supporting this? (and why need this?)
--
Yasuo Ohgaki
Sorry about sloppy reading.
I misunderstood what he means :(
It does not work.
--
Yasuo Ohgaki
----- Original Message -----
From: "Steven Haryanto" <[EMAIL PROTECTED]>
To: "Yasuo Ohgaki" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 26, 2001 4:22 PM
Subject: Re: [PHP] OOP and Future of PHP
> At 4/26/2001 12:10 PM, Yasuo Ohgaki wrote:
> > > What I *really* like to see in PHP is:
> > >
> > > - NAMESPACE
> > > - TRACEBACK INFO
> > > - exception (try-except block)
> > > - $obj->method()->anotherMethod()
> > > - real destructor would be nice, but not extremely important for
> > > the time being, due to the nature of PHP usage in Web pages
> >
> >I agree, but
> >
> >$obj->method()->anotherMethod()
> >works for me. What does not work to be specific?
>
> Hm, I'm using 4.0.4pl1. Perhaps this has been added somewhere in
> the 4.0.5RC series? Sorry, haven't got the chance of trying that
> (apart from using the PEAR from 4.0.5RC2).
>
> ===
> class C1 {
> function &f() { return $this; }
> function g() { echo "Hi!"; }
> }
>
> $C=new C;
> $C->f()->g();
> ===
>
> does not work me here.
>
> >I don't use GDB, but it seems it supports traceback.
> >How about Zend Debugger? Does it support? Anyone?
>
> Yes, I've heard that it supports traceback. I guess this means I
> have to use a source-level debugger for now. Lacking a stack trace
> leads to a rather cumbersome error reporting, since I have to
> supply __LINE__, __FILE__, and the name of the function in every
> call to the error function.
>
> Regards,
> Steve
>
>
Hello List.
I'm having a little trouble with parsing HTML files and inputting the data
from
the HTML file into a MySQL database. I get the following error when trying
toparse the file.
Warning: file("http://www.server.com/file.htm") - No error in
d:\webpages\world\lists.php on line 8
The following is part of my php code
<?
$url = "http://www.server.com/file.htm";
$fileArray = file($url);
$state = 0;
$line = 0;
$ProvinceCount = 0;
$Details = Array();
****************
I then have more code which parses the file and parses the data and puts it in
an array.
I was wondering whether anybody could provide information as to what the
possible problem could be. If you want more information, please contact me
off-list.
Thanks,
James
How can I use the HTTP authentication which pops up
that little box in the screen asking for username &
password for giving access to a page in PHP?
regards,
T.Edison jr.
=====
Rahul S. Johari (Director)
******************************************
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
*******************************************
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
Superb tutorial on Zend:
http://www.zend.com/zend/tut/authentication.php
HTH
Jon
-----Original Message-----
From: Thomas Edison Jr. [mailto:[EMAIL PROTECTED]]
Sent: 26 April 2001 13:03
To: [EMAIL PROTECTED]
Subject: [PHP] HTTP authentication for username & password
How can I use the HTTP authentication which pops up
that little box in the screen asking for username &
password for giving access to a page in PHP?
**********************************************************************
'The information included in this Email is of a confidential nature and is
intended only for the addressee. If you are not the intended addressee,
any disclosure, copying or distribution by you is prohibited and may be
unlawful. Disclosure to any party other than the addressee, whether
inadvertent or otherwise is not intended to waive privilege or confidentiality'
**********************************************************************
in php.ini, put "/var/qmail/bin/qmail-inject" into sendmail_path
-----Original Message-----
From: Thomas Booms [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 6:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Big Problem
Hi all,
I'm using on my new machine (SuSE 7.0) PHP4. In one PHP4-Script I use
the mail-Function. But my /var/log/mail (qmail) does not give any entry
for this mail.
Is there a bug?
In PHP3 it was all running good.
I have a serious problem here because this is a customers site!
Thanks in advance.
Thomas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
John,
If you are using PHP from Windows you can use ODBC or the mssql_functions.
>From Linux/Unix, you should compile the iODBC Driver Manager into your
PHP/Apache build, and then drop in an ODBC driver.
There is a HOWTO at www.iodbc.org on compiling PHP with iODBC.
Best regards,
Andrew
--------------------------------------
Andrew Hill - OpenLink Software
Director Technology Evangelism
Universal Data Access Integration
http://www.openlinksw.com
> -----Original Message-----
> From: John Monfort [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 25, 2001 10:02 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP+MS Access and/or MS SQL
>
>
>
> Hello everyone,
>
> I'm looking for information on PHP+ MS Access , and PHP+MS SQL.
>
> Any recommendations?
>
> Thx in advance!
>
>
> __________John Monfort_________________
> _+-----------------------------------+_
> P E P I E D E S I G N S
> www.pepiedesigns.com
> "The world is waiting, are you ready?"
> -+___________________________________+-
>
> On Thu, 26 Apr 2001, Ben Quinn wrote:
>
> > Hi all,
> >
> > I am trying to copy an image from an external server and save
> it to my own.
> > I have the following script to do this for a txt file and it
> works great!
> >
> > ?>
> >
> > $page = "../temp/yep.txt";
> >
> > $date = date("http:/www.example.com/yep.txt");
> >
> > $cartFile = fopen("$page","a");
> > fwrite($cartFile,$date,strlen($date));
> > fclose($cartFile);
> >
> > ?>
> >
> > But i can't get it to work for image files - the images are saved and
> > displayed on screen as a whole bunch of rubbish.
> >
> > I'd appreciate any help you can give me
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
Thanks, Andrew.
The ODBC functions did the trick.
__________John Monfort_________________
_+-----------------------------------+_
P E P I E D E S I G N S
www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-
On Thu, 26 Apr 2001, Andrew Hill wrote:
> John,
>
> If you are using PHP from Windows you can use ODBC or the mssql_functions.
>
> From Linux/Unix, you should compile the iODBC Driver Manager into your
> PHP/Apache build, and then drop in an ODBC driver.
>
> There is a HOWTO at www.iodbc.org on compiling PHP with iODBC.
>
> Best regards,
> Andrew
> --------------------------------------
> Andrew Hill - OpenLink Software
> Director Technology Evangelism
> Universal Data Access Integration
> http://www.openlinksw.com
>
> > -----Original Message-----
> > From: John Monfort [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, April 25, 2001 10:02 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] PHP+MS Access and/or MS SQL
> >
> >
> >
> > Hello everyone,
> >
> > I'm looking for information on PHP+ MS Access , and PHP+MS SQL.
> >
> > Any recommendations?
> >
> > Thx in advance!
> >
> >
> > __________John Monfort_________________
> > _+-----------------------------------+_
> > P E P I E D E S I G N S
> > www.pepiedesigns.com
> > "The world is waiting, are you ready?"
> > -+___________________________________+-
> >
> > On Thu, 26 Apr 2001, Ben Quinn wrote:
> >
> > > Hi all,
> > >
> > > I am trying to copy an image from an external server and save
> > it to my own.
> > > I have the following script to do this for a txt file and it
> > works great!
> > >
> > > ?>
> > >
> > > $page = "../temp/yep.txt";
> > >
> > > $date = date("http:/www.example.com/yep.txt");
> > >
> > > $cartFile = fopen("$page","a");
> > > fwrite($cartFile,$date,strlen($date));
> > > fclose($cartFile);
> > >
> > > ?>
> > >
> > > But i can't get it to work for image files - the images are saved and
> > > displayed on screen as a whole bunch of rubbish.
> > >
> > > I'd appreciate any help you can give me
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
Hi All!
It's my first post:-)
I am working on a php web application that has to interchange encrypted
data to a VB windows standalone exe. Does anybody know the best way to do it??
I am making some tests with mcrypt_module using the BLOWFISH algorithm. On
the web enviromment I can encrypt and decrypt data following the rules said
at the manual, but the data that is interchanged with the VB application
cannot be decrypted and vice-versa!
Of Course, the VC app is able to deal with the BLOWFISH algorithm, although
it is not using the libmcrypt source, but another package who supports
BLOWFISH. Should I say to the VB people to use the sources from libmcrypt
instead of the actual ones?
That's it.
Regards
Alex Piaz
Webmaster
Global Map Internet Marketing
www.globalmap.com
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
"Those who know what's best for us -
Must rise and save us from ourselves"
Did I hear anyone say "SSL?"
Curtis
On Thu, 26 Apr 2001, Alex Piaz wrote:
> Hi All!
>
> It's my first post:-)
>
> I am working on a php web application that has to interchange encrypted
> data to a VB windows standalone exe. Does anybody know the best way to do it??
>
> I am making some tests with mcrypt_module using the BLOWFISH algorithm. On
> the web enviromment I can encrypt and decrypt data following the rules said
> at the manual, but the data that is interchanged with the VB application
> cannot be decrypted and vice-versa!
>
> Of Course, the VC app is able to deal with the BLOWFISH algorithm, although
> it is not using the libmcrypt source, but another package who supports
> BLOWFISH. Should I say to the VB people to use the sources from libmcrypt
> instead of the actual ones?
>
> That's it.
>
> Regards
>
>
> Alex Piaz
> Webmaster
> Global Map Internet Marketing
> www.globalmap.com
> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
> "Those who know what's best for us -
> Must rise and save us from ourselves"
>
>
>
Hi,
First of all, I've just joined this list, so here's a brief
introduction. My name's Jamie Saunders, I'm an 18 year old student from
the UK studying for my A-Levels. I'm currently working on a Computer
Studies project for a local business which involves setting up several
databases on the web. After reading Webmonkey.com's excellent introduction
to PHP I've decided to use it in conjunction with MySQL for the
project. Later this year, if all goes well I'm hoping to take a 3 years BA
Honors course in Multimedia Web Production.
Right, you still with me? What I'd like to know is how to validate a text
field in an HTML form to make sure it only contains numbers. I know how to
check it so it only contains letters, but not numbers - the field I want to
check is for phone numbers - so it can't contain any special characters
either. I expect this is very simple but I can't seem to get it working
properly. Any help appreciated.
Cheers,
Jamie Saunders
Jamie Saunders wrote:
>
> ...
>
> Right, you still with me? What I'd like to know is how to validate a text
> field in an HTML form to make sure it only contains numbers.
>
> ...
>
Try this:
<?
$phone_nr = '54256009';
if ( ereg( '^[0-9]+$', $phone_nr ))
...ok...
else
...not ok...
?>
Hope this helps.
--
Pavel a.k.a. Papi
you can do either:
ereg:
if(isset($field) and !$field!='') { // first check if it was submitted at
all,
// you'll get errors if it isn't there
$res = False;
$field = trim($field); // trim it to remove any whitespaces
// way 1, ereg:
if(ereg("^[[:digit:]]$", $field)) { $res = True; }
// way 2, is_numeric() (the best, fastest way):
if(is_numeric($field)) { $res = True; }
// way 3, is_int() (the same):
if(is_int($field)) { $res = True; }
// way 4, is_num() (the same):
if(is_int($field)) { $res = True; }
// way 5, gettype() (the same):
if(gettype($field)=='integer') { $res = True; }
// way 6, a stupi one but works
if($field>0) { $res = True; }
}
as you can see there are several ways to do it.
use wchich suits you better. In fact I would rather use JavaScript in form,
and here.
my favorite? is_int(). shorter to type :-)
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Jamie Saunders [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 11:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] simple form validation
Hi,
First of all, I've just joined this list, so here's a brief
introduction. My name's Jamie Saunders, I'm an 18 year old student from
the UK studying for my A-Levels. I'm currently working on a Computer
Studies project for a local business which involves setting up several
databases on the web. After reading Webmonkey.com's excellent introduction
to PHP I've decided to use it in conjunction with MySQL for the
project. Later this year, if all goes well I'm hoping to take a 3 years BA
Honors course in Multimedia Web Production.
Right, you still with me? What I'd like to know is how to validate a text
field in an HTML form to make sure it only contains numbers. I know how to
check it so it only contains letters, but not numbers - the field I want to
check is for phone numbers - so it can't contain any special characters
either. I expect this is very simple but I can't seem to get it working
properly. Any help appreciated.
Cheers,
Jamie Saunders
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
I've got two functions that return data in an array. I need to compare the
individual elements of one array against the elements of another, and do
something within an if-else statement.
I'm using php3, so I don't have an actual "foreach" loop to pick out the
array elements. Instead, I use:
while(list(, $element)=each($array)){
Basically, here's what I need to do:
Pull element 1 out of array 1,
Compare it to all elements of array 2,
Do something (if-else) based on the results of that comparison,
Pull element 2 out of array 1,
Compare it to all elements of array 2,
and so on until all elements of array 1 have been compared to all elements
of array 2.
Any help is greatly appreciated!
"[EMAIL PROTECTED]" wrote:
>
> I've got two functions that return data in an array. I need to compare the
> individual elements of one array against the elements of another, and do
> something within an if-else statement.
>
> ...
>
If i didn't misunderstood Your question, then this double-loop should
do the thing:
<?
$arr1=array('a'=>'aa','b'=>'bb');
$arr2=array('c'=>'cc','d'=>'cc');
for(reset($arr1);$i=key($arr1);next($arr1)){
for(reset($arr2);$j=key($arr2);next($arr2)){
/*
* compare here $arr1[$i] with $arr2[$j] and do something
*/
...
}
}
?>
--
Pavel a.k.a. Papi
PHP3? too bad...
PHP4 has a magic array_intersect (php.net/array_intersect)
try to see php.net/arrays
you might find what suits you.
you're double loop will slow your application dramatically. but if it's the
only way...
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 11:42 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Tough comparison problem.
I've got two functions that return data in an array. I need to compare the
individual elements of one array against the elements of another, and do
something within an if-else statement.
I'm using php3, so I don't have an actual "foreach" loop to pick out the
array elements. Instead, I use:
while(list(, $element)=each($array)){
Basically, here's what I need to do:
Pull element 1 out of array 1,
Compare it to all elements of array 2,
Do something (if-else) based on the results of that comparison,
Pull element 2 out of array 1,
Compare it to all elements of array 2,
and so on until all elements of array 1 have been compared to all elements
of array 2.
Any help is greatly appreciated!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
What does the "odbc_cursor" do? How does it work when put into PHP script
for odbc_connect, odbc_exec, etc.
Thanks,
Scott
Here's some code that I am using to get the time that is inout from a form into mysql.
It looks like I may have the format backwartds. Any ideas?
"INSERT into events (e_title, e_details, start, end, s_time, e_time) values ('$title',
'$details', '$s_year-$s_month-$s_day','$e_year-$e_month-$e_day',
'$stime_hour.$stime_minute', '$etime_hour.$etime_minute')";
s_time and e_time are thr start and end time of the event.
$stime_hour $stime_minute are the hour and minute fileds from the form.
Any ideas????
- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...
you are inputting a real dot (.) into e_time
remove it:
"INSERT into events (e_title, e_details, start, end, s_time, e_time) values
('$title', '$details', '$s_year-$s_month-$s_day','$e_year-$e_month-$e_day',
'$stime_hour.$stime_minute', '$etime_hour$etime_minute')";
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Shane McBride [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 1:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] writing a time to mysql????
Here's some code that I am using to get the time that is inout from a form
into mysql. It looks like I may have the format backwartds. Any ideas?
"INSERT into events (e_title, e_details, start, end, s_time, e_time) values
('$title', '$details', '$s_year-$s_month-$s_day','$e_year-$e_month-$e_day',
'$stime_hour.$stime_minute', '$etime_hour.$etime_minute')";
s_time and e_time are thr start and end time of the event.
$stime_hour $stime_minute are the hour and minute fileds from the form.
Any ideas????
- Shane
DISCLAIMER: I am by no means an expert on this, or any other, topic...
Many databases can handle hierarchical SQL statements. For examples
oracle uses "START WITH / connect by".
eg. SELECT level L1, level_id, name
FROM company_level
START WITH level_id=21
CONNECT BY prior level_id=parent_level_id
Very easy. Let the database do all the work. It would not be possible for
Yahoo to query the database recursively (ie issue many separate SQL
statements for a hierarchy).
So look into your database SQL reference. Hierarchical queries are defined
in SQL99 but most databases are only SQL92 compliant with some custom SQL99
support. I know DB2 supports hierarchies as well.
Mike
-----Original Message-----
From: Natasha [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 21, 2001 3:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Recursive Childs
Hiya,
This is something that I'm not able to figure out :
I am building something like a Yahoo! directry. I wanted to display a "new"
image infront of a category, like Yahoo! does.
But I want to show this even if the main category may not have any new link,
but a category in that might have, so like that...
like hotscripts.com too, so i thought if someone could tell me how to use
get all the children :
ID | NAME | PARENT
1 X 0
2 Y 1
3 Z 2
4 A 2
5 F 1
6 G 5
if i want to get all children of 1, i want to get 2, 3, 4, 5, 6!
how do i get this, thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi all!
Is using php the right technology with which i can create an online site
builder! i mean i want to enable users to create their own sites
in few minutes by choosing one model of the ones proposed, the colors, etc u
know like these site builders sites?
if not do u thnik there are specific tools i may use to fullfill these? or i
have to do it from scrach using jsp or java ?
Thanks a lot
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
kaab kaoutar wrote:
> i mean i want to enable users to create their own sites in few
> minutes by choosing one model of the ones proposed, the colors,
> etc u know like these site builders sites? if not do u thnik
> there are specific tools i may use to fullfill these?
This may get you started on the choose-a-theme part:
http://curtisonline.net/theme/phpfast-templates-HOWTO.html
Hope this helps.
John Platte
"Truth binds the mind to what satisfies it,
but worldly thinking does not satisfy
and therefore ignites curiosity."
-- St. Theophan the Recluse
I am trying to pull info from an Exchange LDAP server to make a dynamically
created phonebook, and am having trouble with one field. I think the problem
is that the script I have has everything pulled in an array, and all but the
field I am having problems with are strings. The telephoneNumber would be
integer. Would this cause the telephoneNumber info to not show up when I
view it through a web browser?
Here is the script I have.
<?php
$ldapserver = "myserver.com";
$basedn = "o=myOrganization";
$attribs = array ("cn", "title", "department", "telephoneNumber");
$dir = ldap_connect($ldapserver)
or die("Failed to connect to LDAP server");
$r = ldap_bind($dir)
or die("Failed binding to server");
$result = ldap_search($dir, $basedn, "sn=T*", $attribs)
or die("Error executing LDAP search");
$info = ldap_get_entries($dir, $result);
print count($info) . "entries returned<br>";
print "<table>";
for ($i=0; $i<$info["count"]; $i++) {
print "<tr>";
print "<td>";
print $info[$i]["cn"][0];
print "</td>";
print "<td>";
print $info[$i]["title"][0];
print "</td>";
print "<td>";
print $info[$i]["department"][0];
print "</td>";
print "<td>";
print $info[$i]["telephoneNumber"][0];
print "</td>";
print "</tr>";
}
ldap_close($dir);
?>
I am looking to process credit card transactions on my site. In order to do
this, I need to open a socket to a particular URL. I then submit an XML
string to them. They process the string and send me a response.
I am going to a certain (secure) location on the site of my credit card
processor (https://www.myprovider.com/XMLSubmit/processtrans.asp) and then
submit the XML string. After I submit all of the XML, the processor will
give me a response as to whether or not the transaction is approved.
How do I send the XML string to the above URL? When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com). I don't even really see where to force this to go over
HTTPS. I set the port to 443, but need to be sure that the data going
across uses SSL.
How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.asp?
I use:
$fp = fsockopen("www.somewhere.com",80);
fputs($fp, "GET http://www.somewhere.com/somedir/somepage.html
HTTP/1.0\r\n\r\n");
to parse. Should be easily modified....
____________________________
Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]
-----Original Message-----
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 12:37 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] fsockopen question
How do I send the XML string to the above URL? When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com). I don't even really see where to force this to go
over
HTTPS. I set the port to 443, but need to be sure that the data going
across uses SSL.
How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.asp?
$fp = fsockopen("www.somewhere.com",4096);
here you have to check the syntax for POST and HTTPS but I THINK
(hoo-boy am I ever risking ridicule) it should look something like this:
fputs($fp, "POST https://www.somewhere.com/dir/app HTTPS/1.0\r\n\r\n",
$xmlstring);
then try the response..
____________________________
Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]
-----Original Message-----
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 1:00 PM
To: Matthew Luchak; [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question
It looks like that is working, but I'm not getting a response. I
created the XML string and set it as $xmlstring. Then, after the fputs
that you provided below (except with the URL I'm sending to) I have:
fputs($fp, "$xmlstring");
Then, to receive the response I enter:
$RetValue=fgets($w_socket, );
echo $RetValue;
I am not getting any response, so I have no idea if my XML string is
accepted, rejected or what. Is this the right way for me to get the
response? After I send the XML string, they will send me back some info
that will let me know if the transaction is accepted.
It looks like that is working, but I'm not getting a response. I created
the XML string and set it as $xmlstring. Then, after the fputs that you
provided below (except with the URL I'm sending to) I have:
fputs($fp, "$xmlstring");
Then, to receive the response I enter:
$RetValue=fgets($w_socket, 4096);
echo $RetValue;
I am not getting any response, so I have no idea if my XML string is
accepted, rejected or what. Is this the right way for me to get the
response? After I send the XML string, they will send me back some info
that will let me know if the transaction is accepted.
-----Original Message-----
From: Matthew Luchak [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 10:04 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] fsockopen question
I use:
$fp = fsockopen("www.somewhere.com",80);
fputs($fp, "GET http://www.somewhere.com/somedir/somepage.html
HTTP/1.0\r\n\r\n");
to parse. Should be easily modified....
____________________________
Matthew Luchak
Webmaster
Kaydara Inc.
[EMAIL PROTECTED]
-----Original Message-----
From: Michael Conley [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 12:37 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] fsockopen question
How do I send the XML string to the above URL? When I use fsockopen, it
doesn't like anything other than an IP address or a host name (ie
www.myprovider.com). I don't even really see where to force this to go
over
HTTPS. I set the port to 443, but need to be sure that the data going
across uses SSL.
How do I send this XML string over HTTPS to
https://www.myprovider.com/XMLSubmit/processtrans.asp?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi,
the way i would do it looks like this:
- setup stunnel (www.stunnel.org) to listen to port 10443 in the
127.0.0.1 interface and forward that to www.myprovider.com
- the php script would connect to 127.0.0.1:10443 using plain text
- that's it, easy and clean! :)
stunnel will hapilly forward the 127.0.0.1:10443 to the destination
encripted and you will have to deal with the easy part of it! ;)
Regards,
Nuno Silva
Michael Conley wrote:
> I am looking to process credit card transactions on my site. In order to do
> this, I need to open a socket to a particular URL. I then submit an XML
> string to them. They process the string and send me a response.
>
> I am going to a certain (secure) location on the site of my credit card
> processor (https://www.myprovider.com/XMLSubmit/processtrans.asp) and then
> submit the XML string. After I submit all of the XML, the processor will
> give me a response as to whether or not the transaction is approved.
>
> How do I send the XML string to the above URL? When I use fsockopen, it
> doesn't like anything other than an IP address or a host name (ie
> www.myprovider.com). I don't even really see where to force this to go over
> HTTPS. I set the port to 443, but need to be sure that the data going
> across uses SSL.
>
> How do I send this XML string over HTTPS to
> https://www.myprovider.com/XMLSubmit/processtrans.asp?
>
>
>
> attachment.txt
>
> Content-Type:
>
> text/plain
Hello,
I'm building 4.0.4pl1 on RedHat 6.2 with all updates applied. It
configures OK and then when issue "make" i get:
[root@fenris php-4.0.4pl1]# make
Making all in Zend
make[1]: Entering directory `/home/curtis/php-4.0.4pl1/Zend'
/bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I../main
-DLINUX=2 -DEAPI -DUSE_EXPAT -DXML_BYTE_ORDER=12 -g -O2 -c
zend_language_sca
nner.c
In file included from /usr/include/errno.h:36,
from zend_language_scanner.c:2619:
/usr/include/bits/errno.h:25: linux/errno.h: No such file or directory
In file included from /usr/include/bits/posix1_lim.h:126,
from /usr/include/limits.h:30,
from
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/li
mits.h:117,
from
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/sy
slimits.h:7,
from
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/li
mits.h:11,
from zend_language_scanner.c:2620:
/usr/include/bits/local_lim.h:27: linux/limits.h: No such file or
directory
make[1]: *** [zend_language_scanner.lo] Error 1
make[1]: Leaving directory `/home/curtis/php-4.0.4pl1/Zend'
make: *** [all-recursive] Error 1
Any one have any clues? I can't get 3.0.16 to build either and I need
mysql support. If anyone knows where I can find functional RPM's that
would be OK, too.
Curtis
"Ben Quinn" <[EMAIL PROTECTED]> wrote:
> I am trying to copy an image from an external server and save it to my
own.
> I have the following script to do this for a txt file and it works great!
>
> ?>
>
> $page = "../temp/yep.txt";
>
> $date = date("http:/www.example.com/yep.txt");
>
> $cartFile = fopen("$page","a");
> fwrite($cartFile,$date,strlen($date));
> fclose($cartFile);
>
> ?>
>
> But i can't get it to work for image files - the images are saved and
> displayed on screen as a whole bunch of rubbish.
That's because your browser doesn't know the data is an image. Before you
send the image to the browser you have to use the header() function to send
the browser the proper mime type for the image. I don't know the mime type
off-hand, but there's probably a tutorial on zend.com or phpbuilder.com that
discusses saving images in a MySQL DB and pulling them out to display on a
webpage using PHP so find one of those articles and look near the end.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
I've got some code that I am
creating that creates a table with
a loop. and it works fine for what
it is, but my question is how do I
compensate for rows that aren't divisible
by 5 ? i.e. the empty cells at the table.
additionally if it ends on a complete row
(divisible by 5) I end up with an additional
empty row at the end of the table, I can
see why it does, I'm just trying to get around
it. no big hurry on this, I'm just trying to
learn more.
<snip>
<table width="450" border="1" align="center">
<tr>
<?
$x = 0;
while ($x <= 42)
{
$x++;
if ($x % 5 == 0)
{
echo "<td>".$x."</td>\n";
echo "</tr>\n<tr>\n";
}
else
{
echo "<td>".$x."</td>\n";
}
}
?>
</tr>
</table>
</snip>
Jerry Lake - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
I'm a little unclear as to what you're trying to do, but here's my
interpretation:
problem 2: if it ends on a complete row...
solution: put the echoing of the first and last tr's inside your
conditional. When $x is initialized to 0, the if will return true, and you
will output the very first tr...same at the end...so i'd have something like
this:
<table width="450" border="1" align="center">
<!-- we delete this first <tr> //-->
<?
$x = 0;
#different here for later reason
$length = 42;
while ($x <= $length)
{
$x++;
if ($x % 5 == 0)
{
echo "<tr>\n";
}
echo "<td>".$x."</td>\n";
if ($x % 5 == 0)
{
echo "</tr>\n";
}
}
#also added in
if($length % 5 != 0){
{
#then we know that it did not end completely, so echo you're final </tr>
echo "</TR>\n";
}
#no need for an else block because it would do nothing
?>
<!-- as well as this one </tr> //-->
</table>
Now if it ends on a complete row, you're fine!
problem 1: what about if it ends at 42 or something, with just a closing
</td>?
solution: make a final check to see if you need that closing </tr>
That is the if statement after you're loop...
I hope this helps.
-jack
-----Original Message-----
From: Jerry Lake [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 2:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] cell iterations in loop
I've got some code that I am
creating that creates a table with
a loop. and it works fine for what
it is, but my question is how do I
compensate for rows that aren't divisible
by 5 ? i.e. the empty cells at the table.
additionally if it ends on a complete row
(divisible by 5) I end up with an additional
empty row at the end of the table, I can
see why it does, I'm just trying to get around
it. no big hurry on this, I'm just trying to
learn more.
<snip>
<table width="450" border="1" align="center">
<tr>
<?
$x = 0;
while ($x <= 42)
{
$x++;
if ($x % 5 == 0)
{
echo "<td>".$x."</td>\n";
echo "</tr>\n<tr>\n";
}
else
{
echo "<td>".$x."</td>\n";
}
}
?>
</tr>
</table>
</snip>
Jerry Lake - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thanks, that worked with the removal
of the first "
Jerry Lake - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
-----Original Message-----
From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 1:18 PM
To: [EMAIL PROTECTED]; Jerry Lake
Subject: RE: [PHP] cell iterations in loop
I'm a little unclear as to what you're trying to do, but here's my
interpretation:
problem 2: if it ends on a complete row...
solution: put the echoing of the first and last tr's inside your
conditional. When $x is initialized to 0, the if will return true, and you
will output the very first tr...same at the end...so i'd have something like
this:
<table width="450" border="1" align="center">
<!-- we delete this first <tr> //-->
<?
$x = 0;
#different here for later reason
$length = 42;
while ($x <= $length)
{
$x++;
if ($x % 5 == 0)
{
echo "<tr>\n";
}
echo "<td>".$x."</td>\n";
if ($x % 5 == 0)
{
echo "</tr>\n";
}
}
#also added in
if($length % 5 != 0){
{
#then we know that it did not end completely, so echo you're final </tr>
echo "</TR>\n";
}
#no need for an else block because it would do nothing
?>
<!-- as well as this one </tr> //-->
</table>
Now if it ends on a complete row, you're fine!
problem 1: what about if it ends at 42 or something, with just a closing
</td>?
solution: make a final check to see if you need that closing </tr>
That is the if statement after you're loop...
I hope this helps.
-jack
-----Original Message-----
From: Jerry Lake [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 2:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] cell iterations in loop
I've got some code that I am
creating that creates a table with
a loop. and it works fine for what
it is, but my question is how do I
compensate for rows that aren't divisible
by 5 ? i.e. the empty cells at the table.
additionally if it ends on a complete row
(divisible by 5) I end up with an additional
empty row at the end of the table, I can
see why it does, I'm just trying to get around
it. no big hurry on this, I'm just trying to
learn more.
<snip>
<table width="450" border="1" align="center">
<tr>
<?
$x = 0;
while ($x <= 42)
{
$x++;
if ($x % 5 == 0)
{
echo "<td>".$x."</td>\n";
echo "</tr>\n<tr>\n";
}
else
{
echo "<td>".$x."</td>\n";
}
}
?>
</tr>
</table>
</snip>
Jerry Lake - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thanks, that worked with the removal
of the first if clause for part 2 of
my question, as far as part one, I will
try to explain better. if you view the
chunk of code in a browser you will get
a table with borders number 1-43 however
there will be a blank space at the end
where 44 & 45 would be. how can I make
the loop echo enough "<td> </td>" lines
to show empty cells instead of blank space
regardless of the number of cells I am
creating ?
Jerry Lake - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
-----Original Message-----
From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 1:18 PM
To: [EMAIL PROTECTED]; Jerry Lake
Subject: RE: [PHP] cell iterations in loop
I'm a little unclear as to what you're trying to do, but here's my
interpretation:
problem 2: if it ends on a complete row...
solution: put the echoing of the first and last tr's inside your
conditional. When $x is initialized to 0, the if will return true, and you
will output the very first tr...same at the end...so i'd have something like
this:
<table width="450" border="1" align="center">
<!-- we delete this first <tr> //-->
<?
$x = 0;
#different here for later reason
$length = 42;
while ($x <= $length)
{
$x++;
if ($x % 5 == 0)
{
echo "<tr>\n";
}
echo "<td>".$x."</td>\n";
if ($x % 5 == 0)
{
echo "</tr>\n";
}
}
#also added in
if($length % 5 != 0){
{
#then we know that it did not end completely, so echo you're final </tr>
echo "</TR>\n";
}
#no need for an else block because it would do nothing
?>
<!-- as well as this one </tr> //-->
</table>
Now if it ends on a complete row, you're fine!
problem 1: what about if it ends at 42 or something, with just a closing
</td>?
solution: make a final check to see if you need that closing </tr>
That is the if statement after you're loop...
I hope this helps.
-jack
-----Original Message-----
From: Jerry Lake [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 2:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] cell iterations in loop
I've got some code that I am
creating that creates a table with
a loop. and it works fine for what
it is, but my question is how do I
compensate for rows that aren't divisible
by 5 ? i.e. the empty cells at the table.
additionally if it ends on a complete row
(divisible by 5) I end up with an additional
empty row at the end of the table, I can
see why it does, I'm just trying to get around
it. no big hurry on this, I'm just trying to
learn more.
<snip>
<table width="450" border="1" align="center">
<tr>
<?
$x = 0;
while ($x <= 42)
{
$x++;
if ($x % 5 == 0)
{
echo "<td>".$x."</td>\n";
echo "</tr>\n<tr>\n";
}
else
{
echo "<td>".$x."</td>\n";
}
}
?>
</tr>
</table>
</snip>
Jerry Lake - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
ok, again, trying to understand "blank space"...but, try this:
if you print out <td></td> you'll get something i think you're referring to as blank
space...
try using a nonbreaking space in there...either or a space in the code; this
will force
the "emptiness" to show up...
-jack
----- Original Message -----
From: "Jerry Lake" <[EMAIL PROTECTED]>
Date: Thursday, April 26, 2001 4:54 pm
Subject: RE: [PHP] cell iterations in loop
> Thanks, that worked with the removal
> of the first if clause for part 2 of
> my question, as far as part one, I will
> try to explain better. if you view the
> chunk of code in a browser you will get
> a table with borders number 1-43 however
> there will be a blank space at the end
> where 44 & 45 would be. how can I make
> the loop echo enough "<td> </td>" lines
> to show empty cells instead of blank space
> regardless of the number of cells I am
> creating ?
>
> Jerry Lake - [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online - http://www.pacifier.com
>
>
> -----Original Message-----
> From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 1:18 PM
> To: [EMAIL PROTECTED]; Jerry Lake
> Subject: RE: [PHP] cell iterations in loop
>
>
> I'm a little unclear as to what you're trying to do, but here's my
> interpretation:
>
> problem 2: if it ends on a complete row...
> solution: put the echoing of the first and last tr's inside your
> conditional. When $x is initialized to 0, the if will return true,
> and you
> will output the very first tr...same at the end...so i'd have
> something like
> this:
>
> <table width="450" border="1" align="center">
> <!-- we delete this first <tr> //-->
> <?
> $x = 0;
> #different here for later reason
> $length = 42;
> while ($x <= $length)
> {
> $x++;
> if ($x % 5 == 0)
> {
> echo "<tr>\n";
> }
> echo "<td>".$x."</td>\n";
> if ($x % 5 == 0)
> {
> echo "</tr>\n";
> }
>
> }
>
> #also added in
> if($length % 5 != 0){
> {
> #then we know that it did not end completely, so echo
> you're final </tr>
> echo "</TR>\n";
> }
> #no need for an else block because it would do nothing
> ?>
> <!-- as well as this one </tr> //-->
> </table>
>
> Now if it ends on a complete row, you're fine!
>
> problem 1: what about if it ends at 42 or something, with just a
> closing</td>?
> solution: make a final check to see if you need that closing </tr>
> That is the if statement after you're loop...
>
> I hope this helps.
>
> -jack
>
>
>
> -----Original Message-----
> From: Jerry Lake [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 2:32 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] cell iterations in loop
>
>
> I've got some code that I am
> creating that creates a table with
> a loop. and it works fine for what
> it is, but my question is how do I
> compensate for rows that aren't divisible
> by 5 ? i.e. the empty cells at the table.
> additionally if it ends on a complete row
> (divisible by 5) I end up with an additional
> empty row at the end of the table, I can
> see why it does, I'm just trying to get around
> it. no big hurry on this, I'm just trying to
> learn more.
>
> <snip>
> <table width="450" border="1" align="center">
> <tr>
> <?
> $x = 0;
> while ($x <= 42)
> {
> $x++;
> if ($x % 5 == 0)
> {
> echo "<td>".$x."</td>\n";
> echo "</tr>\n<tr>\n";
> }
> else
> {
> echo "<td>".$x."</td>\n";
> }
> }
> ?>
> </tr>
> </table>
> </snip>
>
> Jerry Lake - [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online - http://www.pacifier.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>
Right, I understand that
if I use <td></td> it is blank space
if I use <td> </td> it is an empty cell
right now $length is set at 42 (this is arbitrary)
and there needs to be two empty cells at the end of
the last row. if length is 41 I will need 3 and 40
will need 4. but if I don't know what the value of
$length is going to be on a dynamic page such as
showing "x" amount of images from a folder. I need
for the loop to know how many "<td> </td>" to
echo out at the end depending on the $length;
I apologize if I am not explaining this very well.
I usually am quite concise.
Jerry Lake - [EMAIL PROTECTED]
Interface Engineering Technician
Europa Communications - http://www.europa.com
Pacifier Online - http://www.pacifier.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 2:00 PM
To: Jerry Lake
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP] cell iterations in loop
ok, again, trying to understand "blank space"...but, try this:
if you print out <td></td> you'll get something i think you're referring to
as blank space...
try using a nonbreaking space in there...either or a space in the
code; this will force
the "emptiness" to show up...
-jack
----- Original Message -----
From: "Jerry Lake" <[EMAIL PROTECTED]>
Date: Thursday, April 26, 2001 4:54 pm
Subject: RE: [PHP] cell iterations in loop
> Thanks, that worked with the removal
> of the first if clause for part 2 of
> my question, as far as part one, I will
> try to explain better. if you view the
> chunk of code in a browser you will get
> a table with borders number 1-43 however
> there will be a blank space at the end
> where 44 & 45 would be. how can I make
> the loop echo enough "<td> </td>" lines
> to show empty cells instead of blank space
> regardless of the number of cells I am
> creating ?
>
> Jerry Lake - [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online - http://www.pacifier.com
>
>
> -----Original Message-----
> From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 1:18 PM
> To: [EMAIL PROTECTED]; Jerry Lake
> Subject: RE: [PHP] cell iterations in loop
>
>
> I'm a little unclear as to what you're trying to do, but here's my
> interpretation:
>
> problem 2: if it ends on a complete row...
> solution: put the echoing of the first and last tr's inside your
> conditional. When $x is initialized to 0, the if will return true,
> and you
> will output the very first tr...same at the end...so i'd have
> something like
> this:
>
> <table width="450" border="1" align="center">
> <!-- we delete this first <tr> //-->
> <?
> $x = 0;
> #different here for later reason
> $length = 42;
> while ($x <= $length)
> {
> $x++;
> if ($x % 5 == 0)
> {
> echo "<tr>\n";
> }
> echo "<td>".$x."</td>\n";
> if ($x % 5 == 0)
> {
> echo "</tr>\n";
> }
>
> }
>
> #also added in
> if($length % 5 != 0){
> {
> #then we know that it did not end completely, so echo
> you're final </tr>
> echo "</TR>\n";
> }
> #no need for an else block because it would do nothing
> ?>
> <!-- as well as this one </tr> //-->
> </table>
>
> Now if it ends on a complete row, you're fine!
>
> problem 1: what about if it ends at 42 or something, with just a
> closing</td>?
> solution: make a final check to see if you need that closing </tr>
> That is the if statement after you're loop...
>
> I hope this helps.
>
> -jack
>
>
>
> -----Original Message-----
> From: Jerry Lake [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 2:32 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] cell iterations in loop
>
>
> I've got some code that I am
> creating that creates a table with
> a loop. and it works fine for what
> it is, but my question is how do I
> compensate for rows that aren't divisible
> by 5 ? i.e. the empty cells at the table.
> additionally if it ends on a complete row
> (divisible by 5) I end up with an additional
> empty row at the end of the table, I can
> see why it does, I'm just trying to get around
> it. no big hurry on this, I'm just trying to
> learn more.
>
> <snip>
> <table width="450" border="1" align="center">
> <tr>
> <?
> $x = 0;
> while ($x <= 42)
> {
> $x++;
> if ($x % 5 == 0)
> {
> echo "<td>".$x."</td>\n";
> echo "</tr>\n<tr>\n";
> }
> else
> {
> echo "<td>".$x."</td>\n";
> }
> }
> ?>
> </tr>
> </table>
> </snip>
>
> Jerry Lake - [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online - http://www.pacifier.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
ahhhhh, i got it...
ok, try this:
$length is arbitrary...
$x is your counter...
do the loop as before, but each time through the loop, $loopcount++;
So, if you do the loop 5 times, $loopcount == 5.
Then, at the end, $length - ($loopcount*$x) gives you the amount of <td> </td>'s to
echo. Put another for loop with these parameters after you've printed your normal
td's...you could do this all in one for loop, and would just need some more if
statements...
i think this is what you need...let me know how it goes...
-jack
----- Original Message -----
From: "Jerry Lake" <[EMAIL PROTECTED]>
Date: Thursday, April 26, 2001 5:20 pm
Subject: RE: RE: [PHP] cell iterations in loop
> Right, I understand that
> if I use <td></td> it is blank space
> if I use <td> </td> it is an empty cell
>
> right now $length is set at 42 (this is arbitrary)
> and there needs to be two empty cells at the end of
> the last row. if length is 41 I will need 3 and 40
> will need 4. but if I don't know what the value of
> $length is going to be on a dynamic page such as
> showing "x" amount of images from a folder. I need
> for the loop to know how many "<td> </td>" to
> echo out at the end depending on the $length;
>
> I apologize if I am not explaining this very well.
> I usually am quite concise.
>
> Jerry Lake - [EMAIL PROTECTED]
> Interface Engineering Technician
> Europa Communications - http://www.europa.com
> Pacifier Online - http://www.pacifier.com
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 2:00 PM
> To: Jerry Lake
> Cc: [EMAIL PROTECTED]
> Subject: Re: RE: [PHP] cell iterations in loop
>
>
> ok, again, trying to understand "blank space"...but, try this:
> if you print out <td></td> you'll get something i think you're
> referring to
> as blank space...
> try using a nonbreaking space in there...either or a space in the
> code; this will force
> the "emptiness" to show up...
>
> -jack
>
> ----- Original Message -----
> From: "Jerry Lake" <[EMAIL PROTECTED]>
> Date: Thursday, April 26, 2001 4:54 pm
> Subject: RE: [PHP] cell iterations in loop
>
> > Thanks, that worked with the removal
> > of the first if clause for part 2 of
> > my question, as far as part one, I will
> > try to explain better. if you view the
> > chunk of code in a browser you will get
> > a table with borders number 1-43 however
> > there will be a blank space at the end
> > where 44 & 45 would be. how can I make
> > the loop echo enough "<td> </td>" lines
> > to show empty cells instead of blank space
> > regardless of the number of cells I am
> > creating ?
> >
> > Jerry Lake - [EMAIL PROTECTED]
> > Interface Engineering Technician
> > Europa Communications - http://www.europa.com
> > Pacifier Online - http://www.pacifier.com
> >
> >
> > -----Original Message-----
> > From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 26, 2001 1:18 PM
> > To: [EMAIL PROTECTED]; Jerry Lake
> > Subject: RE: [PHP] cell iterations in loop
> >
> >
> > I'm a little unclear as to what you're trying to do, but here's my
> > interpretation:
> >
> > problem 2: if it ends on a complete row...
> > solution: put the echoing of the first and last tr's inside your
> > conditional. When $x is initialized to 0, the if will return true,
> > and you
> > will output the very first tr...same at the end...so i'd have
> > something like
> > this:
> >
> > <table width="450" border="1" align="center">
> > <!-- we delete this first <tr> //-->
> > <?
> > $x = 0;
> > #different here for later reason
> > $length = 42;
> > while ($x <= $length)
> > {
> > $x++;
> > if ($x % 5 == 0)
> > {
> > echo "<tr>\n";
> > }
> > echo "<td>".$x."</td>\n";
> > if ($x % 5 == 0)
> > {
> > echo "</tr>\n";
> > }
> >
> > }
> >
> > #also added in
> > if($length % 5 != 0){
> > {
> > #then we know that it did not end completely, so echo
> > you're final </tr>
> > echo "</TR>\n";
> > }
> > #no need for an else block because it would do nothing
> > ?>
> > <!-- as well as this one </tr> //-->
> > </table>
> >
> > Now if it ends on a complete row, you're fine!
> >
> > problem 1: what about if it ends at 42 or something, with just a
> > closing</td>?
> > solution: make a final check to see if you need that closing </tr>
> > That is the if statement after you're loop...
> >
> > I hope this helps.
> >
> > -jack
> >
> >
> >
> > -----Original Message-----
> > From: Jerry Lake [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 26, 2001 2:32 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] cell iterations in loop
> >
> >
> > I've got some code that I am
> > creating that creates a table with
> > a loop. and it works fine for what
> > it is, but my question is how do I
> > compensate for rows that aren't divisible
> > by 5 ? i.e. the empty cells at the table.
> > additionally if it ends on a complete row
> > (divisible by 5) I end up with an additional
> > empty row at the end of the table, I can
> > see why it does, I'm just trying to get around
> > it. no big hurry on this, I'm just trying to
> > learn more.
> >
> > <snip>
> > <table width="450" border="1" align="center">
> > <tr>
> > <?
> > $x = 0;
> > while ($x <= 42)
> > {
> > $x++;
> > if ($x % 5 == 0)
> > {
> > echo "<td>".$x."</td>\n";
> > echo "</tr>\n<tr>\n";
> > }
> > else
> > {
> > echo "<td>".$x."</td>\n";
> > }
> > }
> > ?>
> > </tr>
> > </table>
> > </snip>
> >
> > Jerry Lake - [EMAIL PROTECTED]
> > Interface Engineering Technician
> > Europa Communications - http://www.europa.com
> > Pacifier Online - http://www.pacifier.com
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: php-list-
> > [EMAIL PROTECTED]
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: php-list-
> > [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: php-list-
> [EMAIL PROTECTED]
>
hi all,
i have a script which selects description, price and quantity from a mysql
table.
i have displayed the results on a page in the form of description, price,
quantity but I was wondering how best to go about calculating a total total,
ie. sum of quantitys multiplied by sum of prices.
Any ideas?
Many thanks,
Sean.
At 08:31 PM 4/26/01 +0100, [EMAIL PROTECTED] wrote:
>hi all,
>
>i have a script which selects description, price and quantity from a mysql
>table.
>
>i have displayed the results on a page in the form of description, price,
>quantity but I was wondering how best to go about calculating a total total,
>ie. sum of quantitys multiplied by sum of prices.
Generally, that's not how you do that.
You'd calculate "extended" prices based on quantity of item and price, then
add all extended prices.
1 Thingy $5 Ext= $5
2 SuperThingy $3 Ext=$6
Total is $11
As opposed to
3 * $8 by the method you described.
--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
oh, I am such a bone head.. but the actual question was how to calculate the
totals.
i have a column on my form that says $qry["price"]*$qry["quantity"] which
gives me a column of totals but my question is how to total that up???
any ideas?
"David VanHorn" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 08:31 PM 4/26/01 +0100, [EMAIL PROTECTED] wrote:
> >hi all,
> >
> >i have a script which selects description, price and quantity from a
mysql
> >table.
> >
> >i have displayed the results on a page in the form of description, price,
> >quantity but I was wondering how best to go about calculating a total
total,
> >ie. sum of quantitys multiplied by sum of prices.
>
> Generally, that's not how you do that.
> You'd calculate "extended" prices based on quantity of item and price,
then
> add all extended prices.
>
> 1 Thingy $5 Ext= $5
> 2 SuperThingy $3 Ext=$6
>
> Total is $11
>
> As opposed to
> 3 * $8 by the method you described.
>
>
> --
> Dave's Engineering Page: http://www.dvanhorn.org
> Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
initialize a total variable to 0. every time you print out a price, $total
+= $currentprice.
at the end you'll have the total. am i misunderstanding you?
-jack
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 3:43 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] math calculations query
oh, I am such a bone head.. but the actual question was how to calculate the
totals.
i have a column on my form that says $qry["price"]*$qry["quantity"] which
gives me a column of totals but my question is how to total that up???
any ideas?
"David VanHorn" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 08:31 PM 4/26/01 +0100, [EMAIL PROTECTED] wrote:
> >hi all,
> >
> >i have a script which selects description, price and quantity from a
mysql
> >table.
> >
> >i have displayed the results on a page in the form of description, price,
> >quantity but I was wondering how best to go about calculating a total
total,
> >ie. sum of quantitys multiplied by sum of prices.
>
> Generally, that's not how you do that.
> You'd calculate "extended" prices based on quantity of item and price,
then
> add all extended prices.
>
> 1 Thingy $5 Ext= $5
> 2 SuperThingy $3 Ext=$6
>
> Total is $11
>
> As opposed to
> 3 * $8 by the method you described.
>
>
> --
> Dave's Engineering Page: http://www.dvanhorn.org
> Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hello,
The page http://www.php.net/support.php talks about many mailing lists, but
I really can't find the specific email address of any of those lists. It
would be really helpful if the list addresses were on that page as well.
Does anyone know who this suggestion should be forwarded to?
Thanks
-Matt
Are you looking for a list of the different addresses? If you move your
mouse over the "yes" you'll see the link to the various sections at
http://marc.theaimsgroup.com/, or you can go there, scroll to the bottom,
and look in the WWW section. They're all there.
-jack
-----Original Message-----
From: Matt Wong [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 26, 2001 3:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] where are the mailing lists listed?
Hello,
The page http://www.php.net/support.php talks about many mailing lists, but
I really can't find the specific email address of any of those lists. It
would be really helpful if the list addresses were on that page as well.
Does anyone know who this suggestion should be forwarded to?
Thanks
-Matt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
my advice would be to disconnect the box from
the internet until you understand how to properly
secure it.
please read the documentation and manuals
before your box gets raped and pillaged....
> -----Original Message-----
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Subject: RE: [PHP] Filesystem security
>
>
> Read the php.ini file and the manuals on php.net.
>
> There are some directives which can limit the parser to operate on files
> under a certain level.
>
> You can also disallow functions if you care. As well as what directives can
> be overwritten by .htaccess files.
>
> No idea where have I read all that, but I am sure there is.
>
>
> -----Original Message-----
> From: Anton G. Popov [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] Filesystem security
>
> Hi
>
> I have to set up a site for free web hosting incl. php
> I installed apache and php4.0.4pl1 and now the php scripts can browse the
> entire filesystem of the machine. Does anyone know how to fix that?
>
> 10x a lot
>
> Antt
At 03:36 PM 4/26/2001, ..s.c.o.t.t.. [gts] wrote:
or better yet.....as in #feed-the-goats on efnet :-)
christ - this is scary...people getting involved in things that they have
no clue about.
"i have built a rocket, but once i take off i can't figure how to land it
without breaking a few bones. can anybody help me?"
"does anybody have any plutonium for sale so i can build a bomb? BTW
what's the atomic number of Hydrogen?"
let me guess - your probably running redhat. the distro of the owned :-)
Please get a clue and read a few man pages...or read the LDP or
something......just pull your head outta .......... :-)
~kurth
>my advice would be to disconnect the box from
>the internet until you understand how to properly
>secure it.
>
>please read the documentation and manuals
>before your box gets raped and pillaged....
>
>
> > -----Original Message-----
> > From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> > Subject: RE: [PHP] Filesystem security
> >
> >
> > Read the php.ini file and the manuals on php.net.
> >
> > There are some directives which can limit the parser to operate on files
> > under a certain level.
> >
> > You can also disallow functions if you care. As well as what directives can
> > be overwritten by .htaccess files.
> >
> > No idea where have I read all that, but I am sure there is.
> >
> >
> > -----Original Message-----
> > From: Anton G. Popov [mailto:[EMAIL PROTECTED]]
> > Subject: [PHP] Filesystem security
> >
> > Hi
> >
> > I have to set up a site for free web hosting incl. php
> > I installed apache and php4.0.4pl1 and now the php scripts can browse the
> > entire filesystem of the machine. Does anyone know how to fix that?
> >
> > 10x a lot
> >
> > Antt
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
I said be prepared. Not that it would happen.
Considering the learning curve of linux..I think it is only fair to say
that mistakes are likely to happen, in particular for a newbie.
On Wed, 25 Apr 2001, B. van Ouwerkerk wrote:
>
> >
> >Also if you are a newbie to linux....get a different machine or be
> >prepared to lose data or windows on your present machine.
>
> Never lost any data.. Not even when I still was a newbie..
>
> But it's always a good idea to create backups.
>
> Bye,
>
>
> B.
>
>
>
--
Sono
the learning curve is smaller than most people think...
if you are willing to learn, and refuse to be
intimidated by the reputation that has been built
up around linux, i doubt you'll have any
problems installing and running/using it
in a lot of ways, i think linux is probably a more
"natural" OS for programmers... we're used to big
scary text files where a single incorrect semicolon
can cause unheard of errors in far reaching parts of
the code.... linux is much the same way... a single
obscure config file can bring down your entire
system if configured incorrectly :)
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 3:47 PM
> To: B. van Ouwerkerk
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Can I install Lihnux on My Windows 95 machine ?
>
>
>
> I said be prepared. Not that it would happen.
> Considering the learning curve of linux..I think it is only fair to say
> that mistakes are likely to happen, in particular for a newbie.
>
> On Wed, 25 Apr 2001, B. van Ouwerkerk wrote:
>
> >
> > >
> > >Also if you are a newbie to linux....get a different machine or be
> > >prepared to lose data or windows on your present machine.
> >
> > Never lost any data.. Not even when I still was a newbie..
> >
> > But it's always a good idea to create backups.
> >
> > Bye,
> >
> >
> > B.
> >
> >
> >
>
> --
> Sono
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
At 13:47 26-4-01 -0600, [EMAIL PROTECTED] wrote:
>I said be prepared. Not that it would happen.
>Considering the learning curve of linux..I think it is only fair to say
>that mistakes are likely to happen, in particular for a newbie.
Sure.. It can happen.. to be honest.. you don't need to install Linux on a
windooz box to loose data .. Winbug can already take care of that :-)
Bye,
B.
Agreed:)
hehe
On Thu, 26 Apr 2001, B. van Ouwerkerk wrote:
> At 13:47 26-4-01 -0600, [EMAIL PROTECTED] wrote:
>
> >I said be prepared. Not that it would happen.
> >Considering the learning curve of linux..I think it is only fair to say
> >that mistakes are likely to happen, in particular for a newbie.
>
> Sure.. It can happen.. to be honest.. you don't need to install Linux on a
> windooz box to loose data .. Winbug can already take care of that :-)
>
> Bye,
>
>
> B.
>
>
>
--
Sono
Where can I find a win32 version of the mcrypt module?
- Carsten
If you have PHP compiled with --enable-trans-sid,
are the URLs that are part of the form's action supposed
to be modified to include the SID? So far that's not
been happening and I just want to verify that this is
expected behavior.
thnx,
Chris
Chris, I'm not sure what is supposed to happen, but what is happening for me
is that a HIDDEN field is added to my form with the sid as the value:
<INPUT TYPE="HIDDEN" NAME="PHPSESSID"
VALUE="b8146b40fbc336b319eda9b7073691e0">
Kirk
> -----Original Message-----
> From: Boget, Chris [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 26, 2001 3:09 PM
> To: Php (E-mail)
> Subject: [PHP] --enable-trans-sid and forms
>
>
> If you have PHP compiled with --enable-trans-sid,
> are the URLs that are part of the form's action supposed
> to be modified to include the SID? So far that's not
> been happening and I just want to verify that this is
> expected behavior.
>
> thnx,
> Chris
>
Hello,
I have a Java based, simple server running on an obscure port (not
HTTP/HTML) that I currently use for other things.
Could I cause PHP to send/receive simple text messages with that server?
This has nothing to do with the Web. I'd just like to be able to 'talk' to
that server with a PHP script. Tx!
This would be something like PHP accessing a MySQL daemon via its port.
Andy.
http://alliancecommerce.net
How can I alter a table name in mysql with php?
thanks,
Augusto cesar Castoldi
Hi,
check you've got a D/B connection, then use this, with the appropriate names
in the variables, or use the explicit table names if you wish. If an error
spews up, most likely the table name your trying to rename it to already
exists.
$sql = "RENAME TABLE $present_table_name TO $new_table_name
";
$result = @mysql_query($sql,$connection) or die("New table name already
exists");
Regards
Kevin Williams
----- Original Message -----
From: "Augusto Cesar Castoldi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 26, 2001 10:18 PM
Subject: [PHP] alter table name with php and mysql
> How can I alter a table name in mysql with php?
>
> thanks,
>
> Augusto cesar Castoldi
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
At 26.04.2001 22:38, you wrote:
>Hi,
>check you've got a D/B connection, then use this, with the appropriate names
>in the variables, or use the explicit table names if you wish. If an error
>spews up, most likely the table name your trying to rename it to already
>exists.
Or the table you're trying to rename doesn't exists...
--
Andreas D. Landmark
[EMAIL PROTECTED]
"I hesitate to articulate for fear of deviating from the true path of
rectitude."
Meaning: "I don't know."
Greetings..
This is how I currently check for instances of words and other:
for ($i=0; $i < $total_lines; $i++){
$line_array = explode("|",$line[$i]);
$swhat=strtolower($txtLinkname);
$xos =
array(strtolower($line_array[1]),strtolower($line_array[2]),strtolower($line
_array[3]),strtolower($line_array[4]),strtolower($line_array[5]));
if (in_array($swhat,$xos,true)) {
$found++;
Problem is, that the server where I have my files don't support in_array. It
is claimed that the servers PHP server is on version 4.0, how can this be
when in_array is a function that came first with PHP4 (according to my
documents) ??
Is there something else I could use?
Thanks
- Richard
I'm a newbie and I'm trying to write a program to send an email. Here is
the kicker, I want to attach a Word document to the email. Could someone
please help. Thanks.
Hi,
PHP has handling of MIME types and good support for handling any type of
file.
First off, check the syntax at
http://www.php.net/manual/en/function.mail.php
Then you need to set your mail_headers, and the MIME-version must come
before other MIME headers.
Hope this helps
----- Original Message -----
From: "Tym Rehm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 26, 2001 10:29 PM
Subject: [PHP] NEWBIE Mail()
> I'm a newbie and I'm trying to write a program to send an email. Here is
> the kicker, I want to attach a Word document to the email. Could someone
> please help. Thanks.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
Hi!
can you tell me how can I check if a remote files exists?
I've tried with fopen, but I've a warning on STDOUT if file doesn't exists.
I wouldn't redirect the STDERR to solve this problem.
I could use fsockopen, but I feel that this is a bad solution.
Can you tell me something that is easy?
I would a function that return true/false if an url is/not is valid; without
error to browser
Thanks
I am trying to add a Javascript in array but it gives me an error unless
certain characters are commented which makes sense, but then the Javascript
won't run. Any ideas here is what I am trying:
<?
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => '
<A HREF="test.html" onmouseover="document.images[0].src='test1'.jpg; return
true;">
<IMG SRC="images/reviews.jpg" BORDER=0></A>');
of course the ' characters are a problem etc. so for an example I tried:
<?
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => '
<A HREF="test.html" onmouseover="document.images[0].src=\'test1\'.jpg;
return true;">
<IMG SRC="images/reviews.jpg" BORDER=0></A>');
Any suggestions on how to get this to work?
Hello everyone,
I was wondering, is anyone aware of a PHP server model, for Ultradev?
Or, any leads on how I can create one?
I'm developing a site with PHP+MS Access+Ultradev. I wanted to use some
of the Ultradev server model features (and convenience), but
they only support ASP/JSP/JScript.
Any help would be greatly appreciated.
-john
__________John Monfort_________________
_+-----------------------------------+_
P E P I E D E S I G N S
www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-
Hi!
I've done a program that send a zip file to browser. I read it on server
using fopen because I've it in a private area (I can't send it directly).
Now I send it to browser in this way:
header ("Content-type: application/x-zip-compressed");
$fd = fopen ($filename, "r");
$data = fread( $fd , filesize ($filename));
echo ($data);
fclose ($fd);
This work, but when the user tries to save the file on his disk the script
set as file name the name of itself!
I've tried unsuccesfully to print this header after the first header:
header ("Content-Disposition: attachment; filename=\"WorkPlease.zip\"");
Can you help me?
I was trying the xpath expression like ancestor::* it always causes the
Segmentation error by PHP (both in Apache static moduel and stand-alone
executable).
But expressions like ancestor::para work fine. Only when I try to get all
the ancestors of the node PHP fails.
Does anyone has any idea?
Thanks.
Grishick.
> If I wanted to use this utility to copy a file from a users (Windows)
> workstation to my (Linux) webserver, how would I do this? The program on
> the users workstation will create a file called "info.txt" and place it in
> c:\wow. I want it to go to my server upload.mydomain.com. How do I get the
> file c:\wow\info.txt from the user to my web server over https?
>
No solution here for the server side - I have a similar problem! But I DO know
of a Win32 Borland library with an http component which supports POSTing of
files. If you're working in Delphi, or C++ Builder, try
http://www.nevrona.com/Indy/Download.html
BUT - what about the server end, and PHP? I need to write a script which
extracts the POSTed file content and store it on the server. (With a browser
client I could upload from with <input type="file"> form elements and use the
PHP upload functions, but using a browser at the client end is not an option
here.)
According to the w3c docs, POSTed content is sent in the "request
entity body". Since the request has a header, it's logical that it can
have a body too :-) but I don't see any PHP functionality for getting at
it.
PHP itself must be able to extract the POSTed data - it does so when saving a
POSTed file to its temporary location - but this function don't seem to be
exposed
in the API... is it?
Thanks for any wisdom!
Nik
Hello,
I am trying to make a PHP script to index my site and insert into a
MySQL
DB the
.htm files path, its Title (from the HTML tags <Title></Title>), its
Description
(from the meta tag <meta name="description" content="..."> ) and its
Keywords
(from the meta tag <meta name="keywords" content="..."> ).
Well, I adapted this function to get the Title and it works great!!:
/*
* Given a raw html document (as string), return its title.
* This function may need to be modified if your web pages use
automatically
* generated titles.
*/
function getTitle(&$doc)
{
if (eregi("<title>(.*)</title>", $doc, $titlematch))
$title = trim(eregi_replace("[[:space:]]+", " " ,
$titlematch[1]));
else
$title = "";
if ($title == "")
$title = "Sem Título";
return $title;
}
I then tried to do something similar to get the Description:
function getDescription(&$doc)
{
if (eregi('<meta name="description" content="(.*)">', $doc,
$descr))
$descricao = trim(eregi_replace("[[:space:]]+", " " ,
$descr[1]));
else
$descricao = "";
if ($descricao == "")
$descricao = "Sem Descrição";
return $descricao;
}
This doesn't work as intended... It returns the whole page starting
after
content=" and doesn't end at the end of the string (">).
The funny thing is that if I add a space on the end of the string like
this ("
>) in both the PHP code and in the HTML file (<meta name="description"
conten="test with a space" >), the function returns only the string of
the
description as intended...
The same thing happens with the Keywords:
function getKeywords(&$doc)
{
if (eregi('<meta name="keywords" content="(.*)">', $doc,
$mykeys))
$keywords = trim(eregi_replace("[[:space:]]+", " " ,
$mykeys[1]));
else
$keywords = "";
if ($keywords == "")
$keywords = "Sem Keywords";
return $keywords;
}
But this time I nedded two (2) spaces to make the function work!!!
(<meta
name="description" conten="test with 2 spaces" >), If I used one or
no
space it
returned the whole page... with 2 spaces the function works...
I concluded that the regex pattern (.*) doesn't stops looking on the
">
and
needs a space between them (" >). But why the second time it nedded 2
spaces!?
I don't want to have to change all the HTM files from my site and add
a
space to
the Descritpion Meta Tag and 2 spaces to the Keywords Meta... Is there
a
way to
say to the (.*) to end the search at the "> ?
Thanks for your attention
Marco Ascensao
Sigitas Paulavicius wrote:
> "Vishak K Tomy" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello,
> > I tried to send mail through the mail function but it is not
> > working. I am using php version 3.0.12 under linux, following is the
> > code I used to send mail.
> > So what is the problem with it, any body please solve this.
> >
> > Regards
> > Vishak
>
> Hi
>
> mail() uses the SMTP service running on localhost...errr... on the same
> computer as the web service is running. So if there is no smtp service on
> localhost, mail() won't work.
> You must get SMTP libraray and use it to connect to some other server and
> send the message. It's really simple and easy to come by.
As far as I understand it, SMTP doesn't have to be on the same computer, but
it's location does have to be configured right in php.ini or whatever. Check
phpinfo() for PHP core configurations setting sendmail_path (Unix/Linux) or
SMTP (Windows) - the SMTP value is the IP of an SMTP server.
nik