php-windows Digest 14 Jan 2002 21:34:42 -0000 Issue 952

Topics (messages 11419 through 11440):

passing variable in include
        11419 by: Sandeep Murphy
        11420 by: Pac mon

passing variables
        11421 by: Sandeep Murphy
        11422 by: Nicole Amashta
        11423 by: Pac mon
        11430 by: Sandeep Murphy
        11431 by: Svensson, B.A.T. (HKG)

Unique id Number
        11424 by: James Mansfield
        11425 by: Asendorf, John
        11426 by: Ross Fleming
        11427 by: Piotr Pluciennik
        11429 by: Svensson, B.A.T. (HKG)
        11437 by: Manuel Lemos

Header problem
        11428 by: Petr Rezek

php_gd.dll 1.8.4
        11432 by: John Moeller

php_gd.dll
        11433 by: John Moeller

Please help a newbie -- have pity!
        11434 by: tom
        11435 by: Frank M. Kromann

can you help me with this php error?
        11436 by: JR

sending an array through post
        11438 by: Polleke
        11439 by: Afan Pasalic

cant read php.ini
        11440 by: Adrian Kelland

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---


hi all,

I have a variable in a file called xmlparse.php called $data. $data stores
in it an output returned by another php script..

I need to pass this variable $data now into yet another php file say new.php
..

xmlparse.php

$data = "blah blah";

----------------------------------------------------------------------------
----
new.php

include('xmlparse.php')

$sign = "$data";

echo "$sign";

But my echo "$sign";  is NOT printing anything.. Whats wrong here??

TIA,
sands 

--- End Message ---
--- Begin Message ---
Just do this: $sign = $data;


>new.php
>
>include('xmlparse.php')
>
>$sign = "$data";
>
>echo "$sign";
>
>But my echo "$sign";  is NOT printing anything.. Whats wrong here??
>
>TIA,
>sands
>


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---

hi all,

I have a variable in a file called xmlparse.php called $data. $data stores
in it an output returned by another php script..

I need to pass this variable $data now into yet another php file say new.php
..

xmlparse.php

$data = "blah blah";

----------------------------------------------------------------------------
----
new.php

include('xmlparse.php')

$sign = "$data";

echo "$sign";

But my echo "$sign";  is NOT printing anything.. Whats wrong here??

TIA,
--- End Message ---
--- Begin Message ---
when you call the 2nd script, new.php, call it like this:

new.php?sign=$data

that is one way to pass it ... or you can keep the variable hidden by using
sessions

1. xmlparse.php
-------------------------------
session_start();     // start a session
session_register("data"); // register 'data' as a session var
$data = "whatever";        // assign a value
---------------------------------

2. now going on to the next script:  new.php
---------------------------------
session_start(); // start a session

$sign = $data; // $data should already have the value previously assigned;
since it's in session, the value carries over

echo $sign;  // should display "whatever"
-------------------------------------------

try that.
also, you can try doing this in your original example:

<snip>
 new.php

 include('xmlparse.php')

 global $data;           // add this line; do a "global" to make sure you
grab the $data var

 $sign = "$data";

 echo "$sign";
</snip>

Goodluck!
Nicole Amashta
www.aeontrek.com
========================
"Sandeep Murphy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> hi all,
>
> I have a variable in a file called xmlparse.php called $data. $data stores
> in it an output returned by another php script..
>
> I need to pass this variable $data now into yet another php file say
new.php
> ..
>
> xmlparse.php
>
> $data = "blah blah";
>
> --------------------------------------------------------------------------
--
> ----
> new.php
>
> include('xmlparse.php')
>
> $sign = "$data";
>
> echo "$sign";
>
> But my echo "$sign";  is NOT printing anything.. Whats wrong here??
>
> TIA,


--- End Message ---
--- Begin Message ---
There is NO need for that... When including a file it's as if the file were 
inline with the code in the spot in which include() is called. You may want 
to use require() to make sure that the file is actually being added. Also 
you just need to use $data wherever you want.. Or you can do it like this: 
$sign = $data;

>
>when you call the 2nd script, new.php, call it like this:
>
>new.php?sign=$data
>
>that is one way to pass it ... or you can keep the variable hidden by using
>sessions
>
>1. xmlparse.php
>-------------------------------
>session_start();     // start a session
>session_register("data"); // register 'data' as a session var
>$data = "whatever";        // assign a value
>---------------------------------
>
>2. now going on to the next script:  new.php
>---------------------------------
>session_start(); // start a session
>
>$sign = $data; // $data should already have the value previously assigned;
>since it's in session, the value carries over
>
>echo $sign;  // should display "whatever"
>-------------------------------------------
>
>try that.
>also, you can try doing this in your original example:
>
><snip>
>  new.php
>
>  include('xmlparse.php')
>
>  global $data;           // add this line; do a "global" to make sure you
>grab the $data var
>
>  $sign = "$data";
>
>  echo "$sign";
></snip>
>
>Goodluck!
>Nicole Amashta
>www.aeontrek.com
>========================
>"Sandeep Murphy" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > hi all,
> >
> > I have a variable in a file called xmlparse.php called $data. $data 
>stores
> > in it an output returned by another php script..
> >
> > I need to pass this variable $data now into yet another php file say
>new.php
> > ..
> >
> > xmlparse.php
> >
> > $data = "blah blah";
> >
> > 
>--------------------------------------------------------------------------
>--
> > ----
> > new.php
> >
> > include('xmlparse.php')
> >
> > $sign = "$data";
> >
> > echo "$sign";
> >
> > But my echo "$sign";  is NOT printing anything.. Whats wrong here??
> >
> > TIA,
>
>
>
>--
>PHP Windows 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]
>


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--- End Message ---
--- Begin Message ---
hi,

Thnx to all of you... Actually I realized that my problem is slightly more
different and complicated..

The xml output is actually received from a servlet (sorry for saying php
before!:)) and Needs to be directly passed into another PHP which contains
an XMLparser...

The data has to be dynamically fed into the parser... I am trying to make
the parser into a form of a class with a function that receives this
variable but so far Unsuccessful..

If anyone has any further suggestions/ideas, wud be damn gratefull!!

I can post the parser here if needed...


TIA,
sands

-----Original Message-----
From: Pac mon [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 14 de Janeiro de 2002 14:48
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Re: passing variables


There is NO need for that... When including a file it's as if the file were 
inline with the code in the spot in which include() is called. You may want 
to use require() to make sure that the file is actually being added. Also 
you just need to use $data wherever you want.. Or you can do it like this: 
$sign = $data;

>
>when you call the 2nd script, new.php, call it like this:
>
>new.php?sign=$data
>
>that is one way to pass it ... or you can keep the variable hidden by using
>sessions
>
>1. xmlparse.php
>-------------------------------
>session_start();     // start a session
>session_register("data"); // register 'data' as a session var
>$data = "whatever";        // assign a value
>---------------------------------
>
>2. now going on to the next script:  new.php
>---------------------------------
>session_start(); // start a session
>
>$sign = $data; // $data should already have the value previously assigned;
>since it's in session, the value carries over
>
>echo $sign;  // should display "whatever"
>-------------------------------------------
>
>try that.
>also, you can try doing this in your original example:
>
><snip>
>  new.php
>
>  include('xmlparse.php')
>
>  global $data;           // add this line; do a "global" to make sure you
>grab the $data var
>
>  $sign = "$data";
>
>  echo "$sign";
></snip>
>
>Goodluck!
>Nicole Amashta
>www.aeontrek.com
>========================
>"Sandeep Murphy" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > hi all,
> >
> > I have a variable in a file called xmlparse.php called $data. $data 
>stores
> > in it an output returned by another php script..
> >
> > I need to pass this variable $data now into yet another php file say
>new.php
> > ..
> >
> > xmlparse.php
> >
> > $data = "blah blah";
> >
> > 
>--------------------------------------------------------------------------
>--
> > ----
> > new.php
> >
> > include('xmlparse.php')
> >
> > $sign = "$data";
> >
> > echo "$sign";
> >
> > But my echo "$sign";  is NOT printing anything.. Whats wrong here??
> >
> > TIA,
>
>
>
>--
>PHP Windows 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]
>


_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


-- 
PHP Windows 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]
--- End Message ---
--- Begin Message ---
>The data has to be dynamically fed into the parser... I am trying to make
>the parser into a form of a class with a function that receives this
>variable but so far Unsuccessful..

Just keep up that happy debugging spirit... :)

>If anyone has any further suggestions/ideas, wud be damn gratefull!!

My jeeze thats a complex topic! It would requires a small novell to be
written.

But I would like to recommend you to study some literature on database
transaction, recovery and concurrency control, if good, they will even cover
how to counter or avoid these problems.
--- End Message ---
--- Begin Message ---
OK...newbie question it must be:
I want to add an entry into a db tb (using php obviously) and when its added
into the db its gets a sequencially numberred id....now can I retrieve this
id numbe rin the same php coded page as what I create the entry with? If not
what is the best way around it? Create a unique number for the entry before
adding it into db??


--- End Message ---
--- Begin Message ---
You can, but there are a number of issues to deal with.  One of the
potential solutions is to grab the MAX value from the table id field and
then increment that number for the next inserted record.  The problem arises
though when you have multiple users attempting to add records...

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


> -----Original Message-----
> From: James Mansfield [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 14, 2002 10:48 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Unique id Number
> 
> 
> OK...newbie question it must be:
> I want to add an entry into a db tb (using php obviously) and 
> when its added
> into the db its gets a sequencially numberred id....now can I 
> retrieve this
> id numbe rin the same php coded page as what I create the 
> entry with? If not
> what is the best way around it? Create a unique number for 
> the entry before
> adding it into db??
> 
> 
> 
> -- 
> PHP Windows 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]
> 
--- End Message ---
--- Begin Message ---
That's what I originally did but it can create loads of problems if you
remove entries from the database or something similar.

Is it SQL you're using?  If so then i BELIEVE that there is a way of
defining a field to do this automatically, instead of calling a field
'int' or whatever, I remember there being a 'counter' attribute or
something similar.  Can't remember it offhand just now.  Does anyone
else here know what it's called?

Ross


James Mansfield wrote:
> 
> OK...newbie question it must be:
> I want to add an entry into a db tb (using php obviously) and when its added
> into the db its gets a sequencially numberred id....now can I retrieve this
> id numbe rin the same php coded page as what I create the entry with? If not
> what is the best way around it? Create a unique number for the entry before
> adding it into db??
> 
> --
> PHP Windows 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]
--- End Message ---
--- Begin Message ---
Hi,

yes, you can. If you're using MySQL try to use
mysql_insert_id function - it should solve your
problem.

For more explanations and examples - see manual:
http://www.php.net/manual/en/function.mysql-insert-id.php
and for all mysql functions:
http://www.php.net/manual/en/ref.mysql.php

Greetings

Piotr



 --- James Mansfield <[EMAIL PROTECTED]> wrote: >
OK...newbie question it must be:
> I want to add an entry into a db tb (using php
> obviously) and when its added
> into the db its gets a sequencially numberred
> id....now can I retrieve this
> id numbe rin the same php coded page as what I
> create the entry with? If not
> what is the best way around it? Create a unique
> number for the entry before
> adding it into db??
> 
> 
> 
> -- 
> PHP Windows 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]
>  


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--- End Message ---
--- Begin Message ---
From: Asendorf, John
Sent: Monday, January 14, 2002 4:49 PM

>You can, but there are a number of issues to deal with.  One of the
>potential solutions is to grab the MAX value from the table id field and
>then increment that number for the next inserted record.  The problem
arises
>though when you have multiple users attempting to add records...

Concurrency and update anomalies problems in the DB environment has to be
dealt with independently of auto-incremental values. These types of problems
will always arise, and thus has to be considered if they might constitute a
problem.
--- End Message ---
--- Begin Message ---
Hello,

James Mansfield wrote:
> 
> OK...newbie question it must be:
> I want to add an entry into a db tb (using php obviously) and when its added
> into the db its gets a sequencially numberred id....now can I retrieve this
> id numbe rin the same php coded page as what I create the entry with? If not
> what is the best way around it? Create a unique number for the entry before
> adding it into db??

That depends on the database you are using. You need to use sequences.
Some database do not have sequences but they do have auto-incremented
fields, so it is possible to emulate a sequence object with a separate
table with a single auto-incremented field to act as a sequence.

Regardless of what database you are using, you may want to try Metabase
which is a PHP database abstraction package that supports many databases
and abstracts the concept of sequences just like I described. Metabase
is free and is available from here:

http://phpclasses.upperdesign.com/browse.html/package/20

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
Here is my question.
I wrote a script, which gets parameters from db about document (location on
disc, hashed filename and original filename). Then script open this file a
send it to user.

I use this headers

Header("Content-Type: application/download\n");
Header("Content-Disposition: attachment;filename=\"name_of_file\"");
Header("Content-Transfer-Encoding: binary");

On Windows it works good, but on Mac it doesn't accept name_of_file and try
save this file with name of script.
What is wrong ? Do you have any idea ??

If I used:
Header("Content-Disposition: filename=\"jmeno_souboru\"");
then this script doesn't work also on Windows with Mozilla. Is there any
error in MSIE on Mac, isn't it ?

Thank you for any idea
Petr




--- End Message ---
--- Begin Message ---
Where can I find a 1.8.4 version of php_gd.dll?

John
--- End Message ---
--- Begin Message ---
Where can I find a 1.8.4 version of php_gd.dll?

John
--- End Message ---
--- Begin Message ---
Can someone tell me how to use this php.exe file?? The docs are totally
confusing.

Okay - I run a rented unix server that supports php, no problem. But I want
to test my site files offline on my win 2k machine. Online IE displays the
php test files just fine, but offline it ignores the php content entirely. I
want to browse to d:\test.php, for instance -- without using the w2k server
stuff, just browse to file.

I thought the php download of windows binaries was supposed to fix this, but
I can't get it to do anything.

Tom



--- End Message ---
--- Begin Message ---
Using the prowser to view a file on your file system will just show the content. The 
browser does not have any knowledge of the PHP parser.

A web server on the other hand will be able to run the requested script through a 
parser an send the converted document (usually as html) to the browser fopr display.

The binary version of PHP on Win32 works fine with IIS, Apache and other web servers 
available on that platform.

- Frank

> Can someone tell me how to use this php.exe file?? The docs are totally
> confusing.
> 
> Okay - I run a rented unix server that supports php, no problem. But I want
> to test my site files offline on my win 2k machine. Online IE displays the
> php test files just fine, but offline it ignores the php content entirely. I
> want to browse to d:\test.php, for instance -- without using the w2k server
> stuff, just browse to file.
> 
> I thought the php download of windows binaries was supposed to fix this, but
> I can't get it to do anything.
> 
> Tom
> 
> 
> 
> 
> -- 
> PHP Windows 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]
> 
> 



--- End Message ---
--- Begin Message ---
Can you help me setup php on my local machine? I ran into a problem trying to execute 
php files on my machine. 

I followed the directions for setting up php on Windows XP with IIS from php.net's 
installation instructions. I ran into one of the problems described in php.net FAQ but 
I don't understand how to fix the problems. I highlighted the parts I don't understand 
how to fix in bold font and underlined it. I was wondering if you could help me? 
9. Windows: I have installed PHP, but when I to access a PHP script file via my 
browser, I get the error: cgi error:
 The specified CGI application misbehaved by not
 returning a complete set of HTTP headers.
 The headers it did return are:
     


This error message means that PHP failed to output anything at all. To get to see a 
sensible error message, from the command line, change to the directory containing the 
PHP executable (php.exe on Windows) and run php -i. If PHP has any problems running, 
then a suitable error message will be displayed which will give you a clue as to what 
needs to be done next. If you get a screen full of html codes (the output of the 
phpinfo() function) then PHP is working. 

Once PHP is working at the command line, try accessing the script via the browser 
again. If it still fails then it could be one of the following: 


  a.. File permissions on your PHP script, php.exe, php4ts.dll, php.ini or any PHP 
extensions you are trying to load are such that the anonymous internet user 
ISUR_<machinename> cannot access them. 

  b.. The script file does not exist (or possibly isn't where you think it is relative 
to your web root directory). Note that for IIS you can trap this error by ticking the 
'check file exists' box when setting up the script mappings in the Internet Services 
Manager. If a script file does not exist then the server will return a 404 error 
instead. There is also the additional benefit that IIS will do any authentication 
required for you based on the NTLanMan permissions on your script file. 

Thanks,

                Jeff

--- End Message ---
--- Begin Message ---
Hello,
I need to send a lot of numbers with a form(post). How can I do that. I've tried just 
this:

<input type="text" value="<?php $myArray ?>">

But that won't work.

How then?
polleke
--- End Message ---
--- Begin Message ---
Try function implode of an array (to make a string from your array) before you send it 
through form and then explode that string into array

Afan



  ----- Original Message ----- 
  From: Polleke 
  To: [EMAIL PROTECTED] 
  Sent: Monday, January 14, 2002 3:15 PM
  Subject: [PHP-WIN] sending an array through post


  Hello,
  I need to send a lot of numbers with a form(post). How can I do that. I've tried 
just this:

  <input type="text" value="<?php $myArray ?>">

  But that won't work.

  How then?
  polleke

--- End Message ---
--- Begin Message ---
PHP is working fine on an NT4 Terminal Server except for mail functions. I
have entered the correct settings in the php.ini file. These were tested OK
in a script. The problems seems to be that the php.ini file is not being
read. phpinfo() expects it to be in c:\winnt, so I put it there instead of
c:\wtsrv. Still no joy. Any ideas


--- End Message ---

Reply via email to