|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 19 Dec 2003 03:22:41 -0000 Issue 2481
php-general-digest-help
lists.php.net
Date: Thu Dec 18 2003 - 21:22:41 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 19 Dec 2003 03:22:41 -0000 Issue 2481
Topics (messages 172952 through 172993):
Security Question
172952 by: Thomas Andersen
172953 by: Jas
172955 by: David Otton
Re: Countries, cities, states database
172954 by: Chris Shiflett
Post New Email to Website?
172956 by: djinn.darkdesigns.org
172958 by: Raditha Dissanayake
Re: CLI question
172957 by: Ford, Mike [LSS]
PHP Template Function
172959 by: Cameron B. Prince
Help with php output to file
172960 by: Paul Godard
172961 by: Sam Masiello
172962 by: Justin Patrin
172963 by: Justin Patrin
172972 by: Luke
Re: fopen does not open URL-files
172964 by: Eric Bolikowski
Manage link.
172965 by: Vincent M.
172966 by: Evan Nemerson
172983 by: Vincent M.
MySQL newsgroup
172967 by: JLake
172970 by: Sam Masiello
172971 by: JLake
172975 by: Website Managers.net
Re: Links of Tables from other DB
172968 by: Blake Schroeder
Re: File upload problem
172969 by: Blake Schroeder
PHP 4.3.4 configure
172973 by: Bernard C. Saulter
Script timeout Problem
172974 by: Haseeb Iqbal
172976 by: Jas
172980 by: Jas
172987 by: Haseeb Iqbal
picking up a form name
172977 by: php
172978 by: David T-G
172979 by: Jas
172981 by: Website Managers.net
Re: Update issue - more then likely simple problem
172982 by: Eric Holmstrom
Re: Comparison between Postnuke and PHPnuke
172984 by: Malcolm
copy function
172985 by: Omar
172986 by: Luke
Best way to store data.
172988 by: Philip J. Newman
172989 by: Thomas Andersen
172993 by: Justin French
Changing languages
172990 by: Cesar Aracena
$_POST[]
172991 by: Philip J. Newman
172992 by: Martin Towell
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hello,
I'm trying to develop a secure web based application and my only tools are
php, mysql, and a SSL connection.
Does anyone know of any good references for this kind of development?
What I really need to do is to make sure that given users only gain access
to the parts of the application they are given rights to. I'm not sure if I
need to pass their user information along from page to page or if I should
set a cookie or whatever else would be appropriate. I also want people to
be bounced back to the login page if they enter a direct URL to part of the
application without logging in first, and I also want people to be able to
log out.
Thanks,
Thomas Andersen
attached mail follows:
Does your php.ini have Globals set to off?
Was your php installation compiled with session support?
If your answer to both of those questions is yes (you can check your
server config with a page containing this string <?php phpinfo(); ?>)
Then use session to register a variable such as the example below...
<?php
if (!empty($_SESSION['auth'])) { //where auth is a flag of yes or no
// let user into page
} elseif (empty($_SESSION['auth'])) {
header("Location: login.html"); // where login.html is your login form
} else {
exit(); }// catch all
?>
Then say on your authentication module you do something like this
<?php
function authentication() {
if (!empty($_POST['username'])) && (!empty($_POST['password'])) {
// some code to check if username and password variables match database
entries or file containing credentials
// if a match is found do the rest of the code
session_start();
$_SESSION['auth'] = base64_encode(1); //encoded var to deter session
hijacking
} else {
header("location: login.html"); }
?>
Hope this helps a bit... more info on stuff like this is available at
google.com. =)
Jas
Thomas Andersen wrote:
> Hello,
>
> I'm trying to develop a secure web based application and my only tools are
> php, mysql, and a SSL connection.
>
> Does anyone know of any good references for this kind of development?
>
> What I really need to do is to make sure that given users only gain access
> to the parts of the application they are given rights to. I'm not sure if I
> need to pass their user information along from page to page or if I should
> set a cookie or whatever else would be appropriate. I also want people to
> be bounced back to the login page if they enter a direct URL to part of the
> application without logging in first, and I also want people to be able to
> log out.
>
> Thanks,
> Thomas Andersen
attached mail follows:
On Thu, 18 Dec 2003 10:43:14 -0500, you wrote:
>I'm trying to develop a secure web based application and my only tools are
>php, mysql, and a SSL connection.
>
>Does anyone know of any good references for this kind of development?
>
>What I really need to do is to make sure that given users only gain access
>to the parts of the application they are given rights to. I'm not sure if I
>need to pass their user information along from page to page or if I should
>set a cookie or whatever else would be appropriate.
Read up about sessions. Essentially, a session is a random token which is
sent to the client (normally as a cookie), and is associated with a
collection of data server-side.
You can safely store sensitive data (userids, privilege levels, etc) in the
session because they never leave the server.
http://www.php.net/manual/en/ref.session.php
>I also want people to
>be bounced back to the login page if they enter a direct URL to part of the
>application without logging in first, and I also want people to be able to
>log out.
include() a file at the top of every page that checks for the existence of a
valid session. If no session is present, use header("Location:") to bounce
the user back to the login page and exit().
attached mail follows:
--- Augusto Cesar Castoldi <accastoldi
yahoo.com.br> wrote:
> I searching for a database, with the 'complete' world
> Countries, cities, states
I like GeoIP:
http://www.maxmind.com/
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
Hello. I'm a new PHP user and unfamiliar with the terminology, so if I sound like I don't know what I'm talking about, I don't. :)
I do a website for a club I belong to and would like to post the Subjects of new emails to our Announcements email list on the website. Instead of manually adding the subjects to the website, I thought there might be a way to automate it. If anyone could point me to a script that can check an email list for new messages and then include part of that message into a website, I would really appreciate it.
Jean Peterson
attached mail follows:
Exact mechanism of how this is done depends on what your mail server is..
You can usually pipe an incoming mail message to an executable programs
(this is anyway done by the MTA) in your case the executable can simply
be a php script that makes use of a suitable mime decoder (you will find
several in hotscripts,sourceforge,php classes etc) which decodes the
mail messages and inserts the subject line into a database or any other
storage mechanism.
djinn
darkdesigns.org wrote:
> Hello. I'm a new PHP user and unfamiliar with the terminology, so if I sound like I don't know what I'm talking about, I don't. :)
>
>I do a website for a club I belong to and would like to post the Subjects of new emails to our Announcements email list on the website. Instead of manually adding the subjects to the website, I thought there might be a way to automate it. If anyone could point me to a script that can check an email list for new messages and then include part of that message into a website, I would really appreciate it.
>
>Jean Peterson
>
>
>
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
attached mail follows:
On 18 December 2003 14:48, Rodney Green wrote:
> Ford, Mike [LSS] wrote:
>
> > Shouldn't that be *don't* use output buffering and...? The
> flush() function has nothing to do with output buffering, and
> if output buffering is on you will need ob_flush() as well.
> >
> > Another (and probably better) solution is to create a
> php-cli.ini file, which will be picked up only by your CLI
> version, and put
> >
> > output_buffering = Off
> > implicit_flush = On
> >
> > in it. (Implicit flushing is usually expensive and
> inappropriate when generating Web pages, but usually exactly
> what you want when running from the command line.)
> >
> > Cheers!
> >
> > Mike
> >
> Thanks Jay and Mike..
>
> Mike.. how does the CLI version of PHP know to use the new ini file?
Because it's there! (And it's called php-cli.ini.)
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Hello,
I have just been assigned to a project to convert a large static site to
PHP. I have used PHP for small jobs in the past, but most of my work has
been with Perl. One feature I've used and liked very much was provided by a
package called Embperl. In particular, Embperl::Object, which allows you to
build object-oriented (OO) websites using HTML components which implement
inheritance via subdirectories.
http://perl.apache.org/embperl/pod/doc/EmbperlObject.-page-2-.htm
Basically, a directory was defined within the webserver to have a
PerlHandler, Embperl::Object. When any page in or under that directory is
called, Embperl::Object would look for template files in the current
directory and go upward in the tree until they are found and prepend/append
them. There was no code or includes required within the pages themselves.
I want to do something similar with this new PHP implementation. I have
reviewed some template tutorials and looked at some of the Pear modules, but
none seem to work like this.
Can anyone give me some idea of if this is possible and how I might begin?
Any information would be greatly appreciated.
Thanks,
Cameron
attached mail follows:
Hi
I have develop an online catalog in php/mysql. Now the client needs
the web site on a cd. Of course without php or mysql...
What is the fastes and easiest way to convert the only 2-3 dynamic
php pages into static html files?
Of course I could copy the html code generated by the php pages for
each product and save it as different product1.html product2.html ...
but that will take ages ... 2000 products in 2 languages.
Is there a way to redirect the output of php pages to a file instead
of to the screen? So I could create a simple php script that loop
for each product & languages to generate all the pages.
--
Kind regards, Paul.
Gondwana
Info
gondwanastudio.com
http://www.gondwanastudio.com
attached mail follows:
Anytime I need to do something similar to this I prefer to use "lynx
-source [[URL]] > [[output_file]]"
HTH!
--Sam
Paul Godard wrote:
> Hi
>
> I have develop an online catalog in php/mysql. Now the client needs
> the web site on a cd. Of course without php or mysql...
>
> What is the fastes and easiest way to convert the only 2-3 dynamic
> php pages into static html files?
>
> Of course I could copy the html code generated by the php pages for
> each product and save it as different product1.html product2.html ...
> but that will take ages ... 2000 products in 2 languages.
>
> Is there a way to redirect the output of php pages to a file instead
> of to the screen? So I could create a simple php script that loop
> for each product & languages to generate all the pages.
> --
>
> Kind regards, Paul.
>
> Gondwana
> Info
gondwanastudio.com
> http://www.gondwanastudio.com
attached mail follows:
Paul Godard wrote:
> Hi
>
> I have develop an online catalog in php/mysql. Now the client needs the
> web site on a cd. Of course without php or mysql...
>
> What is the fastes and easiest way to convert the only 2-3 dynamic php
> pages into static html files?
>
> Of course I could copy the html code generated by the php pages for each
> product and save it as different product1.html product2.html ... but
> that will take ages ... 2000 products in 2 languages.
>
> Is there a way to redirect the output of php pages to a file instead of
> to the screen? So I could create a simple php script that loop for each
> product & languages to generate all the pages.
Well, you could always use web site mirroring software to pull it all.
Such as "wget -m". It would pull the dynamically generated HTML and
store it all in files and change the links accordingly. Or you could use
something else such as WinHTTrack.
--
paperCrane <Justin Patrin>
attached mail follows:
Paul Godard wrote:
> Hi
>
> I have develop an online catalog in php/mysql. Now the client needs the
> web site on a cd. Of course without php or mysql...
>
> What is the fastes and easiest way to convert the only 2-3 dynamic php
> pages into static html files?
>
> Of course I could copy the html code generated by the php pages for each
> product and save it as different product1.html product2.html ... but
> that will take ages ... 2000 products in 2 languages.
>
> Is there a way to redirect the output of php pages to a file instead of
> to the screen? So I could create a simple php script that loop for each
> product & languages to generate all the pages.
Well, you could always use web site mirroring software to pull it all.
Such as "wget -m". It would pull the dynamically generated HTML and
store it all in files and change the links accordingly. Or you could use
something else such as WinHTTrack.
--
paperCrane <Justin Patrin>
attached mail follows:
what about output buffering and saving the output to a file instead of
flushing to the screen, that would work easy :)
Luke
--
Luke
"Paul Godard" <Paul
gondwanastudio.com> wrote in message
news:p06010211bc079d784124
[192.168.1.202]...
> Hi
>
> I have develop an online catalog in php/mysql. Now the client needs
> the web site on a cd. Of course without php or mysql...
>
> What is the fastes and easiest way to convert the only 2-3 dynamic
> php pages into static html files?
>
> Of course I could copy the html code generated by the php pages for
> each product and save it as different product1.html product2.html ...
> but that will take ages ... 2000 products in 2 languages.
>
> Is there a way to redirect the output of php pages to a file instead
> of to the screen? So I could create a simple php script that loop
> for each product & languages to generate all the pages.
> --
>
> Kind regards, Paul.
>
> Gondwana
> Info
gondwanastudio.com
> http://www.gondwanastudio.com
attached mail follows:
"Taras Panchenko" <pantaras
unicyb.kiev.ua> wrote in message
news:20031218100917.22872.qmail
pb1.pair.com...
> I have 2 questions:
> 1) why gethostbyname() does not resolve my host name into IP?
> 2) why fopen() (and file()) does not open an external (URL) file via http?
> Please, see my example below:
> ------------------
>
http://www.management.kiev.ua/try-test/fopen-test-http.php -----------------
> --
> <?
> echo gethostbyname("www.management.kiev.ua");
>
> $h=fopen("http://www.management.kiev.ua/MO/main.php", "r");
> echo fread($h,200);
> ?>
> --------------------- browser (interpreted) result -----------------------
> www.management.kiev.ua<br />
> <b>Warning</b>: fopen() [<a
> href='http://www.php.net/function.fopen'>function.fopen</a>]:
> php_network_getaddresses: getaddrinfo failed: No address associated with
> hostname in <b>/home/manageme/public_html/try-test/fopen-test-http.php</b>
> on line <b>4</b><br />
> <br />
> <b>Warning</b>: fopen(http://www.management.kiev.ua/MO/main.php) [<a
> href='http://www.php.net/function.fopen'>function.fopen</a>]: failed to
> create stream: Permission denied in
> <b>/home/manageme/public_html/try-test/fopen-test-http.php</b> on line
> <b>4</b><br />
> <br />
> <b>Warning</b>: fread(): supplied argument is not a valid stream resource
> in <b>/home/manageme/public_html/try-test/fopen-test-http.php</b> on line
> <b>5</b><br />
> -------------------- or as plain text ----------------------
> www.management.kiev.ua
> Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo
> failed: No address associated with hostname in
> /home/manageme/public_html/try-test/fopen-test-http.php on line 4
>
> Warning: fopen(http://www.management.kiev.ua/MO/main.php)
[function.fopen]:
> failed to create stream: Permission denied in
> /home/manageme/public_html/try-test/fopen-test-http.php on line 4
>
> Warning: fread(): supplied argument is not a valid stream resource in
> /home/manageme/public_html/try-test/fopen-test-http.php on line 5
> ------------------------------------
>
> Thanks a lot for help in advance,
> Taras V. Panchenko.
Try this rather(maybe it works):
<?php
$fp=fopen("http://www.management.kiev.ua/MO/main.php/", "r");
echo fread($fp,200);
?>
attached mail follows:
Hello,
Is there any way to manage links in an array and transform them.
For example, I have this text in the database:
---
Software & Support Media, produc-ers of the International PHP
Conference, are pleased to announce a new monthly version of their print
publication. For more information, you can go here: http://www.google.com
Thanks.
---
And transform this text to:
---
Software & Support Media, producers of the International PHP Conference,
are pleased to announce a new monthly version of their print
publication. For more information, you can go here: <a
href=\"http://www.google.com\">url</a>
Thanks.
--
Thanks,
Vincent.
attached mail follows:
On Thursday 18 December 2003 01:37 pm, Vincent M. wrote:
> Hello,
>
> Is there any way to manage links in an array and transform them.
> For example, I have this text in the database:
php.net/preg_replace
>
> ---
> Software & Support Media, produc-ers of the International PHP
> Conference, are pleased to announce a new monthly version of their print
> publication. For more information, you can go here: http://www.google.com
> Thanks.
> ---
>
> And transform this text to:
> ---
> Software & Support Media, producers of the International PHP Conference,
> are pleased to announce a new monthly version of their print
> publication. For more information, you can go here: <a
> href=\"http://www.google.com\">url</a>
> Thanks.
> --
>
>
> Thanks,
> Vincent.
--
Evan Nemerson
evan
coeus-group.com
http://coeusgroup.com/en
--
"Perl - the only language that looks the same before and after RSA
encryption."
-Keith Bostic
attached mail follows:
This one is perfect:
$text = preg_replace( "/(?<!<a
href=\")((http|ftp)+(s)?:\/\/[^<>\s]+)/i", "<a
style=\"text-decoration:underline\" href=\"\\0\">URL</a>", $text );
:D
Evan Nemerson wrote:
> On Thursday 18 December 2003 01:37 pm, Vincent M. wrote:
>
>>Hello,
>>
>>Is there any way to manage links in an array and transform them.
>>For example, I have this text in the database:
>
>
> php.net/preg_replace
>
>>---
>>Software & Support Media, produc-ers of the International PHP
>>Conference, are pleased to announce a new monthly version of their print
>>publication. For more information, you can go here: http://www.google.com
>>Thanks.
>>---
>>
>>And transform this text to:
>>---
>>Software & Support Media, producers of the International PHP Conference,
>>are pleased to announce a new monthly version of their print
>>publication. For more information, you can go here: <a
>>href=\"http://www.google.com\">url</a>
>>Thanks.
>>--
>>
>>
>>Thanks,
>>Vincent.
>
>
attached mail follows:
Can anyone point my to a MySQL specific SQL newsgroup. having some problem
corectly extracting data.
Thanks,
J
attached mail follows:
The URL below lists all of the MySQL mailing lists. Just choose the one
that is most specific to your issue:
http://lists.mysql.com/
HTH!
--Sam
JLake wrote:
> Can anyone point my to a MySQL specific SQL newsgroup. having some
> problem corectly extracting data.
>
> Thanks,
>
> J
attached mail follows:
Thanks
"Sam Masiello" <smasiello
mxlogic.com> wrote in message
news:5E1C03CA70721448A7F9E339BB6532B62906BF
mxhq-exch.corp.mxlogic.com...
The URL below lists all of the MySQL mailing lists. Just choose the one
that is most specific to your issue:
http://lists.mysql.com/
HTH!
--Sam
JLake wrote:
> Can anyone point my to a MySQL specific SQL newsgroup. having some
> problem corectly extracting data.
>
> Thanks,
>
> J
attached mail follows:
Yahoo has a very active group for PHP/MySQL.
http://groups.yahoo.com/group/php_mysql/
Jim
----- Original Message -----
From: "Sam Masiello" <smasiello
mxlogic.com>
To: "JLake" <jalake
idealpromotional.com>; <hp-general
lists.php.net>
Sent: Thursday, December 18, 2003 1:56 PM
Subject: RE: [PHP] MySQL newsgroup
The URL below lists all of the MySQL mailing lists. Just choose the one
that is most specific to your issue:
http://lists.mysql.com/
HTH!
--Sam
JLake wrote:
> Can anyone point my to a MySQL specific SQL newsgroup. having some
> problem corectly extracting data.
>
> Thanks,
>
> J
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
This is the tutorial i used
http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html
KidLat Ngayon wrote:
>Greetings Guyz.....
>
>I would just like to ask for a help regarding on
>"Links of Tables from other DB". I'm just only a
>newbie in PHP Programming.
>
>What I have right now is a query result from my table,
>and what I wanted to do is on my one of the table I
>had is to have a link or button that will open another
>page that will get the data from the other table.
>
>It would be highly appreciated if anyone could give me
>a sample script or link for a tutorial.
>
>Many Thanks in advance.....
>
>Regards,
>
>ERWIN
>
>__________________________________
>Do you Yahoo!?
>New Yahoo! Photos - easier uploading and sharing.
>http://photos.yahoo.com/
>
>
>
--
+-----------------+-----------------+----------------+
| Blake Schroeder | Owner/Developer | lhwd.net |
+--(http://www.lhwd.net)------------+--/3174026352\--+
attached mail follows:
This works for me
My Form
<?php
?>
<form enctype="multipart/form-data" action="savefile.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <input name="filename" type="file">
<input type="submit" value="Send File">
</form>
savefile.php
<?php
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
// $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_file()
// instead of move_uploaded_file
$uploaddir = '/fullDirectoryPath';
$uploadfile = $uploaddir. $_FILES['filename']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>
Dino Costantini wrote:
>i'm trying to write a page which allows user to upload file. theese are my
>sources but they didn't work, anyone could help me?
>-----form.html--------
><form action="upload.php" method="post" enctype="multipart/form-data">
><input type="file" name="upfile">
><input type="hidden" name="MAX_FILE_SIZE" value="10000">
><input type="submit" value="Invia il file">
></form>
>--------upload.php-----------
><?php
>// QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
>// DI PHP PRECEDENTI ALLA 4.1.0
>if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
>if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
>
>/********************* VARIABILI DA SETTARE ********************/
>// Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
>$upload_dir = $_SERVER["DOCUMENT_ROOT"] . "/esempi";
>
>// Eventuale nuovo nome da dare al file uploadato
>$new_name = "ciao.dino";
>
>// Se $new_name č vuota, il nome sarą lo stesso del file uploadato
>$file_name = ($new_name) ? $new_name : $_FILES["upfile"]["name"];
>
>if(trim($_FILES["upfile"]["name"]) == "") {
>die("Non hai indicato il file da uploadare !");
>}
>
>if(
is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
>
move_uploaded_file($_FILES["upfile"]["tmp_name"], "$upload_dir/$file_name")
>or die("Impossibile spostare il file, controlla l'esistenza o i permessi
>della directory
>dove fare l'upload.");
>} else {
>die("Problemi nell'upload del file " . $_FILES["upfile"]["name"]);
>}
>
>echo "L'upload del file " . $_FILES["upfile"]["name"] . " č avvenuto
>correttamente";
>
>?>
>-----------------------
>upload.php doesn't upload anything and doesn't output any error message. i
>don't think it's an apache problem, because this is the only page that
>doesn't work.
>
>
>
--
+-----------------+-----------------+----------------+
| Blake Schroeder | Owner/Developer | lhwd.net |
+--(http://www.lhwd.net)------------+--/3174026352\--+
attached mail follows:
I'm trying to configure/compile PHP4.3.4 on Solaris 2.8.
Seem that 'configure' just hangs now. The 'new' build systems is broken.
I can build older
version with no problem. Seem something that was not broken was 'fixed'.
(Not a good idea.)
So, the old command of: 'configure --prefix=(what ever) --with-mysql
--with-apxs=(what ever)
not just starts and hang after get to: checking host system type...
sparc-sun-solaris2.8'
and stays there (for ever unless you kill it manual - break or control
d). No idea what the problem
could be as it never does anything more. (Machine runs: everythings that
will compile version php-4.0.1pl2,
Apache_1.3.29 and MYSQL-4.0.16 so this version should work (ya right)).
Bernard
attached mail follows:
hi,
i need to update a mysql table with a dbf file, the dbf file contains more then 160000 records. i knew that the script will not be able to update 160000 records in 1 go so i am refreshing the page after speacific no of records. but still the same problem. the script timeout.i tried changing the timeout limit to 300 secs but to noavail. i am pasting the code here.plz take a look may by you can tell me what i am doing wrong
<?
define("strPath","./");
define("_MySqlEnable",TRUE);
set_time_limit(0);
require_once(strPath."paths.php");
$strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf";
$DBPointer=dbase_open($strDBName,0) or die("Cannot open file for reading");
$nNoOfRecs=dbase_numrecords($DBPointer);
$nLoopBreak=1500;
$nConn=GetCon();
if (empty($nLoopStart)) { $nLoopStart=1; }
if ($nNoOfRecs > $nLoopBreak)
{
$nLoopTill=$nLoopStart + $nLoopBreak;
$nFinal=FALSE;
}
else
{
$nLoopTill=$nLoopBreak;
$nFinal=TRUE;
}
for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++)
{
$arrData=dbase_get_record($DBPointer,$nCount);
$GRP=CheckString($arrData[0]);
$CAT=CheckString($arrData[1]);
$SUB=CheckString($arrData[2]);
$VEND_CODE=CheckString($arrData[3]);
$MANU_PART=CheckString($arrData[4]);
$PART_NUM=CheckString($arrData[5]);
$DESCR=CheckString($arrData[6]);
$COST=CheckString($arrData[7]);
$RETAIL=CheckString($arrData[8]);
$QTY=CheckString($arrData[9]);
$LIST_PRICE=CheckString($arrData[10]);
$EFF_DATE=CheckString($arrData[11]);
$TECH_FAX=CheckString($arrData[12]);
$STATUS=CheckString($arrData[13]);
$UPC=CheckString($arrData[14]);
$strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";
$nConn->doQuery($strQuery);
if ($nConn->cntResult()==0)
$strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')";
else
$strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";
//echo "<br>nCOunt - > $nCount -----".$strQuery;
$nConn->doQuery($strQuery);
}
$nCount++;
$nLoopStart=$nCount;
if ($nFinal==FALSE)
{
//1500 records updated so refresh the page
?>
<meta http-equiv="Refresh" content="2; URL=mypage.php?nLoopStart=<?=$nLoopStart;?>">
<?
}
else
{
// all records updated so redirst to calling page.
?>
<meta http-equiv="Refresh" content="2; URL=main.php?nStatus=1">
<?
}
?>
Haseeb
attached mail follows:
Have you tried setting a limit on your MySQL insert and update
statements to limit the amount trying to be processed?
Haseeb Iqbal wrote:
> hi,
> i need to update a mysql table with a dbf file, the dbf file contains more then 160000 records. i knew that the script will not be able to update 160000 records in 1 go so i am refreshing the page after speacific no of records. but still the same problem. the script timeout.i tried changing the timeout limit to 300 secs but to noavail. i am pasting the code here.plz take a look may by you can tell me what i am doing wrong
>
>
> <?
> define("strPath","./");
>
> define("_MySqlEnable",TRUE);
>
> set_time_limit(0);
>
> require_once(strPath."paths.php");
>
> $strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf";
>
> $DBPointer=dbase_open($strDBName,0) or die("Cannot open file for reading");
>
> $nNoOfRecs=dbase_numrecords($DBPointer);
>
> $nLoopBreak=1500;
>
> $nConn=GetCon();
>
> if (empty($nLoopStart)) { $nLoopStart=1; }
>
> if ($nNoOfRecs > $nLoopBreak)
> {
> $nLoopTill=$nLoopStart + $nLoopBreak;
> $nFinal=FALSE;
> }
> else
> {
> $nLoopTill=$nLoopBreak;
> $nFinal=TRUE;
> }
>
> for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++)
> {
> $arrData=dbase_get_record($DBPointer,$nCount);
>
> $GRP=CheckString($arrData[0]);
> $CAT=CheckString($arrData[1]);
> $SUB=CheckString($arrData[2]);
> $VEND_CODE=CheckString($arrData[3]);
> $MANU_PART=CheckString($arrData[4]);
> $PART_NUM=CheckString($arrData[5]);
> $DESCR=CheckString($arrData[6]);
> $COST=CheckString($arrData[7]);
> $RETAIL=CheckString($arrData[8]);
> $QTY=CheckString($arrData[9]);
> $LIST_PRICE=CheckString($arrData[10]);
> $EFF_DATE=CheckString($arrData[11]);
> $TECH_FAX=CheckString($arrData[12]);
> $STATUS=CheckString($arrData[13]);
> $UPC=CheckString($arrData[14]);
>
> $strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";
> $nConn->doQuery($strQuery);
>
> if ($nConn->cntResult()==0)
> $strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')";
$strQuery="INSERT INTO
products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc)
VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."'
LIMIT 200)";
> else
> $strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";
$strQuery="UPDATE products SET
products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC'
WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND
vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND
part_num='".$PART_NUM."'LIMIT 200";
>
> //echo "<br>nCOunt - > $nCount -----".$strQuery;
> $nConn->doQuery($strQuery);
> }
> $nCount++;
> $nLoopStart=$nCount;
> if ($nFinal==FALSE)
> {
> //1500 records updated so refresh the page
> ?>
> <meta http-equiv="Refresh" content="2; URL=mypage.php?nLoopStart=<?=$nLoopStart;?>">
> <?
> }
> else
> {
> // all records updated so redirst to calling page.
> ?>
> <meta http-equiv="Refresh" content="2; URL=main.php?nStatus=1">
> <?
> }
> ?>
>
> Haseeb
That might help out with the timeouts too.
Jas
attached mail follows:
Let me know if that solves your problem if you would be so kind... I am
sure it will but I just want to make sure.
Jas
Jas wrote:
> Have you tried setting a limit on your MySQL insert and update
> statements to limit the amount trying to be processed?
>
> Haseeb Iqbal wrote:
>
>> hi,
>> i need to update a mysql table with a dbf file, the dbf file contains
>> more then 160000 records. i knew that the script will not be able to
>> update 160000 records in 1 go so i am refreshing the page after
>> speacific no of records. but still the same problem. the script
>> timeout.i tried changing the timeout limit to 300 secs but to noavail.
>> i am pasting the code here.plz take a look may by you can tell me what
>> i am doing wrong
>>
>>
>> <?
>> define("strPath","./");
>>
>> define("_MySqlEnable",TRUE);
>>
>> set_time_limit(0);
>>
>> require_once(strPath."paths.php");
>>
>> $strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf";
>>
>> $DBPointer=dbase_open($strDBName,0) or die("Cannot open file for
>> reading");
>>
>> $nNoOfRecs=dbase_numrecords($DBPointer);
>>
>> $nLoopBreak=1500;
>>
>> $nConn=GetCon();
>>
>> if (empty($nLoopStart)) { $nLoopStart=1; }
>>
>> if ($nNoOfRecs > $nLoopBreak)
>> {
>> $nLoopTill=$nLoopStart + $nLoopBreak;
>> $nFinal=FALSE;
>> }
>> else
>> {
>> $nLoopTill=$nLoopBreak;
>> $nFinal=TRUE;
>> }
>>
>> for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++)
>> {
>> $arrData=dbase_get_record($DBPointer,$nCount);
>>
>> $GRP=CheckString($arrData[0]);
>> $CAT=CheckString($arrData[1]);
>> $SUB=CheckString($arrData[2]);
>> $VEND_CODE=CheckString($arrData[3]);
>> $MANU_PART=CheckString($arrData[4]);
>> $PART_NUM=CheckString($arrData[5]);
>> $DESCR=CheckString($arrData[6]);
>> $COST=CheckString($arrData[7]);
>> $RETAIL=CheckString($arrData[8]);
>> $QTY=CheckString($arrData[9]);
>> $LIST_PRICE=CheckString($arrData[10]);
>> $EFF_DATE=CheckString($arrData[11]);
>> $TECH_FAX=CheckString($arrData[12]);
>> $STATUS=CheckString($arrData[13]);
>> $UPC=CheckString($arrData[14]);
>>
>> $strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND
>> cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND
>> manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";
>> $nConn->doQuery($strQuery);
>>
>> if ($nConn->cntResult()==0)
>> $strQuery="INSERT INTO
>> products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc)
>> VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')";
>>
>
> $strQuery="INSERT INTO
> products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc)
> VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."'
> LIMIT 200)";
>
>> else
>> $strQuery="UPDATE products SET
>> products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC'
>> WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND
>> vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND
>> part_num='".$PART_NUM."'";
>
> $strQuery="UPDATE products SET
> products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC'
> WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND
> vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND
> part_num='".$PART_NUM."'LIMIT 200";
>
>>
>> //echo "<br>nCOunt - > $nCount -----".$strQuery;
>> $nConn->doQuery($strQuery);
>> }
>> $nCount++;
>> $nLoopStart=$nCount;
>> if ($nFinal==FALSE)
>> {
>> //1500 records updated so refresh the page
>> ?>
>> <meta http-equiv="Refresh" content="2;
>> URL=mypage.php?nLoopStart=<?=$nLoopStart;?>">
>> <?
>> }
>> else
>> {
>> // all records updated so redirst to calling page.
>> ?>
>> <meta http-equiv="Refresh" content="2; URL=main.php?nStatus=1">
>> <?
>> } ?>
>>
>> Haseeb
>
>
> That might help out with the timeouts too.
> Jas
attached mail follows:
how can i do that?
btw the script runs on a local machine but updates the records on a
webserver i mean live server. this is also a factor for the timeout. the
script was running smoothly for 24000 recods before but now it suddenly
timeout after 800records. i dont know what is heppening
Haseeb
----- Original Message -----
From: "Jas" <jason.gerfen
scl.utah.edu>
To: <php-general
lists.php.net>
Sent: Friday, December 19, 2003 3:16 AM
Subject: [PHP] Re: Script timeout Problem
> Have you tried setting a limit on your MySQL insert and update
> statements to limit the amount trying to be processed?
>
> Haseeb Iqbal wrote:
> > hi,
> > i need to update a mysql table with a dbf file, the dbf file contains
more then 160000 records. i knew that the script will not be able to update
160000 records in 1 go so i am refreshing the page after speacific no of
records. but still the same problem. the script timeout.i tried changing the
timeout limit to 300 secs but to noavail. i am pasting the code here.plz
take a look may by you can tell me what i am doing wrong
> >
> >
> > <?
> > define("strPath","./");
> >
> > define("_MySqlEnable",TRUE);
> >
> > set_time_limit(0);
> >
> > require_once(strPath."paths.php");
> >
> > $strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf";
> >
> > $DBPointer=dbase_open($strDBName,0) or die("Cannot open file for
reading");
> >
> > $nNoOfRecs=dbase_numrecords($DBPointer);
> >
> > $nLoopBreak=1500;
> >
> > $nConn=GetCon();
> >
> > if (empty($nLoopStart)) { $nLoopStart=1; }
> >
> > if ($nNoOfRecs > $nLoopBreak)
> > {
> > $nLoopTill=$nLoopStart + $nLoopBreak;
> > $nFinal=FALSE;
> > }
> > else
> > {
> > $nLoopTill=$nLoopBreak;
> > $nFinal=TRUE;
> > }
> >
> > for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++)
> > {
> > $arrData=dbase_get_record($DBPointer,$nCount);
> >
> > $GRP=CheckString($arrData[0]);
> > $CAT=CheckString($arrData[1]);
> > $SUB=CheckString($arrData[2]);
> > $VEND_CODE=CheckString($arrData[3]);
> > $MANU_PART=CheckString($arrData[4]);
> > $PART_NUM=CheckString($arrData[5]);
> > $DESCR=CheckString($arrData[6]);
> > $COST=CheckString($arrData[7]);
> > $RETAIL=CheckString($arrData[8]);
> > $QTY=CheckString($arrData[9]);
> > $LIST_PRICE=CheckString($arrData[10]);
> > $EFF_DATE=CheckString($arrData[11]);
> > $TECH_FAX=CheckString($arrData[12]);
> > $STATUS=CheckString($arrData[13]);
> > $UPC=CheckString($arrData[14]);
> >
> > $strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND
cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND
manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";
> > $nConn->doQuery($strQuery);
> >
> > if ($nConn->cntResult()==0)
> > $strQuery="INSERT INTO
products(products.grp,products.cat,products.sub,products.vend_code,products.
manu_part,products.part_num,products.desc,products.cost,products.retail,prod
ucts.qty,products.list_price,products.eff_date,products.tech_fax,products.st
atus,products.upc)
VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','"
$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRI
CE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')";
> $strQuery="INSERT INTO
>
products(products.grp,products.cat,products.sub,products.vend_code,products.
manu_part,products.part_num,products.desc,products.cost,products.retail,prod
ucts.qty,products.list_price,products.eff_date,products.tech_fax,products.st
atus,products.upc)
>
VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','"
$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRI
CE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."'
> LIMIT 200)";
> > else
> > $strQuery="UPDATE products SET
products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$R
ETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$T
ECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."'
AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND
manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'";
> $strQuery="UPDATE products SET
>
products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$R
ETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$T
ECH_FAX',status='$STATUS',upc='$UPC'
> WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND
> vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND
> part_num='".$PART_NUM."'LIMIT 200";
> >
> > //echo "<br>nCOunt - > $nCount -----".$strQuery;
> > $nConn->doQuery($strQuery);
> > }
> > $nCount++;
> > $nLoopStart=$nCount;
> > if ($nFinal==FALSE)
> > {
> > //1500 records updated so refresh the page
> > ?>
> > <meta http-equiv="Refresh" content="2;
URL=mypage.php?nLoopStart=<?=$nLoopStart;?>">
> > <?
> > }
> > else
> > {
> > // all records updated so redirst to calling page.
> > ?>
> > <meta http-equiv="Refresh" content="2; URL=main.php?nStatus=1">
> > <?
> > }
> > ?>
> >
> > Haseeb
>
> That might help out with the timeouts too.
> Jas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi,
If I have more than one form on a page, how can I get the
name of the form that was sent on the recieving page
without using javascript?
tia,
Craig
====================
TOP DRAW INC.
====================
p 780.429.9993
f 780.426.1199
craig
topdraw.com
www.topdraw.com
10210 - 111 Street,
Edmonton, Alberta
T5K 1K9
====================
attached mail follows:
Craig --
...and then php said...
%
% Hi,
Hi!
%
% If I have more than one form on a page, how can I get the
% name of the form that was sent on the recieving page
% without using javascript?
1) What's a form name?
2) Whatever it is, I suppose you could embed it in a hidden field.
3) Name your submit buttons differently and work it out from that.
4) Just look at $_POST and see the values you have.
%
% tia,
% Craig
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg
justpickone.org * society and not sufficient moral courage.
(work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE/4in2Gb7uCXufRwARAl0sAJ9r8Y3Nr/GDfR/sBRMSIzX0BA1L9wCg5uPp
gGL/WhggMT1TAGapi4ZGTQQ=
=N6dc
-----END PGP SIGNATURE-----
attached mail follows:
Do you mean a variable being passed to the next page from within a form
ex. <input type="text" name="variable_001"> or <form name="form_001"
action...>
If you are talking about the input name for a text box use this snippit...
<?php
is(empty($_POST['variable_001']) {
// Do negative result code
} elseif(!empty($_POST['variable_001']) {
// Do positive result code
...
Or if it the name of the "actual form" you want try setting a hidden
field with the same name as the form.
ex.
<form name="form_001" action="nextpage.php">
<input type="hidden" name="form_001" value="form_001">
HTH
Jas
Php wrote:
> Hi,
>
> If I have more than one form on a page, how can I get the
> name of the form that was sent on the recieving page
> without using javascript?
>
> tia,
> Craig
>
> ====================
> TOP DRAW INC.
> ====================
> p 780.429.9993
> f 780.426.1199
> craig
topdraw.com
> www.topdraw.com
>
> 10210 - 111 Street,
> Edmonton, Alberta
> T5K 1K9
> ====================
attached mail follows:
Give your forms unique names.
-- form page --
<form name=form1 method=post action=whatever.php>
<form name=form2 method=post action=whatever.php>
<form name=form3 method=post action=whatever.php>
-- whatever.php --
if ($_POST["form1"] == "Submit") { do something;}
elseif ($_POST["form2"] == "Submit") { do something else;}
elseif ($_POST["form3"] == "Submit") { do something creative;}
else {
die("no form submitted");
Jim
----- Original Message -----
From: "php" <php
lonsbury.com>
To: "Php" <php-general
lists.php.net>
Sent: Thursday, December 18, 2003 4:19 PM
Subject: [PHP] picking up a form name
| Hi,
|
| If I have more than one form on a page, how can I get the
| name of the form that was sent on the recieving page
| without using javascript?
|
| tia,
| Craig
|
| ====================
| TOP DRAW INC.
| ====================
| p 780.429.9993
| f 780.426.1199
| craig
topdraw.com
| www.topdraw.com
|
| 10210 - 111 Street,
| Edmonton, Alberta
| T5K 1K9
| ====================
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, visit: http://www.php.net/unsub.php
|
|
attached mail follows:
Thankyou i did not know that command existed! so simple cheers
"Eugene Lee" <list-php-1
fsck.net> wrote in message
news:20031218094638.GC467
Dark-Age.local...
> On Thu, Dec 18, 2003 at 01:39:57PM +1100, Eric Holmstrom wrote:
> >
> > What im trying to do is read the information from a field in a table
called
> > PARTNO. Then add RU to the front of whatever is in the PARTNO field.
> >
> > So far i have this.
> >
> > //connect details rarara
> > //query
> > $query= "SELECT PARTNO FROM russell2 ";
>
> Didn't you say the table was called "PARTNO", not "russell2"?
>
> > // make a query to get old stuff from DB col
> > $oldstuff = mysql_query($query, $conn) or die(mysql_error());
> > while ($new = mysql_fetch_array($oldstuff)){
> > $final = $new['PARTNO'];
> > //new infomation i want to add infront of PARTNO data
> > $newstuff = 'RU';
> > //Combining the two resluts together
> > $results = $newstuff.$final;
> > // just use this to check it was going through properly
> > print_r($results<br>);
> > }
> >
> > The problem i have to get it to update. If i add this (see below) inside
the
> > while statement it continually loops, and outside it doesnt work.
> >
> > $update = "UPDATE rocket SET PARTNO = '$results''";
> > mysql_query($update);
> >
> > I know the answer is simple but i seem to be stuck on it.
>
> I don't think you can just update a row that you just fetched within the
> same query. If you do this in PHP, you should split the update into a
> separate loop. Of course, it would be faster and more efficient to have
> MySQL do it for you:
>
> UPDATE rocket SET PARTNO = CONCAT('RU',PARTNO)
attached mail follows:
On Wed, 17 Dec 2003 23:15:19 +0800, Yc Nyon <ycnyon
pd.jaring.my> wrote:
> I am comparing between this two php-based CMS?
> My focus is really
> 1. the availability of modules/add-ons.
> Not too sure, but seems PHPnuke has more add-ons than Postnuke.
>
> 2. ease of maintaining a group of contributors/writers
>
> Nyon
try this http://www.phpdbform.com/
hth
attached mail follows:
Is there a way to copy a file from 1 server to a different one?
I have this code in a win 2k server, and i try to copy the file to a win NT
server:
if (is_file($file_att))
if (copy($file_att,'\servername\folder\'.$file_name))
echo "succesful";
else
echo "failure";
It gives me this warning:
Warning: Unable to create '\servername\folder\image.jpg': Invalid argument
in D:\Intranet\sitio\Documentos\copyf.php on line 161
failure
I need this to work on any computer of the network. What kind of permission
do I need so any computer can use this script?
Thanks for the help.
attached mail follows:
Try this:
if (copy($file_att,'\\\\servername\\folder\\'.$file_name))
and make sure you have write access on the winNT server
did that work?
Luke
om
"Omar" <omar_campos
compusoluciones.com> wrote in message
news:20031218231739.78938.qmail
pb1.pair.com...
> Is there a way to copy a file from 1 server to a different one?
> I have this code in a win 2k server, and i try to copy the file to a win
NT
> server:
>
> if (is_file($file_att))
> if (copy($file_att,'\servername\folder\'.$file_name))
> echo "succesful";
> else
> echo "failure";
>
> It gives me this warning:
>
> Warning: Unable to create '\servername\folder\image.jpg': Invalid argument
> in D:\Intranet\sitio\Documentos\copyf.php on line 161
> failure
>
> I need this to work on any computer of the network. What kind of
permission
> do I need so any computer can use this script?
>
> Thanks for the help.
attached mail follows:
Hi, is the best way to store data in a mysql database in the text it was submitted, or in HTML
format ... changing all the \r's and things to <br>
---
Philip J. Newman
Master Developer
PhilipNZ.com [NZ] Ltd.
info
PhilipNZ.com
attached mail follows:
Which ever way is better for you. That is, what ever is easier when it
comes to retrieving and displaying it again. Both items will be treated as
text, so mysql won't care.
Thomas
"Philip J. Newman" <NewmanPj
PhilipNZ.com> wrote in message
news:007001c3c5ce$21a19bc0$0401a8c0
jupiter...
> Hi, is the best way to store data in a mysql database in the text it was
submitted, or in HTML
> format ... changing all the \r's and things to <br>
>
>
> ---
> Philip J. Newman
> Master Developer
> PhilipNZ.com [NZ] Ltd.
> info
PhilipNZ.com
attached mail follows:
On Friday, December 19, 2003, at 12:19 PM, Philip J. Newman wrote:
> Hi, is the best way to store data in a mysql database in the text it
> was submitted, or in HTML
> format ... changing all the \r's and things to <br>
There's definitely no best way...
Theory 1:
Store it in the format you'll most commonly use it in, eg HTML for
mostly HTML work, or raw text for mostly raw-text work (eg email, text
files, etc). Make sure you can transform it back though!
Theory 2:
Always keep the original input, and do basic conversions to HTML on the
way out. nl2br() isn't going to add much overhead at all to standard
text on anything but the largest, most busy websites. If you change
your mind on HOW you wish to transform the text at a later date, it's
much easier to change it in the output script, rather than the input
script AND all existing blocks of text.
Theory 3:
For more complex transformations (I have a library which performs heaps
of transformations for paragraphs, headings, line breaks, ol and ul
lists, and heaps more), it makes sense to me that you'd store the
transformed version (to save on repetitive, processor-intensive tasks),
and perhaps the original as well (to save converting back when needed
in plain text).
Cheers,
Justin French
attached mail follows:
Hi all,
I have an issue here. I'm making a english/spanish site and want the browser
to remember their preference with a cookie. The first time a visitor comes
into the site, they will be taken to the english part (www.site.com/eng/)
and when someone clicks over the "Spanish" link, I want the cookie that was
setled to be erased and a new one to be placed instead. The thing is that is
being done in two separate files because the problem with headers (one for
deleting the cookie and the other to place the new one). The script I have
(pretty mesy) doesn't erase the cookie OR places the same one over again
instead of placing the new one. Here's what I've got so far:
THE MAIN INDEX PAGE:
<?
if (isset($_COOKIE['Languange']))
{
$relative_url = $_COOKIE['Language'];
header("Location: http://localhost/icaam10/".$relative_url);
}
elseif(!isset($_COOKIE['Languange']) AND !isset($lan))
{
$value = "eng";
setcookie ("Language", $value, time()+31536000);
header("Location: http://localhost/icaam10/eng");
}
elseif(!isset($_COOKIE['Languange']) AND isset($lan))
{
$value = $lan;
setcookie ("Language", $value, time()+31536000);
header("Location: http://localhost/icaam10/".$value);
}
?>
THE "LANSELECT.PHP" PAGE:
<?
if ($_COOKIE['Language'] == "eng")
{
$value = $_COOKIE['Language'];
setcookie ("Language", $value, time()-31536000);
header("Location: http://localhost/icaam10/index.php?lan=esp");
}
elseif ($_COOKIE['Language'] == "esp")
{
$value = $_COOKIE['Language'];
setcookie ("Language", $value, time()-31536000);
header("Location: http://localhost/icaam10/index.php?lan=eng");
}
?>
___________________________
Cesar L. Aracena
Commercial Manager / Developer
ICAAM Web Solutions
2K GROUP
Neuquen, Argentina
Tel: +54.299.4774532
Cel: +54.299.6356688
E-mail: lists
icaam.com.ar
attached mail follows:
<?php if ($_POST[formReviewBy]=="Cade Lloyd") { echo "selected"; } ?>
Should $_POST[formReviewBy] have quotes or dose it not matter?
---
Philip J. Newman
Master Developer
PhilipNZ.com [NZ] Ltd.
info
PhilipNZ.com
attached mail follows:
It should have quotes, unless you have defined formReviewBy as a constant
PHP's nice enough to interpret it as a string if using it as a constant
fails, but you should still quote it anyway.
Martin
> <?php if ($_POST[formReviewBy]=="Cade Lloyd") { echo "selected"; } ?>
>
> Should $_POST[formReviewBy] have quotes or dose it not matter?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]