php-general Digest 8 Feb 2009 01:24:58 -0000 Issue 5946
Topics (messages 287891 through 287914):
Re: move_uploaded_file() problem
287891 by: DuÅ¡an NovakoviÄ
287892 by: Alpár Török
287893 by: DuÅ¡an NovakoviÄ
287895 by: Chris
287896 by: Carlos Medina
287897 by: Ashley Sheridan
287899 by: Alpár Török
287900 by: German Geek
Re: Session variables
287894 by: Nathan Rixham
Re: Email configuration
287898 by: Ashley Sheridan
Re: Some kind of Popup
287901 by: Patrick Moloney
287902 by: Ashley Sheridan
287903 by: Phpster
287904 by: Patrick Moloney
287905 by: Ashley Sheridan
Marketing Job Openings Available
287906 by: Nandy Edwards
Adding Records & Capture The New Record ID
287907 by: revDAVE
287908 by: Stuart
287910 by: revDAVE
287911 by: Stuart
287912 by: tedd
287914 by: Ashley Sheridan
Sending XML requests as raw post data
287909 by: Marc Steinert
287913 by: Alpár Török
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hi,
I'm having problem with function move_uploaded_file() under Linux
(Slackware 12.2). It simply won't execute only that function in php
file. So maybe I should add something to http.config file or .... ? I
tried to execute that php file under Windows and it's working just
fine (I've copied whole project to xampp's htdocs folder and run it
normally).
And also I have question, does anyone knows how to configure apache
(also under same Linux) so that in future I wouldn't have to write
<?php but only <? every time I start php code?
Thnx, Dusan
On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković <ndu...@gmail.com> wrote:
> Hi,
>
> I'm having problem with function move_uploaded_file() under Linux
> (Slackware 12.2). It simply want execute only that function in php
> file. So maybe I should add something to http.config file or .... ? I
> tried to execute that php file under Windows and it's working just
> fine (I've copied whole project to xampp's htdocs folder and run it
> normally).
>
> And also I have question, does anyone knows how to configure apache
> (also under same Linux) so that in future I wouldn't have to write
> <?php but only <? every time I start php code?
>
> Thnx, Dusan
>
> --
> made by Dusan
>
--
made by Dusan
--- End Message ---
--- Begin Message ---
2009/2/7 Dušan Novaković <ndu...@gmail.com>
> Hi,
>
> I'm having problem with function move_uploaded_file() under Linux
> (Slackware 12.2). It simply won't execute only that function in php
> file. So maybe I should add something to http.config file or .... ? I
> tried to execute that php file under Windows and it's working just
> fine (I've copied whole project to xampp's htdocs folder and run it
> normally).
>
Can you show some code?
>
>
> And also I have question, does anyone knows how to configure apache
> (also under same Linux) so that in future I woul
>
dn't have to write
> <?php but only <? every time I start php code?
>
You need to change the enable_short_tags directive. It is probably more
simple to do it in the php.ini configuration file and not in the apache
configuration file, but you should know that short tags are off by default
because they conflict with xml.
>
> Thnx, Dusan
>
> On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković <ndu...@gmail.com> wrote:
> > Hi,
> >
> > I'm having problem with function move_uploaded_file() under Linux
> > (Slackware 12.2). It simply want execute only that function in php
> > file. So maybe I should add something to http.config file or .... ? I
> > tried to execute that php file under Windows and it's working just
> > fine (I've copied whole project to xampp's htdocs folder and run it
> > normally).
> >
> > And also I have question, does anyone knows how to configure apache
> > (also under same Linux) so that in future I wouldn't have to write
> > <?php but only <? every time I start php code?
> >
> > Thnx, Dusan
> >
> > --
> > made by Dusan
> >
>
>
>
> --
> made by Dusan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Alpar Torok
--- End Message ---
--- Begin Message ---
On Sat, Feb 7, 2009 at 12:29 PM, Alpár Török <torokal...@gmail.com> wrote:
>
>
> 2009/2/7 Dušan Novaković <ndu...@gmail.com>
>>
>> Hi,
>>
>> I'm having problem with function move_uploaded_file() under Linux
>> (Slackware 12.2). It simply won't execute only that function in php
>> file. So maybe I should add something to http.config file or .... ? I
>> tried to execute that php file under Windows and it's working just
>> fine (I've copied whole project to xampp's htdocs folder and run it
>> normally).
>
> Can you show some code?
This is part where I use function move_uploaded_file()
if($_FILES['file']['name'] && $_FILES['file']['size']<550000){
$file_name =
"news_".$_FILES['file']['name'];
$image="../_img/news/".$file_name;
//Upload file
move_uploaded_file($_FILES['file']['tmp_name'], $image);
....
}
And normaly HTML code:
....
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post"
enctype="multipart/form-data" name="form" id="form">
...
<p><br>
Slika [max 500kB; formati: gif, jpg, jpeg]:
<input name="file" type="file" size="50" >
</p>
.....
>>
>>
>> And also I have question, does anyone knows how to configure apache
>> (also under same Linux) so that in future I woul
>>
>> dn't have to write
>> <?php but only <? every time I start php code?
>
> You need to change the enable_short_tags directive. It is probably more
> simple to do it in the php.ini configuration file and not in the apache
> configuration file, but you should know that short tags are off by default
> because they conflict with xml.
>>
>> Thnx, Dusan
>>
>> On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković <ndu...@gmail.com> wrote:
>> > Hi,
>> >
>> > I'm having problem with function move_uploaded_file() under Linux
>> > (Slackware 12.2). It simply want execute only that function in php
>> > file. So maybe I should add something to http.config file or .... ? I
>> > tried to execute that php file under Windows and it's working just
>> > fine (I've copied whole project to xampp's htdocs folder and run it
>> > normally).
>> >
>> > And also I have question, does anyone knows how to configure apache
>> > (also under same Linux) so that in future I wouldn't have to write
>> > <?php but only <? every time I start php code?
>> >
>> > Thnx, Dusan
>> >
>> > --
>> > made by Dusan
>> >
>>
>>
>>
>> --
>> made by Dusan
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
> --
> Alpar Torok
>
--
made by Dusan
--- End Message ---
--- Begin Message ---
if($_FILES['file']['name'] && $_FILES['file']['size']<550000){
$file_name =
"news_".$_FILES['file']['name'];
$image="../_img/news/".$file_name;
//Upload file
move_uploaded_file($_FILES['file']['tmp_name'], $image);
error_reporting(E_ALL);
ini_set('display_errors', true);
what does it show?
does it get this far in the code? Add an error_log or echo "line is " .
__LINE__ or something so you know for certain this is the problem.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Chris schrieb:
if($_FILES['file']['name'] && $_FILES['file']['size']<550000){
$file_name = "news_".$_FILES['file']['name'];
$image="../_img/news/".$file_name;
//Upload file
move_uploaded_file($_FILES['file']['tmp_name'], $image);
error_reporting(E_ALL);
ini_set('display_errors', true);
what does it show?
does it get this far in the code? Add an error_log or echo "line is " .
__LINE__ or something so you know for certain this is the problem.
Hallo,
please show in the php.net site the Method is
bool move_uploaded_file ( string $filename , string $destination )
String filename and destination are not right...
Carlos Medina
--- End Message ---
--- Begin Message ---
On Sat, 2009-02-07 at 14:03 +0100, Carlos Medina wrote:
> Chris schrieb:
> >
> >> if($_FILES['file']['name'] && $_FILES['file']['size']<550000){
> >>
> >> $file_name = "news_".$_FILES['file']['name'];
> >> $image="../_img/news/".$file_name;
> >> //Upload file
> >>
> >> move_uploaded_file($_FILES['file']['tmp_name'], $image);
> >
> > error_reporting(E_ALL);
> > ini_set('display_errors', true);
> >
> > what does it show?
> >
> > does it get this far in the code? Add an error_log or echo "line is " .
> > __LINE__ or something so you know for certain this is the problem.
> >
> Hallo,
> please show in the php.net site the Method is
>
> bool move_uploaded_file ( string $filename , string $destination )
>
> String filename and destination are not right...
>
> Carlos Medina
>
I've been using this function for years, it's definitely right. Are you
sure your strings are right? The should be absolute or relative paths to
the file. Usually you'd do something like this Chris showed you. Also,
as you're on a Linux system, make sure that the directory into which you
are trying to put the file has got the right permissions to allow Apache
to do this.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
2009/2/7 Dušan Novaković <ndu...@gmail.com>
> On Sat, Feb 7, 2009 at 12:29 PM, Alpár Török <torokal...@gmail.com> wrote:
> >
> >
> > 2009/2/7 Dušan Novaković <ndu...@gmail.com>
> >>
> >> Hi,
> >>
> >> I'm having problem with function move_uploaded_file() under Linux
> >> (Slackware 12.2). It simply won't execute only that function in php
> >> file. So maybe I should add something to http.config file or .... ? I
> >> tried to execute that php file under Windows and it's working just
> >> fine (I've copied whole project to xampp's htdocs folder and run it
> >> normally).
> >
> > Can you show some code?
>
> This is part where I use function move_uploaded_file()
>
> if($_FILES['file']['name'] && $_FILES['file']['size']<550000){
>
> $file_name =
> "news_".$_FILES['file']['name'];
>
> $image="../_img/news/".$file_name;
> //Upload file
>
> move_uploaded_file($_FILES['file']['tmp_name'], $image);
>
> ....
> }
>
>
> And normaly HTML code:
>
Make sure that the relative path resolves to what you think it does. Try to
make a test with a hard coded absolute path, and do an echo
realpath("../_img/news/$file_name"); to see the absolute path that it
resolves to. It might be that the function does indeed work, but places
files in annother folder than you expect it to.
>
>
> ....
> <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post"
> enctype="multipart/form-data" name="form" id="form">
>
> ...
>
> <p><br>
> Slika [max 500kB; formati: gif, jpg, jpeg]:
> <input name="file" type="file" size="50" >
> </p>
> .....
>
> >>
> >>
> >> And also I have question, does anyone knows how to configure apache
> >> (also under same Linux) so that in future I woul
> >>
> >> dn't have to write
> >> <?php but only <? every time I start php code?
> >
> > You need to change the enable_short_tags directive. It is probably more
> > simple to do it in the php.ini configuration file and not in the apache
> > configuration file, but you should know that short tags are off by
> default
> > because they conflict with xml.
> >>
> >> Thnx, Dusan
> >>
> >> On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković <ndu...@gmail.com>
> wrote:
> >> > Hi,
> >> >
> >> > I'm having problem with function move_uploaded_file() under Linux
> >> > (Slackware 12.2). It simply want execute only that function in php
> >> > file. So maybe I should add something to http.config file or .... ? I
> >> > tried to execute that php file under Windows and it's working just
> >> > fine (I've copied whole project to xampp's htdocs folder and run it
> >> > normally).
> >> >
> >> > And also I have question, does anyone knows how to configure apache
> >> > (also under same Linux) so that in future I wouldn't have to write
> >> > <?php but only <? every time I start php code?
> >> >
> >> > Thnx, Dusan
> >> >
> >> > --
> >> > made by Dusan
> >> >
> >>
> >>
> >>
> >> --
> >> made by Dusan
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
> >
> > --
> > Alpar Torok
> >
>
>
>
> --
> made by Dusan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Alpar Torok
--- End Message ---
--- Begin Message ---
make sure the permissions on the folders are right, so at least read for the
httpd in the tmp folder and write in the destination folder. since its
moving i would make them both writeable to the webserver daemon user.
permissions can be annoying are necessary though...
They caught me quite a few times now, so its one of the first things i would
check.
Tim-Hinnerk Heuer
http://www.ihostnz.com
Charles M. Schulz - "I love mankind; it's people I can't stand."
2009/2/8 Alpár Török <torokal...@gmail.com>
> 2009/2/7 Dušan Novaković <ndu...@gmail.com>
>
> > On Sat, Feb 7, 2009 at 12:29 PM, Alpár Török <torokal...@gmail.com>
> wrote:
> > >
> > >
> > > 2009/2/7 Dušan Novaković <ndu...@gmail.com>
> > >>
> > >> Hi,
> > >>
> > >> I'm having problem with function move_uploaded_file() under Linux
> > >> (Slackware 12.2). It simply won't execute only that function in php
> > >> file. So maybe I should add something to http.config file or .... ? I
> > >> tried to execute that php file under Windows and it's working just
> > >> fine (I've copied whole project to xampp's htdocs folder and run it
> > >> normally).
> > >
> > > Can you show some code?
> >
> > This is part where I use function move_uploaded_file()
> >
> > if($_FILES['file']['name'] && $_FILES['file']['size']<550000){
> >
> > $file_name =
> > "news_".$_FILES['file']['name'];
> >
> > $image="../_img/news/".$file_name;
> > //Upload file
> >
> > move_uploaded_file($_FILES['file']['tmp_name'], $image);
> >
> > ....
> > }
> >
> >
> > And normaly HTML code:
> >
> Make sure that the relative path resolves to what you think it does. Try to
> make a test with a hard coded absolute path, and do an echo
> realpath("../_img/news/$file_name"); to see the absolute path that it
> resolves to. It might be that the function does indeed work, but places
> files in annother folder than you expect it to.
>
> >
> >
> > ....
> > <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post"
> > enctype="multipart/form-data" name="form" id="form">
> >
> > ...
> >
> > <p><br>
> > Slika [max 500kB; formati: gif, jpg, jpeg]:
> > <input name="file" type="file" size="50" >
> > </p>
> > .....
> >
> > >>
> > >>
> > >> And also I have question, does anyone knows how to configure apache
> > >> (also under same Linux) so that in future I woul
> > >>
> > >> dn't have to write
> > >> <?php but only <? every time I start php code?
> > >
> > > You need to change the enable_short_tags directive. It is probably
> more
> > > simple to do it in the php.ini configuration file and not in the apache
> > > configuration file, but you should know that short tags are off by
> > default
> > > because they conflict with xml.
> > >>
> > >> Thnx, Dusan
> > >>
> > >> On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković <ndu...@gmail.com>
> > wrote:
> > >> > Hi,
> > >> >
> > >> > I'm having problem with function move_uploaded_file() under Linux
> > >> > (Slackware 12.2). It simply want execute only that function in php
> > >> > file. So maybe I should add something to http.config file or .... ?
> I
> > >> > tried to execute that php file under Windows and it's working just
> > >> > fine (I've copied whole project to xampp's htdocs folder and run it
> > >> > normally).
> > >> >
> > >> > And also I have question, does anyone knows how to configure apache
> > >> > (also under same Linux) so that in future I wouldn't have to write
> > >> > <?php but only <? every time I start php code?
> > >> >
> > >> > Thnx, Dusan
> > >> >
> > >> > --
> > >> > made by Dusan
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> made by Dusan
> > >>
> > >> --
> > >> PHP General Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >
> > >
> > >
> > > --
> > > Alpar Torok
> > >
> >
> >
> >
> > --
> > made by Dusan
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Alpar Torok
>
--- End Message ---
--- Begin Message ---
Paul M Foster wrote:
I'm not too clear on HTTP headers, cookies, and such. So here are
questions related to that. Let's say I generate a random number that I
want the user to enter in a form. When I generate the number, I store it
in a session variable ($_SESSION). When the user submits the form, I
check the number they enter with what I've stored in the session
variable.
Since this session variable survives across page loads (assuming
session_start() is appropriately called), how is it stored and recalled?
Is it automatically stored as a cookie on the user's system?
Or is it stored on the server?
And how does a server "get" a cookie?
Is it a separate request made by the server to the client?
If the value I've asked the user for is *not* stored as a cookie, then
is it passed as part of the HTTP submission or what?
Thanks for any enlightenment on this.
Paul
seeing as you're a voomer here's a very mini explanation
session has an id
a:
session id is passed to a user in the http headers
users client gets sessionid and stores it in a cookie
users client sends cookie with sessionid in it back to website every
page load
b:
on the server a small file is stored in a temp directory containing all
the stuff you've stored in session
the file is named with the session id
when php recieves a request, with a cookie, with a session id in it,
then it grabs the related server side session files, pulls the variables
from it an makes them available to you in $_SESSION.
v simple :p
--- End Message ---
--- Begin Message ---
On Sat, 2009-02-07 at 01:58 +0000, Nathan Rixham wrote:
> Shawn McKenzie wrote:
> > Nathan Rixham wrote:
> >> Shawn McKenzie wrote:
> >>> Ever heard of RBL or DNSBL? I use it on my email server and so do many
> >> lol snap, just sent same message at same time - tis so easy to jump on
> >> ash's back cos he's always so sure he's right lolol
> >
> > Hmmm... So Ashley is a "him"?
> >
>
> yeah quot:
> "Actually I'm a guy, but we can't all be perfect ;)"
> http://www.mail-archive.com/php-gene...@lists.php.net/msg235765.html
>
> dunno why I insist on winding him up either, he's pretty sound lol
>
Thanks!
And yes, I just checked this morning, and I am still a guy! Bloody
Americans cannibalising the spelling of it for their girls!
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote:
Yeti wrote:
Another JavaScript method would be to load the content in a hidden div
with position: absolute.
I think that's what I was considering doing with CSS except it would be
labels only in the content. I only wanted to retrieve the data record
from mysql if the user asked for the specs.
One issue is I don't want to leave the space available on my regular web
page and would like to try not to overwrite something there - I'd rather
have a separate window of some sort that sort of floats over the web page.
The best way to have the popup work, even with popup blockers is to have
a link like this:
<a href="details.php?id=1" target="details" onclick="window.open('about:
blank', 'details','width=300,height=200');">More Details</a>
The onclick handler is called before the link is actioned, and it opens
a new window with your settings, called 'details'. When that is
finished, the browser continues actioning the link, looks to find the
window/frame called 'details', finds one, and uses it. This way, even if
a user has scripting turned off, the link still works and opens in a new
window.
Ash
www.ashleysheridan.co.uk
Ashley,
Thanks, I finally worked on the popup you suggested. That is the closest
to what I am looking for. I'm sure there are some other settings that
could be useful. For example, the popup window gets hidden behind the
primary web page if the user goes back there, and does not come back if
he clicks again.
But, my bigger question is this: Is this solution specific to MS
Windows. What would happen if someone were viewing the website using
Apple or Linus etc?
Here's hoping you see this.
Thanks,
Patrick
--- End Message ---
--- Begin Message ---
On Sat, 2009-02-07 at 09:06 -0500, Patrick Moloney wrote:
> Ashley Sheridan wrote:
> > On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote:
> >> Yeti wrote:
> >>> Another JavaScript method would be to load the content in a hidden div
> >>> with position: absolute.
> >> I think that's what I was considering doing with CSS except it would be
> >> labels only in the content. I only wanted to retrieve the data record
> >> from mysql if the user asked for the specs.
> >>
> >> One issue is I don't want to leave the space available on my regular web
> >> page and would like to try not to overwrite something there - I'd rather
> >> have a separate window of some sort that sort of floats over the web page.
> >>
> > The best way to have the popup work, even with popup blockers is to have
> > a link like this:
> >
> > <a href="details.php?id=1" target="details" onclick="window.open('about:
> > blank', 'details','width=300,height=200');">More Details</a>
> >
> > The onclick handler is called before the link is actioned, and it opens
> > a new window with your settings, called 'details'. When that is
> > finished, the browser continues actioning the link, looks to find the
> > window/frame called 'details', finds one, and uses it. This way, even if
> > a user has scripting turned off, the link still works and opens in a new
> > window.
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> >
>
> Ashley,
> Thanks, I finally worked on the popup you suggested. That is the closest
> to what I am looking for. I'm sure there are some other settings that
> could be useful. For example, the popup window gets hidden behind the
> primary web page if the user goes back there, and does not come back if
> he clicks again.
>
> But, my bigger question is this: Is this solution specific to MS
> Windows. What would happen if someone were viewing the website using
> Apple or Linus etc?
>
> Here's hoping you see this.
>
> Thanks,
> Patrick
>
I use Linux myself, and the Window does stay in the background if it's
already open. You could fix this by changing the onclick a bit:
<script language="javascript" type="text/javascript">
function details_popup()
{
detailsWin = window.open('about: blank',
'details','width=300,height=200');
detailsWin.focus();
}
</script>
<a href="details.php?id=1" target="details"
onclick="details_popup()">More Details</a>
I've not tested this, but it should allow your link to bring the window
to focus even if it is already open and in the background.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
No, it's a generic solution, should be pretty much the same across
browsers. Why not download more browsers and test?
I would also add a window.focus() to the body tag in the popup to
bring the window back on top when the user reclocks the link
<body onload='window.focus();'>
Bastien
Sent from my iPod
On Feb 7, 2009, at 9:06, Patrick Moloney <webpa...@gmail.com> wrote:
Ashley Sheridan wrote:
On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote:
Yeti wrote:
Another JavaScript method would be to load the content in a
hidden div
with position: absolute.
I think that's what I was considering doing with CSS except it
would be labels only in the content. I only wanted to retrieve the
data record from mysql if the user asked for the specs.
One issue is I don't want to leave the space available on my
regular web page and would like to try not to overwrite something
there - I'd rather have a separate window of some sort that sort
of floats over the web page.
The best way to have the popup work, even with popup blockers is to
have
a link like this:
<a href="details.php?id=1" target="details"
onclick="window.open('about:
blank', 'details','width=300,height=200');">More Details</a>
The onclick handler is called before the link is actioned, and it
opens
a new window with your settings, called 'details'. When that is
finished, the browser continues actioning the link, looks to find the
window/frame called 'details', finds one, and uses it. This way,
even if
a user has scripting turned off, the link still works and opens in
a new
window.
Ash
www.ashleysheridan.co.uk
Ashley,
Thanks, I finally worked on the popup you suggested. That is the
closest to what I am looking for. I'm sure there are some other
settings that could be useful. For example, the popup window gets
hidden behind the primary web page if the user goes back there, and
does not come back if he clicks again.
But, my bigger question is this: Is this solution specific to MS
Windows. What would happen if someone were viewing the website using
Apple or Linus etc?
Here's hoping you see this.
Thanks,
Patrick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Phpster wrote:
No, it's a generic solution, should be pretty much the same across
browsers. Why not download more browsers and test?
Thanks all, I thought this might get lost in history here.
It's not just different browsers, it's different operating systems -
Apple, Linux, more. I can't download those. Although I have thought
about setting up one dedicated machine just to test Linux on such things.
I thought the Window function(?) is probably part of MS Windows. Maybe
it's also implemented in Linux, possibly others just to be compatible.
I'll keep working on this with a little CSS and other options.
Thanks
--- End Message ---
--- Begin Message ---
On Sat, 2009-02-07 at 09:43 -0500, Patrick Moloney wrote:
> Phpster wrote:
> > No, it's a generic solution, should be pretty much the same across
> > browsers. Why not download more browsers and test?
> >
>
> Thanks all, I thought this might get lost in history here.
> It's not just different browsers, it's different operating systems -
> Apple, Linux, more. I can't download those. Although I have thought
> about setting up one dedicated machine just to test Linux on such things.
>
> I thought the Window function(?) is probably part of MS Windows. Maybe
> it's also implemented in Linux, possibly others just to be compatible.
> I'll keep working on this with a little CSS and other options.
> Thanks
>
Window doesn't refer to MS Windows, it's just the generic object for the
browser window, so anything that supports Javascript will support it!
There are a lot of browser-specific additions to Javascript, but the
code we've all shown here is all pretty generic.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hi,
We are recruiting motivated individuals for participating in well-paying
online surveys, focus groups and previewing movie trailers.
No experience is needed and the job is strictly online. All you need is a
little time to voice your opinion about different kinds of online products
and services, helping major business improve their online presence.
What we offer is work at your own pace and from any computer.
If you are interested, please reply to 1302pladson.murd...@gmail.com as soon as
places are limited.
Please excuse us if this email is unwanted for you and we have disturbed you in
some way, but this is a serious and sincere enquiry.
Best regards,
Betty Smith
HR Manager
--- End Message ---
--- Begin Message ---
Newbie question...
Hi folks,
Adding records & capture the new record ID:
In the past, if I added a new record from a form in a phonebook file as an
example, I would use a web form to fill out the info, and then add and
invisible text item that stored a random number in one of the unused
database fields.
Then, after I inserted the record - I would do a quick query that would
retrieve the record ID by searching for the random number
Q: is there a better way to retrieve the record ID from the newly added
record?
--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]
--- End Message ---
--- Begin Message ---
2009/2/7 revDAVE <c...@hosting4days.com>:
> Adding records & capture the new record ID:
>
> In the past, if I added a new record from a form in a phonebook file as an
> example, I would use a web form to fill out the info, and then add and
> invisible text item that stored a random number in one of the unused
> database fields.
>
> Then, after I inserted the record - I would do a quick query that would
> retrieve the record ID by searching for the random number
Ouch that's nasty!!
> Q: is there a better way to retrieve the record ID from the newly added
> record?
Use an auto_increment field then, assuming MySQL you can use
mysql_insert_id to get the ID of the last record inserted on a given
connection.
-Stuart
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On 2/7/2009 11:41 AM, "Stuart" <stut...@gmail.com> wrote:
>> Then, after I inserted the record - I would do a quick query that would
>> retrieve the record ID by searching for the random number
>
> Ouch that's nasty!!
>
>> Q: is there a better way to retrieve the record ID from the newly added
>> record?
>
> Use an auto_increment field then, assuming MySQL you can use
> mysql_insert_id to get the ID of the last record inserted on a given
> connection.
>
> -Stuart
Thanks Stuart - it works great - so much Less Nasty!
BTW: as long as - mysql_insert_id is right after the insert statement - is
it 100% accurate - (in that no other insert from another user could get in
the middle of this)?
--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]
--- End Message ---
--- Begin Message ---
2009/2/7 revDAVE <c...@hosting4days.com>:
> On 2/7/2009 11:41 AM, "Stuart" <stut...@gmail.com> wrote:
>
>>> Then, after I inserted the record - I would do a quick query that would
>>> retrieve the record ID by searching for the random number
>>
>> Ouch that's nasty!!
>>
>>> Q: is there a better way to retrieve the record ID from the newly added
>>> record?
>>
>> Use an auto_increment field then, assuming MySQL you can use
>> mysql_insert_id to get the ID of the last record inserted on a given
>> connection.
>>
>> -Stuart
>
> Thanks Stuart - it works great - so much Less Nasty!
>
> BTW: as long as - mysql_insert_id is right after the insert statement - is
> it 100% accurate - (in that no other insert from another user could get in
> the middle of this)?
Yes. As I stated, it returns the ID of the last record inserted on a
given connection.
-Stuart
--
http://stut.net/
--- End Message ---
--- Begin Message ---
At 12:12 PM -0800 2/7/09, revDAVE wrote:
On 2/7/2009 11:41 AM, "Stuart" <stut...@gmail.com> wrote:
Then, after I inserted the record - I would do a quick query that would
retrieve the record ID by searching for the random number
Ouch that's nasty!!
Q: is there a better way to retrieve the record ID from the newly added
record?
Use an auto_increment field then, assuming MySQL you can use
> mysql_insert_id to get the ID of the last record inserted on a given
connection.
-Stuart
Thanks Stuart - it works great - so much Less Nasty!
BTW: as long as - mysql_insert_id is right after the insert statement - is
it 100% accurate - (in that no other insert from another user could get in
the middle of this)?
That's one way, to use "mysql_insert_id" (probably the best).
But another is simply to read back in the record you just created and
check the $row['id']. That's the way I do it sometimes.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Sat, 2009-02-07 at 15:26 -0500, tedd wrote:
> At 12:12 PM -0800 2/7/09, revDAVE wrote:
> >On 2/7/2009 11:41 AM, "Stuart" <stut...@gmail.com> wrote:
> >
> >>> Then, after I inserted the record - I would do a quick query that would
> >>> retrieve the record ID by searching for the random number
> >>
> >> Ouch that's nasty!!
> >>
> >>> Q: is there a better way to retrieve the record ID from the newly added
> >>> record?
> >>
> >> Use an auto_increment field then, assuming MySQL you can use
> > > mysql_insert_id to get the ID of the last record inserted on a given
> >> connection.
> >>
> >> -Stuart
> >
> >Thanks Stuart - it works great - so much Less Nasty!
> >
> >BTW: as long as - mysql_insert_id is right after the insert statement - is
> >it 100% accurate - (in that no other insert from another user could get in
> >the middle of this)?
>
>
> That's one way, to use "mysql_insert_id" (probably the best).
>
> But another is simply to read back in the record you just created and
> check the $row['id']. That's the way I do it sometimes.
>
> Cheers,
>
> tedd
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
How do you plan on reading back the row if you don't use the
mysql_insert_id value? For most cases, it's not enough to read back the
values you just put in as they may be the same for some people.
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hi there!
The software I'm maintaining uses $HTTP_RAW_POST_DATA to receive XML requests, posted by some client
written in C#.
Now I need to write a PHP client that posts XML requests the same way as the C# client, so that the
posted data is stored in $HTTP_RAW_POST_DATA, too.
I tried to use curl to match my needs, but failed to establish a connection
with the following code:
$header[] = "Host: ".$host;
$header[] = "MIME-Version: 1.0";
$header[] = "Accept: text/xml";
$header[] = "Content-length: ".strlen($xmlRequest);
$header[] = "Cache-Control: no-cache";
$header[] = "Connection: close \r\n";
$header[] = $xmlRequest; // Contains the XML request
curl_setopt($curl, CURLOPT_URL,self::BASE_URL);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 4);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST,'POST');
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
// Dispatch request and read answer
$response = curl_exec($curl); // returns false
Thanks for your help.
Greetings from Germany
Marc
--
http://bithub.net/
Synchronize and share your files over the web for free
My Twitter feed
http://twitter.com/MarcSteinert
--- End Message ---
--- Begin Message ---
2009/2/7 Marc Steinert <li...@bithub.net>
> Hi there!
>
> The software I'm maintaining uses $HTTP_RAW_POST_DATA to receive XML
> requests, posted by some client written in C#.
> Now I need to write a PHP client that posts XML requests the same way as
> the C# client, so that the posted data is stored in $HTTP_RAW_POST_DATA,
> too.
>
> I tried to use curl to match my needs, but failed to establish a connection
> with the following code:
>
> $header[] = "Host: ".$host;
> $header[] = "MIME-Version: 1.0";
> $header[] = "Accept: text/xml";
> $header[] = "Content-length: ".strlen($xmlRequest);
> $header[] = "Cache-Control: no-cache";
> $header[] = "Connection: close \r\n";
> $header[] = $xmlRequest; // Contains the XML request
>
> curl_setopt($curl, CURLOPT_URL,self::BASE_URL);
> curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($curl, CURLOPT_TIMEOUT, 4);
> curl_setopt($curl, CURLOPT_CUSTOMREQUEST,'POST');
> curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
>
> // Dispatch request and read answer
> $response = curl_exec($curl); // returns false
>
>
> Thanks for your help.
>
> Greetings from Germany
>
> Marc
>
> --
> http://bithub.net/
> Synchronize and share your files over the web for free
>
>
> My Twitter feed
> http://twitter.com/MarcSteinert
>
> Take a look at the free, open source php JSON-RPC at *jsonrpcphp*.org ,
in the client you will find a very good example of what you need. (Sorry no
time to provide it directly)
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Alpar Torok
--- End Message ---