trim will not work, try something like:
$id = preg_replace("/^0+(.*)$/","//1",$id);
instead
Monty wrote:
I tried removing the zeros, but, I get the same result:
$id = 11;
$id = ltrim($id, '0');
echo $id; // Displays: 9 instead of 11 ???
This didn't work either
sry... it's \\1 instead of //1 ... guess i had one to many beers :)
Red Wingate wrote:
trim will not work, try something like:
$id = preg_replace("/^0+(.*)$/","//1",$id);
instead
Monty wrote:
I tried removing the zeros, but, I get the same result:
$id = 11;
$id = ltrim($id, '0');
you should have script, call it image.php or something like that, the
only thing that should be in that script is this:
no html tags in there, no whitespace.
to see the image you could call the page like this
http://www.yourdomain.whatever/image.php . you could call it in a
iumage tag like this
This way works fine!!
Thank you very much.
-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED]
Sent: Friday, April 02, 2004 2:10 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Image output (Newb question)
you should have script, call it image.php or s
Had a previous thread on this issue. Started working on it again and am
running into new bugs, so thought I'd start a new thread.
Read thoroughly through session examples in docs and here's how I tried to
pass an object from one page to another:
page 1
__
// include class definition file
in
Thanks Red, but, still the same problem:
$id = 11;
$id2 = preg_replace("/^0+(.*)$/","\\1",$id);
echo $id2; // Displays 9
echo $id; // Displays 9 as well.
If the number begins with a zero, there seems to be no way to tell PHP this
is an integer, not an octal. The co
Doesn't putting and x11 tell PHP it's a decimal format?
> $id = 11;
> $id2 = preg_replace("/^0+(.*)$/","\\1",$id);
>
> echo $id2; // Displays 9
> echo $id; // Displays 9 as well.
>
> If the number begins with a zero, there seems to be no way to tell PHP
> this
>
hm
ever tryed telling PHP to display the variable as an integer?
echo (integer) $id ;
-- red
Daniel Clark wrote:
Doesn't putting and x11 tell PHP it's a decimal format?
$id = 11;
$id2 = preg_replace("/^0+(.*)$/","\\1",$id);
echo $id2; // Displays 9
echo $id;
Found this:
$a = 1234; # decimal number
$a = -123; # a negative number
$a = 0123; # octal number (equivalent to 83 decimal)
$a = 0x1A; # hexadecimal number (equivalent to 26 decimal)
http://www.phpbuilder.com/manual/language.types.integer.php#language.types.integer.casting
> hm
>
> ever try
* Thus wrote Daniel Clark ([EMAIL PROTECTED]):
> Found this:
>
> $a = 1234; # decimal number
> $a = -123; # a negative number
> $a = 0123; # octal number (equivalent to 83 decimal)
> $a = 0x1A; # hexadecimal number (equivalent to 26 decimal)
$a is integer in all these cases, the only difference i
* Thus wrote Monty ([EMAIL PROTECTED]):
> I tried removing the zeros, but, I get the same result:
>
> $id = 11;
> $id = ltrim($id, '0');
> echo $id; // Displays: 9 instead of 11 ???
>
> This didn't work either:
>
> $id = 11;
> settype($id, 'string');
Red Wingate wrote:
ever tryed telling PHP to display the variable as an integer?
echo (integer) $id ;
Ever "tryed" realizing 0x09, 011, and 9 are all integers (just different
bases)?
;)
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.n
Monty wrote:
Thanks Red, but, still the same problem:
$id = 11;
$id2 = preg_replace("/^0+(.*)$/","\\1",$id);
echo $id2; // Displays 9
echo $id; // Displays 9 as well.
If the number begins with a zero, there seems to be no way to tell PHP this
is an integer, not an o
I was trying to bend my mind around the concept of the reference
operator (&) today and came across an article at
http://www.onlamp.com/pub/a/php/2002/09/12/php_foundations.html where
the author gave the following example:
value = $val;
}
function printval() {
echo "
The Directories function opendir(string path)
As of PHP 4.3.0 path can also be any URL which supports directory listing
This returns false eventhough the URL supports directory listing?
opendir (http://www.fu.bar/images/);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
* Thus wrote Dave ([EMAIL PROTECTED]):
> The Directories function opendir(string path)
> As of PHP 4.3.0 path can also be any URL which supports directory listing
, however only the file:// URL wrapper supports this in PHP 4.3. As
of PHP 5.0.0, support for the ftp:// URL wrapper is included as
wel
the browser always shows like this: Fatal error: Call to
undefined function: domxml_open_mem() in
c:\apache\htdocs\svg_dom_xml_php_bsp.php on line 76. What is wrong here?
In php 4 the dom xml extension is NOT loaded by default. So you can't
just call these functions until you load the extensi
Is http:// URL wrapper support included in PHP 4.3.4 ?
or is this included in PHP 5.0.0?
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> * Thus wrote Dave ([EMAIL PROTECTED]):
> > The Directories function opendir(string path)
> > As of PHP 4.3.0 path can also be any UR
Greetings,
I am working on a Point of Sale Program for PHP. I need to find out how to open a
cash register drawer. Could anyone give me any info? Do I need to do this with a
javascript section?
Thanks,
Leonard Burton
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit
* Thus wrote Dave ([EMAIL PROTECTED]):
>
> Is http:// URL wrapper support included in PHP 4.3.4 ?
> or is this included in PHP 5.0.0?
I wouldn't expect the http wrapper to ever support opendir
functionality. Its virtually impossilble to read directoy listings
from a web server.
>
> "Curt Zirzo
It's not the same thing. When an variable references an object then you
can change either the original object or the new variable and you will
be changing the *same* object, not a new one. Maybe this example helps?
class test {
function test($val) {
global $myref;
My question is actually regarding the line "$myref = &$this;". The
author states that this is a reference to the class/object itself. Isn't
this like saying outside the class "$myref =& new test;"? What would be
the point of referring to itself inside the class in this manner?
Thanks for you
page 1
__
// include class definition file
include_once "order_classes.php";
// start session
session_start();
// create instance of class Order
$order = New Order();
// assign class instance to $SESSION[]
$_SESSION['order'] = $order;
page 2
__
// include class definition file
include_once
Boot wrote:
Thanks to those who helped with my last post on session vars.
My question now is why does my server seem to randomly choose whether or not
to show the session ID appended to the browser URL? Sometimes it is there,
sometimes not. All pages session_start();.
Thanks!
Check your browser's
You probably need to check out OPOS, but I haven't looked at it in a
while and can't really tell you what to do.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Leonard B Burton wrote:
Greetings,
I am working on a Point of Sale Program for PHP. I need to find out how to open a cash register drawer. Could anyone give me any info? Do I need to do this with a javascript section?
You will be hard pressed to do anything like this with php. the reason
i
on 4/2/04 8:24 PM, Jason Barnett at [EMAIL PROTECTED] wrote:
>
> Are you passing the session id between the pages? E.g. are you setting
> session cookies, or passing the session id as part of the url?
Doesn't php default to using cookies? I'm not doing anything other than
using the code I showed
Leonard B Burton wrote:
I am working on a Point of Sale Program for PHP. I need to find out
how to open a cash register drawer. Could anyone give me any info?
Do I need to do this with a javascript section?
Uhmm... I to am interested in PHP scripts that open cash register
drawers. Yeah... can
On Fri, 2004-04-02 at 20:40, Raditha Dissanayake wrote:
> Leonard B Burton wrote:
>
> >Greetings,
> >
> >I am working on a Point of Sale Program for PHP. I need to find out how to open a
> >cash register drawer. Could anyone give me any info? Do I need to do this with a
> >javascript section?
Yes, you'll need to parse the output of the page.
"Dave" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is it possible to retrieve dir file list from an internet server folder
from
> within a php program?
>
> In the browser, the http:// page displays "Index of" and a list of files.
Randall Perry wrote:
on 4/2/04 8:24 PM, Jason Barnett at [EMAIL PROTECTED] wrote:
Are you passing the session id between the pages? E.g. are you setting
session cookies, or passing the session id as part of the url?
Doesn't php default to using cookies? I'm not doing anything other than
using
Jason, thanks. Yes, I understand your example here very well. My
question actually had more to do with understanding what value was added
to the class by "$myref = &$this;". Perhaps it is some misunderstanding
I have of classes but, since a class is just a pattern and not an
actual, usable o
On Saturday 03 April 2004 05:50, Bruno Santos wrote:
> i've tried to pass the global array $_FILES to a function
$_FILES is a superglobal and hence available everywhere (including the inside
of functions) without any work on your part.
> but still no sucess...
Please elaborate.
> can someone
On Saturday 03 April 2004 03:35, Matt MacLeod wrote:
> I'm stumped. I have a script to send a simple email using the mail()
> function in PHP.
>
> For some reason I can only receive the email if I send it to my hotmail
> account. If I send to my regular email ([EMAIL PROTECTED]) I can't get
> it.
On Saturday 03 April 2004 00:59, Shawn Beard wrote:
> I just tried downgrading to version 4.3.4 and it still does not work.
And presumably it had worked before you did the upgrade? The tone of your
original post suggested that the upgrade broke the mail functionality?
Again:
> Are you positive
On Saturday 03 April 2004 03:04, Linux Zero wrote:
> I write some PHP scripts for a system's module that allows the user to
> upload a file from his computer to the host. It works fine in a server with
> Linux Apache MySQL PHP (LAMP) environment. I based on the examples of
> this page:
>
> h
On Saturday 03 April 2004 01:28, Chris Shiflett wrote:
> --- Frano ILICIC <[EMAIL PROTECTED]> wrote:
> > I just wonder what is the best apache version to run PHP 4.35?
> > Just wondering if there is an obvious choice?
>
> Maybe not obvious, but I think the best choice is the latest Apache 1.3.x.
B
I'm using this on Apache. You need to include 'inc/globals.php' in your
script.
inc/globals.php
define('RELPATH', GetRelativePath());
?>
inc/functions.php
function GetRelativePath() {
$RELPATH = str_replace(UpDirectory(__FILE__), '',
dir_name($_SERVER['SCRIPT_NAME]));
$REL
Bernhard Kraft wrote:
Hallo !
I run PHP 4.1.2.
I want to set the user_agent which gets sent
along when fetching file via the fopen(...) call.
Normally this is "PHP/VERISON" in my case "PHP/4.1.2"
I want to set a different user_agent.
I *believe* you can set this via header(), but its still early
Shawn Beard wrote:
I just upgraded to PHP 4.3.5 and now my email functionality does not work. I do have the SMTP setting in the php.ini set up and did restart Apache. We are running a Windows 2000 server and Apache 2.0.49. Any ideas?
A few ideas/suggestions :
Does your smtp server require authe
101 - 140 of 140 matches
Mail list logo