|
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-help_at_lists.php.net
Date: Thu Jan 09 2003 - 05:25:16 CST
php-general Digest 9 Jan 2003 11:25:16 -0000 Issue 1812
Topics (messages 130821 through 130922):
Re: strange problem (user poll)
130821 by: Kevin Stone
130833 by: - \[ Paul Ferrie \] -
Re: How Do I Return Values Across Servers
130822 by: Bill Arbuckle, Jr.
130824 by: Timothy Hitchens \(HiTCHO\)
Re: HTML email that generates "!"s - any ideas?
130823 by: Tom Rogers
130826 by: Timothy Hitchens \(HiTCHO\)
Will pay for PHP
130825 by: Andy Cook
Re: apache + mod_php question
130827 by: Rick Widmer
$query help :(
130828 by: - \[ Paul Ferrie \] -
130831 by: Timothy Hitchens \(HiTCHO\)
130864 by: Jason Wong
Re: Adding HTTP URL Code
130829 by: Justin French
Re: Submit Form
130830 by: Justin French
130909 by: DreamRiver
Dynamic Regex
130832 by: Gerard Samuel
130837 by: Greg Beaver
130869 by: Gerard Samuel
130870 by: Greg Beaver
130874 by: Gerard Samuel
Variables
130834 by: Stephen
130835 by: Timothy Hitchens \(HiTCHO\)
130836 by: Justin French
Stumped...
130838 by: Stephen
130839 by: Timothy Hitchens \(HiTCHO\)
130840 by: Stephen
130842 by: Timothy Hitchens \(HiTCHO\)
130846 by: Stephen
130848 by: Timothy Hitchens \(HiTCHO\)
130862 by: Stephen
130863 by: Sean Malloy
130865 by: Sean Malloy
apache and php
130841 by: Gareth Thomas
130844 by: Timothy Hitchens \(HiTCHO\)
How to strip extra characters off of a string
130843 by: rdkurth.starband.net
130847 by: Timothy Hitchens \(HiTCHO\)
130853 by: Jean-Christian Imbeault
Re: Strange file upload problem in php 4.2.3
130845 by: theheadsage.manga-sketchbook.org
Re: How to detect a PHP script time-out?
130849 by: Jean-Christian Imbeault
130851 by: Jean-Christian Imbeault
130904 by: Tamas Arpad
130906 by: Jean-Christian Imbeault
Re: how to generate one in a string
130850 by: Jean-Christian Imbeault
OpenSSL integration
130852 by: Jonathan Lassoff
problem with location???
130854 by: Ysrael Guzmán
130855 by: Timothy Hitchens \(HiTCHO\)
130860 by: Jean-Christian Imbeault
Different php.ini for each user on same server
130856 by: SED
130857 by: Timothy Hitchens \(HiTCHO\)
130858 by: Timothy Hitchens \(HiTCHO\)
130859 by: SED
130861 by: Timothy Hitchens \(HiTCHO\)
float precision
130866 by: Kevin Avila
130867 by: Jason Wong
Databases vs. File Access
130868 by: Erich Kolb
130872 by: Jean-Christian Imbeault
130878 by: Timothy Hitchens \(HiTCHO\)
session_destroy problem
130871 by: Ken Nagorski
130875 by: Gerard Samuel
Segmentation fault and var_dump()
130873 by: Rob Brandt
130886 by: Jason Wong
Advice
130876 by: cj
aggregation users?
130877 by: Greg Beaver
XML File does not reflect changes upon reopen - HELP
130879 by: Phil Powell
Connection pool extension?
130880 by: Vinod Panicker
130881 by: Timothy Hitchens \(HiTCHO\)
130882 by: Vinod Panicker
directory listing
130883 by: Aleš Lončar
130887 by: Jason Wong
proc_open() problems
130884 by: Jean-Christian Imbeault
string prints out as number (E+10...), why?
130885 by: Jean-Christian Imbeault
130891 by: - Edwin
130892 by: Jean-Christian Imbeault
130895 by: - Edwin
130897 by: Jean-Christian Imbeault
output of calling grep lr
130888 by: Martin Hudec
130889 by: Jean-Christian Imbeault
Re: fast template over xsl
130890 by: rush
gettext and translations
130893 by: electroteque
130902 by: - Edwin
130905 by: electroteque
130911 by: electroteque
how to make server response to emails
130894 by: See kok Boon
130899 by: - Edwin
130900 by: Jean-Christian Imbeault
130903 by: Jason Wong
130912 by: See kok Boon
130913 by: See kok Boon
130916 by: Jason Wong
130918 by: Jean-Christian Imbeault
Re: [PHP-DEV] Terminal text objects (PHP CDK NCURSES)
130896 by: Wez Furlong
Configuring 4.3.0 on Solaris 2.8
130898 by: Ewan McDowall
130919 by: Ewan McDowall
Re: How can I redirect to another php page
130901 by: DreamRiver
PHP 4.3.0, __CLASS__ and __FUNCTION__
130907 by: Michael Virnstein
130908 by: nicos.php.net
money
130910 by: Wilbert Enserink
130914 by: rblack.datavisibility.co.uk
130915 by: Danny Shepherd
130917 by: Jean-Christian Imbeault
130921 by: Scott Houseman
Re: money - done
130920 by: W. Enserink
session not set, server configuration?
130922 by: James Tan
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:
I have no idea what I did but this email was not supposed to go to the
list.. my apologies. *LOL*
-Kevin
----- Original Message -----
From: "Kevin Stone" <kevin
helpelf.com>
To: <php-general
lists.php.net>
Sent: Wednesday, January 08, 2003 4:18 PM
Subject: Fw: [PHP] strange problem (user poll)
> vanway
vanwaytrophy.com
>
>
>
> It would help to know where $action is being defined.
> ----- Original Message -----
> From: "- [ Paul Ferrie ] -" <info
innovativedesigns.org.uk>
> To: <php-general
lists.php.net>
> Sent: Wednesday, January 08, 2003 3:43 PM
> Subject: [PHP] strange problem (user poll)
>
>
> > Can anyone see a problem in this? When i run the script i am getting
this
> > error "Notice: Undefined variable: action in
> > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13"
> >
> > <?
> > // addpoll.php
> > // Case Study 1: User Poll - Foundation PHP for Flash
> >
> > // If the form has been submitted...
> > (line 13) if ($action == "add") {
> > // Include config file
> > include('common.php');
> >
> > // Connect to database
> > $link = dbConnect();
> >
> > // Get date for new poll
> > $posted = time();
> >
> > // Build query to insert new poll
> > $query = "INSERT INTO polls (question, option1, option2, option3,
> > posted)
> > VALUES('$question', '$option1', '$option2', '$option3',
> > $posted)";
> >
> > // Execute query
> > $result =
mysql_query($query);
> >
> > // If query failed...
> > if (!$result) {
> > // Display error
> > print "<font color=\"#ff0000\">Could not insert
> poll</font><br>\n";
> > } else {
> > print "<font color=\"#0000ff\">Poll added</font><br>\n";
> > }
> >
> > mysql_close($link);
> > }
> > ?>
> > please anyone
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
It seem there is some probs with the latest release of php something about
global vars.
Jst checked and it works now. It was the php thing right enough. i hope
that my server admin have done the same thing with the php.ini
cheers guys.
"- -" <info
innovativedesigns.org.uk> wrote in message
news:20030108224305.26860.qmail
pb1.pair.com...
> Can anyone see a problem in this? When i run the script i am getting this
> error "Notice: Undefined variable: action in
> C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13"
>
> <?
> // addpoll.php
> // Case Study 1: User Poll - Foundation PHP for Flash
>
> // If the form has been submitted...
> (line 13) if ($action == "add") {
> // Include config file
> include('common.php');
>
> // Connect to database
> $link = dbConnect();
>
> // Get date for new poll
> $posted = time();
>
> // Build query to insert new poll
> $query = "INSERT INTO polls (question, option1, option2, option3,
> posted)
> VALUES('$question', '$option1', '$option2', '$option3',
> $posted)";
>
> // Execute query
> $result =
mysql_query($query);
>
> // If query failed...
> if (!$result) {
> // Display error
> print "<font color=\"#ff0000\">Could not insert
poll</font><br>\n";
> } else {
> print "<font color=\"#0000ff\">Poll added</font><br>\n";
> }
>
> mysql_close($link);
> }
> ?>
> please anyone
>
>
attached mail follows:
Yes, I want to get a value from a script on Server A that runs against a
database on Server A, returning that value to a script variable on Server B.
I read the manual but must have missed something. This is what *seemed* as
if it should work:
Server A (containing functions and database)
qotd.php
<?php
requireonce('miscfuncs.php');
$qotd= qotd();
?>
** qotd()is a f(x) in miscfuncs.php
=============================
Server B
test.php
... HTML stuff
<?php
include 'http://www.servera.com/qotd.php';
echo $qotd . "\n<br>\n";
?>
... More HTML stuff
With this setup I get the following error: Warning: Failed opening
'http://www.servera.com/qotd.php' for inclusion
(include_path='.;c:\php4\pear') in c:\webdev\kids\homebody.inc on line 27
Any ideas? I know that I am missing something here.
Thanks,
Bill
-----Original Message-----
From: Timothy Hitchens (HiTCHO) [mailto:phplists
hitcho.com.au]
Sent: Wednesday, January 08, 2003 4:45 PM
To: 'Bill Arbuckle, Jr.'; php-general
lists.php.net
Subject: RE: [PHP] How Do I Return Values Across Servers
If I understand you want to be able to get a value from a script on
another server.
Well I would suggest a really each way would be to do have the calling
server call
a script on the supplying server using include(); which is supported but
please see
this page regarding URL fopen wrappers:
http://www.php.net/manual/en/function.include.php
Requests for includes and on the supplying server simply output the
value like:
<?php
$answer = 'no';
?>
If you do it this way it will be simply included and be available as a
variable instantly.
(**subject to security issues and speed)
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Bill Arbuckle, Jr. [mailto:bill
wingshooter.net]
> Sent: Thursday, 9 January 2003 8:17 AM
> To: php-general
lists.php.net
> Subject: [PHP] How Do I Return Values Across Servers
>
>
> This may be a no-brainer for everyone but me but ... I have
> several php scripts residing on a web site on Server A. In a
> library file on Server A are misc. functions, some of which
> query an underlying database and return a text string as the
> result. On another web site on Server B I would like to call
> these functions to get the result without reinventing the
> wheel so to speak. So my question is ... How can I call a
> function that returns a text string from Server A in a script
> requiring that text during the processing of a web page on
> Server B ... all in php? Thanks in advance.
>
> Bill
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Issue you have is that if it is on another server you must you a http etc transport to get it!!
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Bill Arbuckle, Jr. [mailto:bill
wingshooter.net]
> Sent: Thursday, 9 January 2003 9:38 AM
> To: Timothy Hitchens (HiTCHO); php-general
lists.php.net
> Subject: RE: [PHP] How Do I Return Values Across Servers
>
>
> Yes, I want to get a value from a script on Server A that
> runs against a database on Server A, returning that value to
> a script variable on Server B.
>
> I read the manual but must have missed something. This is
> what *seemed* as if it should work:
>
> Server A (containing functions and database)
> qotd.php
>
> <?php
> requireonce('miscfuncs.php');
> $qotd= qotd();
> ?>
>
> ** qotd()is a f(x) in miscfuncs.php
>
> =============================
> Server B
> test.php
>
> ... HTML stuff
>
> <?php
> include 'http://www.servera.com/qotd.php';
> echo $qotd . "\n<br>\n";
> ?>
>
> ... More HTML stuff
>
> With this setup I get the following error: Warning: Failed
> opening 'http://www.servera.com/qotd.php' for inclusion
> (include_path='.;c:\php4\pear') in
> c:\webdev\kids\homebody.inc on line 27
>
> Any ideas? I know that I am missing something here.
>
> Thanks,
>
> Bill
>
>
>
> -----Original Message-----
> From: Timothy Hitchens (HiTCHO) [mailto:phplists
hitcho.com.au]
> Sent: Wednesday, January 08, 2003 4:45 PM
> To: 'Bill Arbuckle, Jr.'; php-general
lists.php.net
> Subject: RE: [PHP] How Do I Return Values Across Servers
>
>
> If I understand you want to be able to get a value from a
> script on another server.
>
> Well I would suggest a really each way would be to do have
> the calling server call a script on the supplying server
> using include(); which is supported but please see this page
> regarding URL fopen wrappers:
>
http://www.php.net/manual/en/function.include.php
Requests for includes and on the supplying server simply output the value like:
<?php
$answer = 'no';
?>
If you do it this way it will be simply included and be available as a variable instantly.
(**subject to security issues and speed)
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Bill Arbuckle, Jr. [mailto:bill
wingshooter.net]
> Sent: Thursday, 9 January 2003 8:17 AM
> To: php-general
lists.php.net
> Subject: [PHP] How Do I Return Values Across Servers
>
>
> This may be a no-brainer for everyone but me but ... I have several
> php scripts residing on a web site on Server A. In a library file on
> Server A are misc. functions, some of which query an underlying
> database and return a text string as the result. On another web site
> on Server B I would like to call these functions to get the result
> without reinventing the wheel so to speak. So my question is ... How
> can I call a function that returns a text string from Server A in a
> script requiring that text during the processing of a web page on
> Server B ... all in php? Thanks in advance.
>
> Bill
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi,
Thursday, January 9, 2003, 7:31:35 AM, you wrote: PH> Hi everyone, I am new to this list, so this is my first post.
PH> I am trying to sen dan HTML email, and so far I got everything running, PH> except for one very odd problem.
PH> 1.) I am setting up all my variables within the .php Script. PH> 2.) I generate my HTML email PH> 3.) I am outputting the email to the browser and send it to myself
-->> Now here comes the problem:
PH> In the browseroutput the text looks like I want it to be. In the email PH> however, PH> there are several EXCLAMATION MARKS ("!") added to the code (and therefore PH> the body). PH> How can this happen?? Is there some trick I have missed? The exclamation PH> marks are PH> positioned within the email according to the amaount of characters I submit PH> with the PH> email.
PH> I have set up a simple page where you can view the .php file, the output and PH> the email.
PH> http://www.gsdh.org/pleasehelp/index.html
PH> If anyone of you could spare the time, I would be really gratefull as I have PH> to finish this but am PH> stuck! :(
PH> Thans again, PH> Philipp
What happens if you paste the php output directly into your mailer ?
-- regards, Tom
attached mail follows:
You need to set an encoding and encode the body see:
http://www.php.net/manual/en/function.imap-8bit.php
**You will need to add the headers for this plus encode**
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Tom Rogers [mailto:trogers
kwikin.com]
> Sent: Thursday, 9 January 2003 9:49 AM
> To: Philipp Hartmann
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] HTML email that generates "!"s - any ideas?
>
>
> Hi,
>
> Thursday, January 9, 2003, 7:31:35 AM, you wrote:
> PH> Hi everyone, I am new to this list, so this is my first post.
>
> PH> I am trying to sen dan HTML email, and so far I got everything
> PH> running, except for one very odd problem.
>
> PH> 1.) I am setting up all my variables within the .php Script.
> PH> 2.) I generate my HTML email
> PH> 3.) I am outputting the email to the browser and send it to myself
>
> -->> Now here comes the problem:
>
> PH> In the browseroutput the text looks like I want it to be. In the
> PH> email however, there are several EXCLAMATION MARKS ("!") added to
> PH> the code (and therefore the body).
> PH> How can this happen?? Is there some trick I have missed?
> The exclamation
> PH> marks are
> PH> positioned within the email according to the amaount of
> characters I submit
> PH> with the
> PH> email.
>
> PH> I have set up a simple page where you can view the .php file, the
> PH> output and the email.
>
> PH> http://www.gsdh.org/pleasehelp/index.html
>
> PH> If anyone of you could spare the time, I would be really
> gratefull
> PH> as I have to finish this but am stuck! :(
>
> PH> Thans again,
> PH> Philipp
>
> What happens if you paste the php output directly into your mailer ?
>
> --
> regards,
> Tom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I am bringing up a site in March, but I am working on it now. I need some
PHP (not a lot). Please email me at HotMonkeyAC
hotmail.com and let me know
if you are interested in helping. I'll make it worth your while. Thanks.
attached mail follows:
At 05:16 AM 1/9/03 +1000, Timothy Hitchens \(HiTCHO\) wrote: >use: apachectl graceful > >It will reload the config's and allow operation to continue!!
Yes, in many cases this is the best option. The only time I've found it will not work is when you are adding or changing SSL certificates. For all other changes graceful is much better choice because Apache will not lose any connections. Anything that comes in after the graceful gets handled based on the new configuration. Things that are already running will complete using the old configuration. The important thing, your machine never ignores requests.
Rick
attached mail follows:
Hi again guys i have run into another problem :(
i am trying to build a user poll (flash+php+mysql) I have the interface all sorted but i have a problem with my add new poll php file. When i hit the update poll button in flash it seem that everthing has work and it' send back a msg saying all went well :). but when i check with phpmyadmin i see that the $query has been successfully added but the "question","opt1","opt2","opt3" fields are blank no data added. the only fields to be added were the auto_id and date stamp below is a sample code of the php file and after that you will see the code on the button.
[php] if ($action == "add") { // Include config file include('common.php');
// Connect to database $link = dbConnect();
// Get date for new poll $posted = time();
// Build query to insert new poll $query = "INSERT INTO polls (question, option1, option2, option3, posted) VALUES ('$quest1', '$opt1', '$opt2', '$opt3', $posted)";
// Execute query
$result =
mysql_query($query);
// If query failed... if (!$result) { // Display error print "&result=Could not insert poll"; } else { print "&result=poll created"; }
mysql_close($link); } ?> [/php]
on the button in Flash i have [code] on (release) { if (!quest1.length) { result = "fields missing"; } if (!opt1.length) { result = "fields missing"; } if (!opt2.length) { result = "fields misasing"; } if (!opt3.length) { result = "fields missing"; } else { loadVariables("addpoll.php", this, "POST"); gotoAndPlay(2); } }
[/code]
I have tried everything i can think of but i cab't seem to get it working. Can anyone see anything i am missing? Cheers
attached mail follows:
$posted needs to have '' around it!! <-- this could be stopping it!!
(and always check to see if the vars exist first and if you are using 4.1 + with globals off you will need to change you code now or in the future)
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: - [ Paul Ferrie ] - [mailto:info
innovativedesigns.org.uk]
> Sent: Thursday, 9 January 2003 10:07 AM
> To: php-general
lists.php.net
> Subject: [PHP] $query help :(
>
>
> Hi again guys i have run into another problem :(
>
> i am trying to build a user poll (flash+php+mysql)
> I have the interface all sorted but i have a problem with my
> add new poll php file. When i hit the update poll button in
> flash it seem that everthing has work and it' send back a msg
> saying all went well :). but when i check with phpmyadmin i
> see that the $query has been successfully added but the
> "question","opt1","opt2","opt3" fields are blank no data
> added. the only fields to be added were the auto_id and date
> stamp below is a sample code of the php file and after that
> you will see the code on the button.
>
> [php]
> if ($action == "add") {
> // Include config file
> include('common.php');
>
> // Connect to database
> $link = dbConnect();
>
> // Get date for new poll
> $posted = time();
>
> // Build query to insert new poll
> $query = "INSERT INTO polls (question, option1, option2, option3,
> posted) VALUES ('$quest1', '$opt1', '$opt2', '$opt3', $posted)";
>
> // Execute query
> $result =
mysql_query($query);
>
> // If query failed...
> if (!$result) {
> // Display error
> print "&result=Could not insert poll";
> } else {
> print "&result=poll created";
> }
>
> mysql_close($link);
> }
> ?>
> [/php]
>
> on the button in Flash i have
> [code]
> on (release) {
> if (!quest1.length) {
> result = "fields missing";
> }
> if (!opt1.length) {
> result = "fields missing";
> }
> if (!opt2.length) {
> result = "fields misasing";
> }
> if (!opt3.length) {
> result = "fields missing";
> } else {
> loadVariables("addpoll.php", this, "POST");
> gotoAndPlay(2);
> }
> }
>
> [/code]
>
> I have tried everything i can think of but i cab't seem to
> get it working. Can anyone see anything i am missing? Cheers
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
On Thursday 09 January 2003 08:07, - \[ Paul Ferrie \] - wrote: > Hi again guys i have run into another problem :( > > i am trying to build a user poll (flash+php+mysql) > I have the interface all sorted but i have a problem with my add new poll > php file. > When i hit the update poll button in flash it seem that everthing has work > and it' send back a msg saying all went well :). but when i check with > phpmyadmin i see that the $query has been successfully added but the > "question","opt1","opt2","opt3" fields are blank no data added. the only > fields to be added were the auto_id and date stamp > below is a sample code of the php file and after that you will see the code > on the button.
> // Build query to insert new poll
> $query = "INSERT INTO polls (question, option1, option2, option3,
> posted) VALUES ('$quest1', '$opt1', '$opt2', '$opt3', $posted)";
>
> // Execute query
> $result =
mysql_query($query);
Before you have your code working 100% correctly you shouldn't be doing
anything that hinders debugging. If you didn't already know, prepending an
'
' on a function call disables any error reporting for that particular call.
> // If query failed... > if (!$result) { > // Display error > print "&result=Could not insert poll"; > } else { > print "&result=poll created"; > } >
Those are friendly error messages that are useful _after_ your code is working. When developing you should always use mysql_error() to see the real error message.
> I have tried everything i can think of but i cab't seem to get it working. > Can anyone see anything i am missing?
Always add error checking to your code. Always have error reporting ON.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* I am having FUN... I wonder if it's NET FUN or GROSS FUN? */
attached mail follows:
I think the reason you didn't get a reply is because no one could understand what you wanted to happen.... my guess is...
You need a regular expression to turn URLs in a string into links.
So that this:
--- This is a test. It is only a test. What happens when I include a URL in my results text? http://not.a.real.url/programs This is only a test ---becomes:
--- This is a test. It is only a test. What happens when I include a URL in my results text? <a href="http://not.a.real.url/programs">http://not.a.real.url/programs> This is only a test ---
Correct? Let us know, and I'm sure someone can help you out.
FWIW it's been asked MANY times, so a search of the archives might help.
Justin
on 09/01/03 7:07 AM, ELLIOTT,KATHERINE A (HP-FtCollins,ex1) (katherine.elliott
hp.com) wrote:
> OK, so I've gotten NO responses to my query below so I > thought I'd ask for something slightly different and see what > I get. > > If I have a bunch of plain text data, how can I pull out the > strings containing "http". I've tried several different things > but what I end up with is more or less than what I want. > Once I have this, I can add the URL code and replace the > string but I haven't figured out how to do this. > > For example, what would I do if my text looks like this (not > including the astrices): > > ****************************************************** > This is a test. It is only a test. > What happens when I include a URL in my results text? > > http://not.a.real.url/programs > > This is only a test > ****************************************************** > > Anyone? Anyone? > > Thanks, > > Katherine > > -----Original Message----- > From: ELLIOTT,KATHERINE A (HP-FtCollins,ex1) > [mailto:katherine.elliott
hp.com] > Sent: Tuesday, January 07, 2003 2:36 PM > To: php-general
lists.php.net > Subject: [PHP] Adding HTTP URL Code > > > Hello, > > I have a string of data that can be anywhere from one line (a single URL) > to many, many lines. The data is in plain text but, as I alluded, may > contain > one or more URLs (or none). I then take this data and put it on a web page > so I would like to make any URLs in the data live. Has anyone on the list > done > this? If so, can you tell me how? I'm stumped. > > Thanks, > > Katherine
attached mail follows:
is your question in regards to:
a) how to bring data from the 1st form across to the 2nd, so that it can all be updated together OR
b) how to POST data from a form using a html link, probably with javascript
If b, best place to ask is a javascript list/newsgroup, or by looking for something similar, and checking out how they did it.
Cheers,
Justin
on 09/01/03 9:10 AM, Stephen (webmaster
melchior.us) wrote:
> Hello, > > I have a question. First of all, I want to save the data a user has typed in a > form into a MySQL database so they can load it up for later use but, I need to > first submit all the form vars on the current page from a link. This may be > Javascript, but either way, I'm not sure how to do it. Any ideas? Here's a > graph kinda... > > -User enters form and submits the first page > --User taken to second form > ---User fills out the first two fields > ----User clicks a "Save Progress" link and all form fields submitted > (I can do beyond this part but just so you get the idea of what I mean) > -----PHP saves current form vars to a MySQL database > ------User told information saved and he leaves > -------User comes back next day, clicks load > --------User select his current project > ---------User taken to the last form he was on, fields filled in > > Thanks, > Stephen Craton > http://www.melchior.us > > "What's the point in appearance if your true love, doesn't care about it?" -- > http://www.melchior.us
attached mail follows:
Steven (cc list), The sticky part is: -------User comes back next day, clicks load
For that functionality you will need to remember the user, the last project they were using and the form they were 'on'. How?
You can have the user log in to their last saved state (which you will save when they log out), or set cookies on their machine or ... either way you need a unique way to identify the user, their work and their last form.
When you decide how to maintain/save this 'state' information then your work is laid out for you ...
You can also see some commented and working code for db inserts, cookies, logins, prefilling form data fields, javascript form validation etc. - what you refer to - by downloading a FREE application called phpyellow Lite Edition here:
http://www.dreamriver.com/phpcheckout/showcase.php?productnumber=1
After unzipping take a look at loginResult.php which may have some code you will need. You can skip the install and go right to the code, because a working demo of the code is here: http://phpyellow.com/phpyellow/index.php
This won't answer all your questions, but at least it's a start... the key decision you need to make is how you will save your 'state' information.
richard. http://www.dreamriver.com
Stephen wrote:
______________________________________________________
Message-ID: <001101c2b762$b8624080$0200a8c0
melchior>
From: "Stephen" <webmaster
melchior.us>
To: "PHP List" <php-general
lists.php.net>
Date: Wed, 8 Jan 2003 17:10:13 -0500
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_000D_01C2B738.CEFB1C10"
Subject: Submit Form
Hello,
I have a question. First of all, I want to save the data a user has typed in a form into a MySQL database so they can load it up for later use but, I need to first submit all the form vars on the current page from a link. This may be Javascript, but either way, I'm not sure how to do it. Any ideas? Here's a graph kinda...
-User enters form and submits the first page --User taken to second form ---User fills out the first two fields ----User clicks a "Save Progress" link and all form fields submitted (I can do beyond this part but just so you get the idea of what I mean) -----PHP saves current form vars to a MySQL database ------User told information saved and he leaves -------User comes back next day, clicks load --------User select his current project ---------User taken to the last form he was on, fields filled in
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us _________________________
attached mail follows:
The example doesn't have to make sense, but Im looking for the correct syntax for $foo. I was trying -> $foo = '\[this\](.*?)that'; $bar = 'the other';
$str = preg_replace($foo, $bar, $other_string);
But that doesn't work. I came across an example where the syntax of $foo is in -> $foo = '#\[this\](.*?)that#';
The second syntax of $foo works. I was wondering on the meaning of # in the string??
Thanks
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
attached mail follows:
Hi Gerard,
all the preg_* functions require delimiters surrounding regular expressions.
$foo = '\[this\](.*?)that';
should be by default:
$foo = '/\[this\](.*?)that/';
the code you tried uses # as the delimiter instead of /, an option preg_* allows
Take care, Greg
-- phpDocumentor http://www.phpdoc.org"Gerard Samuel" <gsam
trini0.org> wrote in message news:3E1CC193.90605
trini0.org... > The example doesn't have to make sense, but Im looking for the correct > syntax for $foo. I was trying -> > $foo = '\[this\](.*?)that'; > $bar = 'the other'; > > $str = preg_replace($foo, $bar, $other_string); > > But that doesn't work. I came across an example where the syntax of > $foo is in -> > $foo = '#\[this\](.*?)that#'; > > The second syntax of $foo works. I was wondering on the meaning of # in > the string?? > > Thanks > > -- > Gerard Samuel > http://www.trini0.org:81/ > http://dev.trini0.org:81/ > >
attached mail follows:
What you suggested is what I was trying before. My original example was incorrect. Here is an good example for the variable holding the pattern -> $foo = '/\[url\]([a-z]+://.*?)\[/url\]/'; This pattern would not work, but if I change it to $foo = '#\[url\]([a-z]+://.*?)\[/url\]#'; It does work.
Not complaining but just trying to figure out why the first version doesn't work for future references. Thanks
Greg Beaver wrote:
>Hi Gerard,
>
>all the preg_* functions require delimiters surrounding regular expressions.
>
>$foo = '\[this\](.*?)that';
>
>should be by default:
>
>$foo = '/\[this\](.*?)that/';
>
>the code you tried uses # as the delimiter instead of /, an option preg_*
>allows
>
>Take care,
>Greg
>--
>phpDocumentor
>http://www.phpdoc.org
>
>"Gerard Samuel" <gsam
trini0.org> wrote in message
>news:3E1CC193.90605
trini0.org...
>
>
>> The example doesn't have to make sense, but Im looking for the correct
>>syntax for $foo. I was trying ->
>>$foo = '\[this\](.*?)that';
>>$bar = 'the other';
>>
>>$str = preg_replace($foo, $bar, $other_string);
>>
>>But that doesn't work. I came across an example where the syntax of
>>$foo is in ->
>>$foo = '#\[this\](.*?)that#';
>>
>>The second syntax of $foo works. I was wondering on the meaning of # in
>>the string??
>>
>>Thanks
>>
>>--
>>Gerard Samuel
>>http://www.trini0.org:81/
>>http://dev.trini0.org:81/
>>
>>
>>
>>
>
>
>
>
>
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
attached mail follows:
hi Gerard,
I didn't think you were complaining :)
the problem is in [/url]
$foo = '/\[url\]([a-z]+://.*?)\[/url\]/';
should be
$foo = '/\[url\]([a-z]+://.*?)\[\/url\]/';
that "/" was ending the pattern, and so preg_* was trying to read "url\]/" as closing information, and probably giving an odd error about "u" not being appropriate
that's why # worked, because there were no other # in the string.
Hope that answers the question (properly this time!)
Take care, Greg
----- Original Message -----
From: "Gerard Samuel" <gsam
trini0.org>
To: "Greg Beaver" <greg
chiaraquartet.net>
Cc: <php-general
lists.php.net>
Sent: Thursday, January 09, 2003 12:24 AM
Subject: Re: [PHP] Re: Dynamic Regex
> What you suggested is what I was trying before. My original example
> was incorrect.
> Here is an good example for the variable holding the pattern ->
> $foo = '/\[url\]([a-z]+://.*?)\[/url\]/';
> This pattern would not work, but if I change it to
> $foo = '#\[url\]([a-z]+://.*?)\[/url\]#';
> It does work.
>
> Not complaining but just trying to figure out why the first version
> doesn't work for future references.
> Thanks
>
> Greg Beaver wrote:
>
> >Hi Gerard,
> >
> >all the preg_* functions require delimiters surrounding regular
expressions.
> >
> >$foo = '\[this\](.*?)that';
> >
> >should be by default:
> >
> >$foo = '/\[this\](.*?)that/';
> >
> >the code you tried uses # as the delimiter instead of /, an option preg_*
> >allows
> >
> >Take care,
> >Greg
> >--
> >phpDocumentor
> >http://www.phpdoc.org
> >
> >"Gerard Samuel" <gsam
trini0.org> wrote in message
> >news:3E1CC193.90605
trini0.org...
> >
> >
> >> The example doesn't have to make sense, but Im looking for the correct
> >>syntax for $foo. I was trying ->
> >>$foo = '\[this\](.*?)that';
> >>$bar = 'the other';
> >>
> >>$str = preg_replace($foo, $bar, $other_string);
> >>
> >>But that doesn't work. I came across an example where the syntax of
> >>$foo is in ->
> >>$foo = '#\[this\](.*?)that#';
> >>
> >>The second syntax of $foo works. I was wondering on the meaning of # in
> >>the string??
> >>
> >>Thanks
> >>
> >>--
> >>Gerard Samuel
> >>http://www.trini0.org:81/
> >>http://dev.trini0.org:81/
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
>
> --
> Gerard Samuel
> http://www.trini0.org:81/
> http://dev.trini0.org:81/
>
>
>
>
attached mail follows:
Made sense. Thanks for your help.
Greg Beaver wrote:
>hi Gerard,
>
>I didn't think you were complaining :)
>
>the problem is in [/url]
>
>$foo = '/\[url\]([a-z]+://.*?)\[/url\]/';
>
>should be
>
>$foo = '/\[url\]([a-z]+://.*?)\[\/url\]/';
>
>that "/" was ending the pattern, and so preg_* was trying to read "url\]/"
>as closing information, and probably giving an odd error about "u" not being
>appropriate
>
>that's why # worked, because there were no other # in the string.
>
>Hope that answers the question (properly this time!)
>
>Take care,
>Greg
>
>----- Original Message -----
>From: "Gerard Samuel" <gsam
trini0.org>
>To: "Greg Beaver" <greg
chiaraquartet.net>
>Cc: <php-general
lists.php.net>
>Sent: Thursday, January 09, 2003 12:24 AM
>Subject: Re: [PHP] Re: Dynamic Regex
>
>
>
>
>> What you suggested is what I was trying before. My original example
>>was incorrect.
>>Here is an good example for the variable holding the pattern ->
>>$foo = '/\[url\]([a-z]+://.*?)\[/url\]/';
>>This pattern would not work, but if I change it to
>>$foo = '#\[url\]([a-z]+://.*?)\[/url\]#';
>>It does work.
>>
>>Not complaining but just trying to figure out why the first version
>>doesn't work for future references.
>>Thanks
>>
>>Greg Beaver wrote:
>>
>>
>>
>>>Hi Gerard,
>>>
>>>all the preg_* functions require delimiters surrounding regular
>>>
>>>
>expressions.
>
>
>>>$foo = '\[this\](.*?)that';
>>>
>>>should be by default:
>>>
>>>$foo = '/\[this\](.*?)that/';
>>>
>>>the code you tried uses # as the delimiter instead of /, an option preg_*
>>>allows
>>>
>>>Take care,
>>>Greg
>>>--
>>>phpDocumentor
>>>http://www.phpdoc.org
>>>
>>>"Gerard Samuel" <gsam
trini0.org> wrote in message
>>>news:3E1CC193.90605
trini0.org...
>>>
>>>
>>>
>>>
>>>> The example doesn't have to make sense, but Im looking for the correct
>>>>syntax for $foo. I was trying ->
>>>>$foo = '\[this\](.*?)that';
>>>>$bar = 'the other';
>>>>
>>>>$str = preg_replace($foo, $bar, $other_string);
>>>>
>>>>But that doesn't work. I came across an example where the syntax of
>>>>$foo is in ->
>>>>$foo = '#\[this\](.*?)that#';
>>>>
>>>>The second syntax of $foo works. I was wondering on the meaning of # in
>>>>the string??
>>>>
>>>>Thanks
>>>>
>>>>--
>>>>Gerard Samuel
>>>>http://www.trini0.org:81/
>>>>http://dev.trini0.org:81/
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>--
>>Gerard Samuel
>>http://www.trini0.org:81/
>>http://dev.trini0.org:81/
>>
>>
>>
>>
>>
>>
>
>
>
>
>
-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/
attached mail follows:
Yet another question: How would you make a variable's name the value of another variable? For example... Variable 1's value is "joe." I want to make the value of variabe one, or joe, the name of variable two which would equal something else.
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
You are referring to Variables of Variables see:
http://www.php.net/manual/en/language.variables.variable.php
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
-----Original Message-----
From: Stephen [mailto:webmaster
melchior.us]
Sent: Thursday, 9 January 2003 10:52 AM
To: PHP List
Subject: [PHP] Variables
Yet another question: How would you make a variable's name the value of another variable? For example... Variable 1's value is "joe." I want to make the value of variabe one, or joe, the name of variable two which would equal something else.
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
on 09/01/03 11:52 AM, Stephen (webmaster
melchior.us) wrote:
> Yet another question: How would you make a variable's name the value of > another variable? For example... Variable 1's value is "joe." I want to make > the value of variabe one, or joe, the name of variable two which would equal > something else.
Variable variables is what you want: http://www.php.net/manual/en/language.variables.variable.php
Justin
attached mail follows:
Sorry for so many questions but this should be the last one for a while.
I have a form that I want to insert into a MySQL table. This form is based on how many entries a user wants to enter. For example, a user wants to type in 12 names, so 12 form fields appear. Or they want 50, 50 appear. What I want to do is store them all into a database, but for one, I can't quit figure out how I can insert them, and second, even if I did know how, I couldn't possibly make enough tables unless I made 999 since I put the char limit to 3 digits. How could I work this keeping in mine any number between 1 and 999 could be entered and without making 999 tables?
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
Do you require searching of this data eg... select via these numbers or not??
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
-----Original Message-----
From: Stephen [mailto:webmaster
melchior.us]
Sent: Thursday, 9 January 2003 11:56 AM
To: PHP List
Subject: [PHP] Stumped...
Sorry for so many questions but this should be the last one for a while.
I have a form that I want to insert into a MySQL table. This form is based on how many entries a user wants to enter. For example, a user wants to type in 12 names, so 12 form fields appear. Or they want 50, 50 appear. What I want to do is store them all into a database, but for one, I can't quit figure out how I can insert them, and second, even if I did know how, I couldn't possibly make enough tables unless I made 999 since I put the char limit to 3 digits. How could I work this keeping in mine any number between 1 and 999 could be entered and without making 999 tables?
Thanks, Stephen Craton http://www.melchior.us
"What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us
attached mail follows:
I will later select them and display them to be edited, but other then that, not really...
----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
To: "'Stephen'" <webmaster
melchior.us>; "'PHP List'"
<php-general
lists.php.net>
Sent: Wednesday, January 08, 2003 8:58 PM
Subject: RE: [PHP] Stumped...
: Do you require searching of this data eg... select via these numbers or
: not??
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: tim
hitcho.com.au
:
:
: -----Original Message-----
: From: Stephen [mailto:webmaster
melchior.us]
: Sent: Thursday, 9 January 2003 11:56 AM
: To: PHP List
: Subject: [PHP] Stumped...
:
:
: Sorry for so many questions but this should be the last one for a while.
:
: I have a form that I want to insert into a MySQL table. This form is
: based on how many entries a user wants to enter. For example, a user
: wants to type in 12 names, so 12 form fields appear. Or they want 50, 50
: appear. What I want to do is store them all into a database, but for
: one, I can't quit figure out how I can insert them, and second, even if
: I did know how, I couldn't possibly make enough tables unless I made 999
: since I put the char limit to 3 digits. How could I work this keeping in
: mine any number between 1 and 999 could be entered and without making
: 999 tables?
:
: Thanks,
: Stephen Craton
: http://www.melchior.us
:
: "What's the point in appearance if your true love, doesn't care about
: it?" -- http://www.melchior.us
:
:
:
attached mail follows:
What you can do it simply get the data and create an array serialise the array and sent it to the database ... the issue that arises from this is that you can't select if that record has 45 and 786 etc etc
The other option you have is to create a table then a second table that has entries that show you which numbers it has:
Table 1:
Code Name etc
Table 2:
Code Number
You will end up with multiple numbers listed in table 2 but you can then easily find everyone with number 45.
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Stephen [mailto:webmaster
melchior.us]
> Sent: Thursday, 9 January 2003 12:00 PM
> To: Timothy Hitchens (HiTCHO)
> Cc: PHP List
> Subject: Re: [PHP] Stumped...
>
>
> I will later select them and display them to be edited, but
> other then that, not really...
>
>
> ----- Original Message -----
> From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
> To: "'Stephen'" <webmaster
melchior.us>; "'PHP List'"
> <php-general
lists.php.net>
> Sent: Wednesday, January 08, 2003 8:58 PM
> Subject: RE: [PHP] Stumped...
>
>
> : Do you require searching of this data eg... select via
> these numbers or
> : not??
> :
> :
> : Timothy Hitchens (HiTCHO)
> : Open Platform Consulting
> : e-mail: tim
hitcho.com.au
> :
> :
> : -----Original Message-----
> : From: Stephen [mailto:webmaster
melchior.us]
> : Sent: Thursday, 9 January 2003 11:56 AM
> : To: PHP List
> : Subject: [PHP] Stumped...
> :
> :
> : Sorry for so many questions but this should be the last one
> for a while.
> :
> : I have a form that I want to insert into a MySQL table. This form is
> : based on how many entries a user wants to enter. For example, a user
> : wants to type in 12 names, so 12 form fields appear. Or
> they want 50, 50
> : appear. What I want to do is store them all into a database, but for
> : one, I can't quit figure out how I can insert them, and
> second, even if
> : I did know how, I couldn't possibly make enough tables
> unless I made 999
> : since I put the char limit to 3 digits. How could I work
> this keeping in
> : mine any number between 1 and 999 could be entered and
> without making
> : 999 tables?
> :
> : Thanks,
> : Stephen Craton
> : http://www.melchior.us
> :
> : "What's the point in appearance if your true love, doesn't
> care about
> : it?" -- http://www.melchior.us
> :
> :
> :
>
>
attached mail follows:
How would I serialise it? I can make the numbers into an array, but if I echo the array itself, I'd get "Array" and I need the number in the db, not the word...
----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
To: "'Stephen'" <webmaster
melchior.us>
Cc: "'PHP List'" <php-general
lists.php.net>
Sent: Wednesday, January 08, 2003 9:09 PM
Subject: RE: [PHP] Stumped...
: What you can do it simply get the data and create an array serialise the
: array and sent it to
: the database ... the issue that arises from this is that you can't
: select if that record has
: 45 and 786 etc etc
:
: The other option you have is to create a table then a second table that
: has entries that show
: you which numbers it has:
:
: Table 1:
:
: Code
: Name
: etc
:
: Table 2:
:
: Code
: Number
:
: You will end up with multiple numbers listed in table 2 but you can then
: easily find everyone with number 45.
:
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: tim
hitcho.com.au
:
: > -----Original Message-----
: > From: Stephen [mailto:webmaster
melchior.us]
: > Sent: Thursday, 9 January 2003 12:00 PM
: > To: Timothy Hitchens (HiTCHO)
: > Cc: PHP List
: > Subject: Re: [PHP] Stumped...
: >
: >
: > I will later select them and display them to be edited, but
: > other then that, not really...
: >
: >
: > ----- Original Message -----
: > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > To: "'Stephen'" <webmaster
melchior.us>; "'PHP List'"
: > <php-general
lists.php.net>
: > Sent: Wednesday, January 08, 2003 8:58 PM
: > Subject: RE: [PHP] Stumped...
: >
: >
: > : Do you require searching of this data eg... select via
: > these numbers or
: > : not??
: > :
: > :
: > : Timothy Hitchens (HiTCHO)
: > : Open Platform Consulting
: > : e-mail: tim
hitcho.com.au
: > :
: > :
: > : -----Original Message-----
: > : From: Stephen [mailto:webmaster
melchior.us]
: > : Sent: Thursday, 9 January 2003 11:56 AM
: > : To: PHP List
: > : Subject: [PHP] Stumped...
: > :
: > :
: > : Sorry for so many questions but this should be the last one
: > for a while.
: > :
: > : I have a form that I want to insert into a MySQL table. This form is
: > : based on how many entries a user wants to enter. For example, a user
: > : wants to type in 12 names, so 12 form fields appear. Or
: > they want 50, 50
: > : appear. What I want to do is store them all into a database, but for
: > : one, I can't quit figure out how I can insert them, and
: > second, even if
: > : I did know how, I couldn't possibly make enough tables
: > unless I made 999
: > : since I put the char limit to 3 digits. How could I work
: > this keeping in
: > : mine any number between 1 and 999 could be entered and
: > without making
: > : 999 tables?
: > :
: > : Thanks,
: > : Stephen Craton
: > : http://www.melchior.us
: > :
: > : "What's the point in appearance if your true love, doesn't
: > care about
: > : it?" -- http://www.melchior.us
: > :
: > :
: > :
: >
: >
:
:
:
attached mail follows:
Check out:
http://www.php.net/manual/en/function.serialize.php
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Stephen [mailto:webmaster
melchior.us]
> Sent: Thursday, 9 January 2003 12:13 PM
> To: Timothy Hitchens (HiTCHO)
> Cc: PHP List
> Subject: Re: [PHP] Stumped...
>
>
> How would I serialise it? I can make the numbers into an
> array, but if I echo the array itself, I'd get "Array" and I
> need the number in the db, not the word...
>
>
> ----- Original Message -----
> From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
> To: "'Stephen'" <webmaster
melchior.us>
> Cc: "'PHP List'" <php-general
lists.php.net>
> Sent: Wednesday, January 08, 2003 9:09 PM
> Subject: RE: [PHP] Stumped...
>
>
> : What you can do it simply get the data and create an array
> serialise the
> : array and sent it to
> : the database ... the issue that arises from this is that you can't
> : select if that record has
> : 45 and 786 etc etc
> :
> : The other option you have is to create a table then a
> second table that
> : has entries that show
> : you which numbers it has:
> :
> : Table 1:
> :
> : Code
> : Name
> : etc
> :
> : Table 2:
> :
> : Code
> : Number
> :
> : You will end up with multiple numbers listed in table 2 but
> you can then
> : easily find everyone with number 45.
> :
> :
> :
> : Timothy Hitchens (HiTCHO)
> : Open Platform Consulting
> : e-mail: tim
hitcho.com.au
> :
> : > -----Original Message-----
> : > From: Stephen [mailto:webmaster
melchior.us]
> : > Sent: Thursday, 9 January 2003 12:00 PM
> : > To: Timothy Hitchens (HiTCHO)
> : > Cc: PHP List
> : > Subject: Re: [PHP] Stumped...
> : >
> : >
> : > I will later select them and display them to be edited, but
> : > other then that, not really...
> : >
> : >
> : > ----- Original Message -----
> : > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
> : > To: "'Stephen'" <webmaster
melchior.us>; "'PHP List'"
> : > <php-general
lists.php.net>
> : > Sent: Wednesday, January 08, 2003 8:58 PM
> : > Subject: RE: [PHP] Stumped...
> : >
> : >
> : > : Do you require searching of this data eg... select via
> : > these numbers or
> : > : not??
> : > :
> : > :
> : > : Timothy Hitchens (HiTCHO)
> : > : Open Platform Consulting
> : > : e-mail: tim
hitcho.com.au
> : > :
> : > :
> : > : -----Original Message-----
> : > : From: Stephen [mailto:webmaster
melchior.us]
> : > : Sent: Thursday, 9 January 2003 11:56 AM
> : > : To: PHP List
> : > : Subject: [PHP] Stumped...
> : > :
> : > :
> : > : Sorry for so many questions but this should be the last one
> : > for a while.
> : > :
> : > : I have a form that I want to insert into a MySQL table.
> This form is
> : > : based on how many entries a user wants to enter. For
> example, a user
> : > : wants to type in 12 names, so 12 form fields appear. Or
> : > they want 50, 50
> : > : appear. What I want to do is store them all into a
> database, but for
> : > : one, I can't quit figure out how I can insert them, and
> : > second, even if
> : > : I did know how, I couldn't possibly make enough tables
> : > unless I made 999
> : > : since I put the char limit to 3 digits. How could I work
> : > this keeping in
> : > : mine any number between 1 and 999 could be entered and
> : > without making
> : > : 999 tables?
> : > :
> : > : Thanks,
> : > : Stephen Craton
> : > : http://www.melchior.us
> : > :
> : > : "What's the point in appearance if your true love, doesn't
> : > care about
> : > : it?" -- http://www.melchior.us
> : > :
> : > :
> : > :
> : >
> : >
> :
> :
> :
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Ok, I decided another easier way to do it but I have a problem now. Since the text field contains a $ sign, PHP wants to take it as a variable so it prints out nothing... Here's my code for getting the value to import into the table:
$variable = ''; for($i = 1; $i <= $vars; $i++) { $tempvar = 'var'.$i; $variable .= $$tempvar.','; }
All this gives me is this since I have three fields input:
,,,
Even if I substr() out the $ sign, it still gives a blank value. Anyone have any ideas how to fix this?
----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
To: "'Stephen'" <webmaster
melchior.us>
Sent: Wednesday, January 08, 2003 9:30 PM
Subject: RE: [PHP] Stumped...
: The issue with the serialise option is that is you have then in a row
: they are serialised
: and you can't do "SELECT * FROM accounts WHERE num_rec LIKE '5'" you
: would have to create
: two tables as per my previous idea or you can simple implode into a coma
: separated string
: and put into database and then you could use LIKE as per above.
:
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: tim
hitcho.com.au
:
: > -----Original Message-----
: > From: Stephen [mailto:webmaster
melchior.us]
: > Sent: Thursday, 9 January 2003 12:28 PM
: > To: Timothy Hitchens (HiTCHO)
: > Subject: Re: [PHP] Stumped...
: >
: >
: > Thank you much, but what did you mean I can't store numbers
: > up to 45, 768, etc?
: > ----- Original Message -----
: > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > To: "'PHP List'" <php-general
lists.php.net>
: > Sent: Wednesday, January 08, 2003 9:21 PM
: > Subject: RE: [PHP] Stumped...
: >
: >
: > : Check out:
: > :
: > : http://www.php.net/manual/en/function.serialize.php
: > :
: > : Timothy Hitchens (HiTCHO)
: > : Open Platform Consulting
: > : e-mail: tim
hitcho.com.au
: > :
: > : > -----Original Message-----
: > : > From: Stephen [mailto:webmaster
melchior.us]
: > : > Sent: Thursday, 9 January 2003 12:13 PM
: > : > To: Timothy Hitchens (HiTCHO)
: > : > Cc: PHP List
: > : > Subject: Re: [PHP] Stumped...
: > : >
: > : >
: > : > How would I serialise it? I can make the numbers into an
: > : > array, but if I echo the array itself, I'd get "Array" and I
: > : > need the number in the db, not the word...
: > : >
: > : >
: > : > ----- Original Message -----
: > : > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > : > To: "'Stephen'" <webmaster
melchior.us>
: > : > Cc: "'PHP List'" <php-general
lists.php.net>
: > : > Sent: Wednesday, January 08, 2003 9:09 PM
: > : > Subject: RE: [PHP] Stumped...
: > : >
: > : >
: > : > : What you can do it simply get the data and create an array
: > : > serialise the
: > : > : array and sent it to
: > : > : the database ... the issue that arises from this is
: > that you can't
: > : > : select if that record has
: > : > : 45 and 786 etc etc
: > : > :
: > : > : The other option you have is to create a table then a
: > : > second table that
: > : > : has entries that show
: > : > : you which numbers it has:
: > : > :
: > : > : Table 1:
: > : > :
: > : > : Code
: > : > : Name
: > : > : etc
: > : > :
: > : > : Table 2:
: > : > :
: > : > : Code
: > : > : Number
: > : > :
: > : > : You will end up with multiple numbers listed in table 2 but
: > : > you can then
: > : > : easily find everyone with number 45.
: > : > :
: > : > :
: > : > :
: > : > : Timothy Hitchens (HiTCHO)
: > : > : Open Platform Consulting
: > : > : e-mail: tim
hitcho.com.au
: > : > :
: > : > : > -----Original Message-----
: > : > : > From: Stephen [mailto:webmaster
melchior.us]
: > : > : > Sent: Thursday, 9 January 2003 12:00 PM
: > : > : > To: Timothy Hitchens (HiTCHO)
: > : > : > Cc: PHP List
: > : > : > Subject: Re: [PHP] Stumped...
: > : > : >
: > : > : >
: > : > : > I will later select them and display them to be edited, but
: > : > : > other then that, not really...
: > : > : >
: > : > : >
: > : > : > ----- Original Message -----
: > : > : > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > : > : > To: "'Stephen'" <webmaster
melchior.us>; "'PHP List'"
: > : > : > <php-general
lists.php.net>
: > : > : > Sent: Wednesday, January 08, 2003 8:58 PM
: > : > : > Subject: RE: [PHP] Stumped...
: > : > : >
: > : > : >
: > : > : > : Do you require searching of this data eg... select via
: > : > : > these numbers or
: > : > : > : not??
: > : > : > :
: > : > : > :
: > : > : > : Timothy Hitchens (HiTCHO)
: > : > : > : Open Platform Consulting
: > : > : > : e-mail: tim
hitcho.com.au
: > : > : > :
: > : > : > :
: > : > : > : -----Original Message-----
: > : > : > : From: Stephen [mailto:webmaster
melchior.us]
: > : > : > : Sent: Thursday, 9 January 2003 11:56 AM
: > : > : > : To: PHP List
: > : > : > : Subject: [PHP] Stumped...
: > : > : > :
: > : > : > :
: > : > : > : Sorry for so many questions but this should be the last one
: > : > : > for a while.
: > : > : > :
: > : > : > : I have a form that I want to insert into a MySQL table.
: > : > This form is
: > : > : > : based on how many entries a user wants to enter. For
: > : > example, a user
: > : > : > : wants to type in 12 names, so 12 form fields appear. Or
: > : > : > they want 50, 50
: > : > : > : appear. What I want to do is store them all into a
: > : > database, but for
: > : > : > : one, I can't quit figure out how I can insert them, and
: > : > : > second, even if
: > : > : > : I did know how, I couldn't possibly make enough tables
: > : > : > unless I made 999
: > : > : > : since I put the char limit to 3 digits. How could I work
: > : > : > this keeping in
: > : > : > : mine any number between 1 and 999 could be entered and
: > : > : > without making
: > : > : > : 999 tables?
: > : > : > :
: > : > : > : Thanks,
: > : > : > : Stephen Craton
: > : > : > : http://www.melchior.us
: > : > : > :
: > : > : > : "What's the point in appearance if your true love, doesn't
: > : > : > care about
: > : > : > : it?" -- http://www.melchior.us
: > : > : > :
: > : > : > :
: > : > : > :
: > : > : >
: > : > : >
: > : > :
: > : > :
: > : > :
: > : >
: > : >
: > : >
: > : > --
: > : > PHP General Mailing List (http://www.php.net/)
: > : > To unsubscribe, visit: http://www.php.net/unsub.php
: > : >
: > :
: > :
: > : --
: > : PHP General Mailing List (http://www.php.net/)
: > : To unsubscribe, visit: http://www.php.net/unsub.php
: > :
: > :
: > :
: >
: >
:
:
attached mail follows:
Don't write code which requires register_globals to be on.
$variable = $_POST['$var'];
-----Original Message-----
From: Stephen [mailto:webmaster
melchior.us]
Sent: Thursday, 9 January 2003 3:03 PM
To: Timothy Hitchens (HiTCHO)
Cc: PHP List
Subject: Re: [PHP] Stumped...
Ok, I decided another easier way to do it but I have a problem now. Since the text field contains a $ sign, PHP wants to take it as a variable so it prints out nothing... Here's my code for getting the value to import into the table:
$variable = ''; for($i = 1; $i <= $vars; $i++) { $tempvar = 'var'.$i; $variable .= $$tempvar.','; }
All this gives me is this since I have three fields input:
,,,
Even if I substr() out the $ sign, it still gives a blank value. Anyone have any ideas how to fix this?
----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
To: "'Stephen'" <webmaster
melchior.us>
Sent: Wednesday, January 08, 2003 9:30 PM
Subject: RE: [PHP] Stumped...
: The issue with the serialise option is that is you have then in a row
: they are serialised
: and you can't do "SELECT * FROM accounts WHERE num_rec LIKE '5'" you
: would have to create
: two tables as per my previous idea or you can simple implode into a coma
: separated string
: and put into database and then you could use LIKE as per above.
:
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: tim
hitcho.com.au
:
: > -----Original Message-----
: > From: Stephen [mailto:webmaster
melchior.us]
: > Sent: Thursday, 9 January 2003 12:28 PM
: > To: Timothy Hitchens (HiTCHO)
: > Subject: Re: [PHP] Stumped...
: >
: >
: > Thank you much, but what did you mean I can't store numbers
: > up to 45, 768, etc?
: > ----- Original Message -----
: > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > To: "'PHP List'" <php-general
lists.php.net>
: > Sent: Wednesday, January 08, 2003 9:21 PM
: > Subject: RE: [PHP] Stumped...
: >
: >
: > : Check out:
: > :
: > : http://www.php.net/manual/en/function.serialize.php
: > :
: > : Timothy Hitchens (HiTCHO)
: > : Open Platform Consulting
: > : e-mail: tim
hitcho.com.au
: > :
: > : > -----Original Message-----
: > : > From: Stephen [mailto:webmaster
melchior.us]
: > : > Sent: Thursday, 9 January 2003 12:13 PM
: > : > To: Timothy Hitchens (HiTCHO)
: > : > Cc: PHP List
: > : > Subject: Re: [PHP] Stumped...
: > : >
: > : >
: > : > How would I serialise it? I can make the numbers into an
: > : > array, but if I echo the array itself, I'd get "Array" and I
: > : > need the number in the db, not the word...
: > : >
: > : >
: > : > ----- Original Message -----
: > : > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > : > To: "'Stephen'" <webmaster
melchior.us>
: > : > Cc: "'PHP List'" <php-general
lists.php.net>
: > : > Sent: Wednesday, January 08, 2003 9:09 PM
: > : > Subject: RE: [PHP] Stumped...
: > : >
: > : >
: > : > : What you can do it simply get the data and create an array
: > : > serialise the
: > : > : array and sent it to
: > : > : the database ... the issue that arises from this is
: > that you can't
: > : > : select if that record has
: > : > : 45 and 786 etc etc
: > : > :
: > : > : The other option you have is to create a table then a
: > : > second table that
: > : > : has entries that show
: > : > : you which numbers it has:
: > : > :
: > : > : Table 1:
: > : > :
: > : > : Code
: > : > : Name
: > : > : etc
: > : > :
: > : > : Table 2:
: > : > :
: > : > : Code
: > : > : Number
: > : > :
: > : > : You will end up with multiple numbers listed in table 2 but
: > : > you can then
: > : > : easily find everyone with number 45.
: > : > :
: > : > :
: > : > :
: > : > : Timothy Hitchens (HiTCHO)
: > : > : Open Platform Consulting
: > : > : e-mail: tim
hitcho.com.au
: > : > :
: > : > : > -----Original Message-----
: > : > : > From: Stephen [mailto:webmaster
melchior.us]
: > : > : > Sent: Thursday, 9 January 2003 12:00 PM
: > : > : > To: Timothy Hitchens (HiTCHO)
: > : > : > Cc: PHP List
: > : > : > Subject: Re: [PHP] Stumped...
: > : > : >
: > : > : >
: > : > : > I will later select them and display them to be edited, but
: > : > : > other then that, not really...
: > : > : >
: > : > : >
: > : > : > ----- Original Message -----
: > : > : > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > : > : > To: "'Stephen'" <webmaster
melchior.us>; "'PHP List'"
: > : > : > <php-general
lists.php.net>
: > : > : > Sent: Wednesday, January 08, 2003 8:58 PM
: > : > : > Subject: RE: [PHP] Stumped...
: > : > : >
: > : > : >
: > : > : > : Do you require searching of this data eg... select via
: > : > : > these numbers or
: > : > : > : not??
: > : > : > :
: > : > : > :
: > : > : > : Timothy Hitchens (HiTCHO)
: > : > : > : Open Platform Consulting
: > : > : > : e-mail: tim
hitcho.com.au
: > : > : > :
: > : > : > :
: > : > : > : -----Original Message-----
: > : > : > : From: Stephen [mailto:webmaster
melchior.us]
: > : > : > : Sent: Thursday, 9 January 2003 11:56 AM
: > : > : > : To: PHP List
: > : > : > : Subject: [PHP] Stumped...
: > : > : > :
: > : > : > :
: > : > : > : Sorry for so many questions but this should be the last one
: > : > : > for a while.
: > : > : > :
: > : > : > : I have a form that I want to insert into a MySQL table.
: > : > This form is
: > : > : > : based on how many entries a user wants to enter. For
: > : > example, a user
: > : > : > : wants to type in 12 names, so 12 form fields appear. Or
: > : > : > they want 50, 50
: > : > : > : appear. What I want to do is store them all into a
: > : > database, but for
: > : > : > : one, I can't quit figure out how I can insert them, and
: > : > : > second, even if
: > : > : > : I did know how, I couldn't possibly make enough tables
: > : > : > unless I made 999
: > : > : > : since I put the char limit to 3 digits. How could I work
: > : > : > this keeping in
: > : > : > : mine any number between 1 and 999 could be entered and
: > : > : > without making
: > : > : > : 999 tables?
: > : > : > :
: > : > : > : Thanks,
: > : > : > : Stephen Craton
: > : > : > : http://www.melchior.us
: > : > : > :
: > : > : > : "What's the point in appearance if your true love, doesn't
: > : > : > care about
: > : > : > : it?" -- http://www.melchior.us
: > : > : > :
: > : > : > :
: > : > : > :
: > : > : >
: > : > : >
: > : > :
: > : > :
: > : > :
: > : >
: > : >
: > : >
: > : > --
: > : > PHP General Mailing List (http://www.php.net/)
: > : > To unsubscribe, visit: http://www.php.net/unsub.php
: > : >
: > :
: > :
: > : --
: > : PHP General Mailing List (http://www.php.net/)
: > : To unsubscribe, visit: http://www.php.net/unsub.php
: > :
: > :
: > :
: >
: >
:
:
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Please note the single quotes.
Using double quotes:
$variable = $_POST["$var"];
will not work, because you don't have a variable named $var in your code.
Have a look at
http://www.php.net/manual/en/language.types.string.php
-----Original Message-----
From: Sean Malloy [mailto:sean
element.net.au]
Sent: Thursday, 9 January 2003 3:18 PM
To: Stephen; PHP List
Subject: RE: [PHP] Stumped...
Don't write code which requires register_globals to be on.
$variable = $_POST['$var'];
-----Original Message-----
From: Stephen [mailto:webmaster
melchior.us]
Sent: Thursday, 9 January 2003 3:03 PM
To: Timothy Hitchens (HiTCHO)
Cc: PHP List
Subject: Re: [PHP] Stumped...
Ok, I decided another easier way to do it but I have a problem now. Since the text field contains a $ sign, PHP wants to take it as a variable so it prints out nothing... Here's my code for getting the value to import into the table:
$variable = ''; for($i = 1; $i <= $vars; $i++) { $tempvar = 'var'.$i; $variable .= $$tempvar.','; }
All this gives me is this since I have three fields input:
,,,
Even if I substr() out the $ sign, it still gives a blank value. Anyone have any ideas how to fix this?
----- Original Message -----
From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
To: "'Stephen'" <webmaster
melchior.us>
Sent: Wednesday, January 08, 2003 9:30 PM
Subject: RE: [PHP] Stumped...
: The issue with the serialise option is that is you have then in a row
: they are serialised
: and you can't do "SELECT * FROM accounts WHERE num_rec LIKE '5'" you
: would have to create
: two tables as per my previous idea or you can simple implode into a coma
: separated string
: and put into database and then you could use LIKE as per above.
:
:
:
: Timothy Hitchens (HiTCHO)
: Open Platform Consulting
: e-mail: tim
hitcho.com.au
:
: > -----Original Message-----
: > From: Stephen [mailto:webmaster
melchior.us]
: > Sent: Thursday, 9 January 2003 12:28 PM
: > To: Timothy Hitchens (HiTCHO)
: > Subject: Re: [PHP] Stumped...
: >
: >
: > Thank you much, but what did you mean I can't store numbers
: > up to 45, 768, etc?
: > ----- Original Message -----
: > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > To: "'PHP List'" <php-general
lists.php.net>
: > Sent: Wednesday, January 08, 2003 9:21 PM
: > Subject: RE: [PHP] Stumped...
: >
: >
: > : Check out:
: > :
: > : http://www.php.net/manual/en/function.serialize.php
: > :
: > : Timothy Hitchens (HiTCHO)
: > : Open Platform Consulting
: > : e-mail: tim
hitcho.com.au
: > :
: > : > -----Original Message-----
: > : > From: Stephen [mailto:webmaster
melchior.us]
: > : > Sent: Thursday, 9 January 2003 12:13 PM
: > : > To: Timothy Hitchens (HiTCHO)
: > : > Cc: PHP List
: > : > Subject: Re: [PHP] Stumped...
: > : >
: > : >
: > : > How would I serialise it? I can make the numbers into an
: > : > array, but if I echo the array itself, I'd get "Array" and I
: > : > need the number in the db, not the word...
: > : >
: > : >
: > : > ----- Original Message -----
: > : > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > : > To: "'Stephen'" <webmaster
melchior.us>
: > : > Cc: "'PHP List'" <php-general
lists.php.net>
: > : > Sent: Wednesday, January 08, 2003 9:09 PM
: > : > Subject: RE: [PHP] Stumped...
: > : >
: > : >
: > : > : What you can do it simply get the data and create an array
: > : > serialise the
: > : > : array and sent it to
: > : > : the database ... the issue that arises from this is
: > that you can't
: > : > : select if that record has
: > : > : 45 and 786 etc etc
: > : > :
: > : > : The other option you have is to create a table then a
: > : > second table that
: > : > : has entries that show
: > : > : you which numbers it has:
: > : > :
: > : > : Table 1:
: > : > :
: > : > : Code
: > : > : Name
: > : > : etc
: > : > :
: > : > : Table 2:
: > : > :
: > : > : Code
: > : > : Number
: > : > :
: > : > : You will end up with multiple numbers listed in table 2 but
: > : > you can then
: > : > : easily find everyone with number 45.
: > : > :
: > : > :
: > : > :
: > : > : Timothy Hitchens (HiTCHO)
: > : > : Open Platform Consulting
: > : > : e-mail: tim
hitcho.com.au
: > : > :
: > : > : > -----Original Message-----
: > : > : > From: Stephen [mailto:webmaster
melchior.us]
: > : > : > Sent: Thursday, 9 January 2003 12:00 PM
: > : > : > To: Timothy Hitchens (HiTCHO)
: > : > : > Cc: PHP List
: > : > : > Subject: Re: [PHP] Stumped...
: > : > : >
: > : > : >
: > : > : > I will later select them and display them to be edited, but
: > : > : > other then that, not really...
: > : > : >
: > : > : >
: > : > : > ----- Original Message -----
: > : > : > From: "Timothy Hitchens (HiTCHO)" <phplists
hitcho.com.au>
: > : > : > To: "'Stephen'" <webmaster
melchior.us>; "'PHP List'"
: > : > : > <php-general
lists.php.net>
: > : > : > Sent: Wednesday, January 08, 2003 8:58 PM
: > : > : > Subject: RE: [PHP] Stumped...
: > : > : >
: > : > : >
: > : > : > : Do you require searching of this data eg... select via
: > : > : > these numbers or
: > : > : > : not??
: > : > : > :
: > : > : > :
: > : > : > : Timothy Hitchens (HiTCHO)
: > : > : > : Open Platform Consulting
: > : > : > : e-mail: tim
hitcho.com.au
: > : > : > :
: > : > : > :
: > : > : > : -----Original Message-----
: > : > : > : From: Stephen [mailto:webmaster
melchior.us]
: > : > : > : Sent: Thursday, 9 January 2003 11:56 AM
: > : > : > : To: PHP List
: > : > : > : Subject: [PHP] Stumped...
: > : > : > :
: > : > : > :
: > : > : > : Sorry for so many questions but this should be the last one
: > : > : > for a while.
: > : > : > :
: > : > : > : I have a form that I want to insert into a MySQL table.
: > : > This form is
: > : > : > : based on how many entries a user wants to enter. For
: > : > example, a user
: > : > : > : wants to type in 12 names, so 12 form fields appear. Or
: > : > : > they want 50, 50
: > : > : > : appear. What I want to do is store them all into a
: > : > database, but for
: > : > : > : one, I can't quit figure out how I can insert them, and
: > : > : > second, even if
: > : > : > : I did know how, I couldn't possibly make enough tables
: > : > : > unless I made 999
: > : > : > : since I put the char limit to 3 digits. How could I work
: > : > : > this keeping in
: > : > : > : mine any number between 1 and 999 could be entered and
: > : > : > without making
: > : > : > : 999 tables?
: > : > : > :
: > : > : > : Thanks,
: > : > : > : Stephen Craton
: > : > : > : http://www.melchior.us
: > : > : > :
: > : > : > : "What's the point in appearance if your true love, doesn't
: > : > : > care about
: > : > : > : it?" -- http://www.melchior.us
: > : > : > :
: > : > : > :
: > : > : > :
: > : > : >
: > : > : >
: > : > :
: > : > :
: > : > :
: > : >
: > : >
: > : >
: > : > --
: > : > PHP General Mailing List (http://www.php.net/)
: > : > To unsubscribe, visit: http://www.php.net/unsub.php
: > : >
: > :
: > :
: > : --
: > : PHP General Mailing List (http://www.php.net/)
: > : To unsubscribe, visit: http://www.php.net/unsub.php
: > :
: > :
: > :
: >
: >
:
:
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I am trying to run a PHP page from my browser (Mozilla) and each time I load the page it is attempting to force a dowload of the page instead, based on the mime-type. I had been developing a command line PHP application which works fine and then had just started on a web interface and realised that Apache may not be configured correctly. So I edited httpd.conf and added the Add Type line for x-type-httpd .php. I am running Apache 2.0.40 on RedHat 8 and PHP 4.3.0pre2. Can anyone tell me what I am doing wrong? What should the modifications be to httpd.conf for PHP?
Thanks in advance
attached mail follows:
Your settings should be something similar to this:
<IfModule mod_php4.c> AddType application/x-httpd-php .php .html AddType application/x-httpd-php-source .phps </IfModule>
Do you have the page remotely available to see what is happening for you??
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Gareth Thomas [mailto:gdthomas
mercurysoft.com]
> Sent: Thursday, 9 January 2003 12:03 PM
> To: php-general
lists.php.net
> Subject: [PHP] apache and php
>
>
> I am trying to run a PHP page from my browser (Mozilla) and
> each time I load the page it is attempting to force a dowload
> of the page instead, based on the mime-type. I had been
> developing a command line PHP application which works fine
> and then had just started on a web interface and realised
> that Apache may not be configured correctly. So I edited
> httpd.conf and added the Add Type line for x-type-httpd .php.
> I am running Apache 2.0.40 on RedHat 8 and PHP 4.3.0pre2. Can
> anyone tell me what I am doing wrong? What should the
> modifications be to httpd.conf for PHP?
>
> Thanks in advance
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I need to be able to just extract the number that is right Under blocks in this example it is the number 57070. This was generated by the quota -g groupname command.
Disk quotas for group site53 (gid 165): Filesystem blocks quota limit grace files quota limit grace /dev/hda4 57070 307201 307200 1146 0 0
I have tried using some of the string functions like I used $test=strstr ($test, "hda"); $test= substr("$test",7); This well get me up to the start of the number but now I need to get read of every thing after the number. Is there a better way of getting this info or for striping all the other stuff away.
-- Best regards, rdkurth mailto:rdkurthstarband.net
attached mail follows:
Give this a shot ... a bit of a hack but works for you:
<?php
$string = '
Disk quotas for group site53 (gid 165): Filesystem blocks quota limit grace files quota limit grace /dev/hda4 57070 307201 307200 1146 0 0
';
$test = strstr($string, 'hda');
// replace two spaces with one - ensure differences in quota function doesn't effect $test = eregi_replace(' ', ' ', $test);
// split on spaces $test = explode(' ', $test);
echo trim($test[2]);
?>
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: rdkurth
starband.net [mailto:rdkurth
starband.net]
> Sent: Thursday, 9 January 2003 12:17 PM
> To: php-general
> Subject: [PHP] How to strip extra characters off of a string
>
>
>
> I need to be able to just extract the number that is right
> Under blocks in this example it is the number 57070. This was
> generated by the quota -g groupname command.
>
> Disk quotas for group site53 (gid 165):
> Filesystem blocks quota limit grace files
> quota limit grace
> /dev/hda4 57070 307201 307200 1146
> 0 0
>
> I have tried using some of the string
> functions like I used
> $test=strstr ($test, "hda");
> $test= substr("$test",7);
> This well get me up to the start of the number but now I need
> to get read of every thing after the number. Is there a
> better way of getting this info or for striping all the other
> stuff away.
>
>
>
>
> --
> Best regards,
> rdkurth mailto:rdkurth
starband.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
rdkurth
starband.net wrote:
>
> I need to be able to just extract the number that is right Under
> blocks in this example it is the number 57070. This was generated by
> the quota -g groupname command.
>
> Disk quotas for group site53 (gid 165):
> Filesystem blocks quota limit grace files quota limit grace
> /dev/hda4 57070 307201 307200 1146 0 0
>
> I have tried using some of the string
> functions like I used
> $test=strstr ($test, "hda");
> $test= substr("$test",7);
Have a look at explode(). You could do something like this:
$test=strstr ($test, "hda"); $test= substr("$test",7); $aValues = explode(" ", $test); list($fs, $blocks, $quota, $limit, $rest_of_string) = each ($aValues, 4);
Jc
attached mail follows:
Try using the $_files['photo']['error'] variable to see if the file is acutaly being uploaded correctly. I had the same problem on Windows XP, but i discovered the file was only half-uploaded using this.
- Daniel "TheHeadSage" Spain
Founder of Voidsoft.
theheadsage
manga-sketchbook.org
~ Manga Sketchbook, the best Manga Scanlation group! ~
On 8 Jan 2003 at 21:35, Submission.org.ru Team wrote:
> Hello php-general,
> I'm trying to figure out why I can't upload any file in php.
>
> Form code
> ========
> <form name="photoform" action="photos.php" method="post" enctype="multipart/form-data">
> <input type="hidden" name="MAX_FILE_SIZE" value="40960">
> <table border="0" cellspacing="0" cellpadding="2">
> <tr>
> <td colspan="2" class="emphasis">Use this form to upload your new photographs. Note: only JPEG (.jpg) and PNG (.png) files allowed. Maximimum allowed file size is 40KB.</td>
> </tr>
> <tr>
> <td>Photograph: </td>
> <td><input type="file" name="photo" /></td>
> </tr>
> <tr>
> <td>Description: </td>
> <td>
> <textarea name="photodesc" rows="3" cols="30"><?php echo $_POST["photodesc"] ?></textarea>
> </td>
> </tr>
> <tr>
> <td colspan="2" align="center"><input type="submit" name="fileupload" value="Upload" /></td>
> </tr>
> </table>
> </form>
>
> PHP code
> =======
> <?php
> if ($_POST["fileupload"] == "Upload") {
> $errormsg = "";
> $photospath ="/home/freeman/upload";
> $filename = $_FILES['photo']['name'];
> $filetype = $_FILES['photo']['type'];
> $filesize = (int) $_FILES['photo']['size'];
>
> if ($filetype == "image/jpeg" || $filetype == "image/pjpeg" || $filetype == "image/png" || $filetype == "image/x-png") {
> if ($filesize < 40960 && $filesize > 0) {
> $storename = $uniqueid = md5 (uniqid (rand));
> if ($filetype == "image/jpeg" || $filetype == "image/pjpeg") $storename .= ".jpg";
> if ($filename == "image/png" || $filetype == "image/x-png") $storename .= ".png";
> $desc = $_POST["photodesc"];
>
> // Store the file in the photos folder and add record to database
> if (is_uploaded_file ($_FILES['photo']['tmp_name'])) {
> if (!
move_uploaded_file ($_FILES['photo']['tmp_name'], $photospath.$storename)) {
> $errormsg .= " Problem uploading the file. Please try again. If the problem persists please email support
huntclubservices.com to report the error.";
> } else {
>
chmod ($photospath.$storename, 0644);
> $sql = "INSERT INTO hcs_photos (clientID,photoName,photoTitle,uploadTimeStamp) VALUES ('". $_SESSION["clientID"] ."','$storename','$desc','$timestamp')";
> $db->Query ($sql, $conn);
> }
>
> } else {
> $errormsg .= "Possible file upload attack. Filename: ". $_FILES['photo']['name'];
> }
> } else {
> $errormsg .= "Invalid file size. Maximum of 40KB allowed";
> }
> } else {
> $errormsg .= "Invalid file type. Only JPEG and PNG files allowed";
> }
> if (strlen ($errormsg) < 5) {
> header ("Location: ". $baseurl ."photos.php");
> }
> }
> ?>
>
> When I upload a file I get
> $filesize equal to 0.
>
> In my php.ini i got the following section:
> ; Whether to allow HTTP file uploads.
> file_uploads = On
>
> ; Temporary directory for HTTP uploaded files (will use system default if not
> ; specified).
> upload_tmp_dir = "/tmp"
>
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 2M
>
>
> Please help. PHP even does not create a temp file in a temp directory.
> /tmp got permission 777
>
> I'm running Apache 2.0.43 and RedHat Linux
>
> --
> Best regards,
> Submission.org.ru mailto:freeman
submission.org.ru
>
>
>
attached mail follows:
Tamas Arpad wrote: > > That's not right now. The manual is outdated. See this bug report > http://bugs.php.net/bug.php?id=15209. > This behavior was changed from 4.06 to 4.1. In newer versions of php the > registered functions will run before the connection is closed so ouptput can > be done from there as well. > > So Jean you can make it as it is suggested on this page: > http://www.php.net/manual/en/features.connection-handling.php
Cool! I just tested it out and it works. At lest under PHP 4.3.0 and Apache 1.3.26.
But according to the bug report this functionality may change in the future and a new function apache_register_shutdown() might replace the current one ...
The current functionality is *not* what is documented, but is it was is *intended*. I.e. will the current functionality be change to be what the docs say or will it continue and the docs will be changed?
I will be using this functionality and need to know if it will change in future releases ...
Thanks for this info. It was a great help!
Jc
attached mail follows:
Robert Fisher wrote: > > If you are willing to do a rewrite, then have your > main script start a fork, or child process.
According to Arpi (see below) I can use register_shutdown(), as the docs are wrong and it *will* send output to the browser *before* the connection is closed.
Jc
>Tamas Arpad wrote: > That's not right now. The manual is outdated. See this bug report > http://bugs.php.net/bug.php?id=15209. > This behavior was changed from 4.06 to 4.1. In newer versions of php the > registered functions will run before the connection is closed so ouptput can > be done from there as well. > So Jean you can make it as it is suggested on this page: > http://www.php.net/manual/en/features.connection-handling.php > > Arpi
attached mail follows:
> Cool! I just tested it out and it works. At lest under PHP 4.3.0 and > Apache 1.3.26. > > But according to the bug report this functionality may change in the > future and a new function apache_register_shutdown() might replace the > current one ... > > The current functionality is *not* what is documented, but is it was is > *intended*. I.e. will the current functionality be change to be what the > docs say or will it continue and the docs will be changed? > > I will be using this functionality and need to know if it will change in > future releases ... There was a discussion about this topic on the dev list, and because of many reasons the current functionality of register_shutdown_function() will remain the same in future releases too. Joseph Tate is working on a new function (apache_register_shutdown_function) to make it possible on apache to use the old behavior (Thanks Joseph! :)).
Arpi
attached mail follows:
Tamas Arpad wrote: > > There was a discussion about this topic on the dev list, and because of many > reasons the current functionality of register_shutdown_function() will remain > the same in future releases too. Joseph Tate is working on a new function > (apache_register_shutdown_function) to make it possible on apache to use the > old behavior (Thanks Joseph! :)).
Great! Love you guys! This "buggy" function is coming in quite handy :)
Jc
attached mail follows:
Matt Vos wrote: > > What is the ASCII value of an EOF? Find that and use <? echo > chr($eof_ascii_value); ?>
For the benefit of those reading this in the future the value is 4, so use chr(4);
Jc
attached mail follows:
I wish to integrate a secure HTTP tunnel into an existing PHP application I am working on. I am having a hard time understanding the PHP.net OpenSSL documentation. Any pointers, or refrences would be really helpful. Source is at http://harrisdracon.dyndns.org/phpcode/hw.src
-- Jonathan Lassoff
attached mail follows:
give a idea please. This is correct? <script languaje="JavaScript"> location.href="page.php?<?=SID?>&cliente=$cli"; </script>
Ysrael Guzmán Meza
attached mail follows:
Hmm "language" !!! languaje
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: Ysrael Guzmán [mailto:yguzman
layconsa.com.pe]
> Sent: Thursday, 9 January 2003 12:43 PM
> To: php-general
lists.php.net
> Subject: [PHP] problem with location???
>
>
> give a idea please.
>
> This is correct?
>
> <script languaje="JavaScript">
> location.href="page.php?<?=SID?>&cliente=$cli";
> </script>
>
>
>
> Ysrael Guzmán Meza
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Ysrael guzmán wrote: > > This is correct? > > <script languaje="JavaScript"> > location.href="page.php?<?=SID?>&cliente=$cli"; > </script>
You have one small mistake here:
<script language="JavaScript">
And a bigger mistake here:
location.href="page.php?<?php echo SID . "&cliente=$cli"; ?>"
Jc
attached mail follows:
Is it possible to define a different php.ini for each user which use the same server, either Unix and Windows. Let me give you example what I mean:
User 1 (professional PHP-user) Allow him big uploads, long execution time etc. Virtual directory www.user1.com
User 2 (amateur PHP-user) Allow smal uploads, short execution time etc. Virtual directory www.user2.com
Thanks, Sumarlidi E. Dadason
SED - Graphic Design
_________________________________
E-mail: sed
sed.is
website: www.sed.is
attached mail follows:
You can set php_value and php_flags etc inside of the virtual host def in httpd.conf etc
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: SED [mailto:sed
sed.is]
> Sent: Thursday, 9 January 2003 1:10 PM
> To: php-general
lists.php.net
> Subject: [PHP] Different php.ini for each user on same server
>
>
> Is it possible to define a different php.ini for each user
> which use the same server, either Unix and Windows. Let me
> give you example what I
> mean:
>
> User 1 (professional PHP-user)
> Allow him big uploads, long execution time etc.
> Virtual directory www.user1.com
>
> User 2 (amateur PHP-user)
> Allow smal uploads, short execution time etc.
> Virtual directory www.user2.com
>
> Thanks,
> Sumarlidi E. Dadason
>
> SED - Graphic Design
> _________________________________
> E-mail: sed
sed.is
> website: www.sed.is
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Please keep it on list and (reply to all) as it assist everyone then!!
Check out:
http://www.php.net/manual/en/configuration.directives.php
As a starting point!!
Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: tim
hitcho.com.au
> -----Original Message-----
> From: SED [mailto:sed
sed.is]
> Sent: Thursday, 9 January 2003 1:14 PM
> To: 'Timothy Hitchens (HiTCHO)'
> Subject: RE: [PHP] Different php.ini for each user on same server
>
>
> Thanks, do you know where I can find document about that?
>
>
> Regards,
> Sumarlidi E. Dadason
>
> SED - Graphic Design
> _________________________________
> Tel: 896-0376, 461-5501
> E-mail: sed
sed.is
> website: www.sed.is
>
> -----Original Message-----
> From: Timothy Hitchens (HiTCHO) [mailto:phplists
hitcho.com.au]
> Sent: 9. janúar 2003 03:09
> To: 'SED'; php-general
lists.php.net
> Subject: RE: [PHP] Different php.ini for each user on same server
>
>
> You can set php_value and php_flags etc inside of the virtual
> host def in httpd.conf etc
>
>
>
> Timothy Hitchens (HiTCHO)
> Open Platform Consulting
> e-mail: tim
hitcho.com.au
>
> > -----Original Message-----
> > From: SED [mailto:sed
sed.is]
> > Sent: Thursday, 9 January 2003 1:10 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] Different php.ini for each user on same server
> >
> >
> > Is it possible to define a different php.ini for each user
> which use
> > the same server, either Unix and Windows. Let me give you
> example what
> > I
> > mean:
> >
> > User 1 (professional PHP-user)
> > Allow him big uploads, long execution time etc.
> > Virtual directory www.user1.com
> >
> > User 2 (amateur PHP-user)
> > Allow smal uploads, short execution time etc.
> > Virtual directory www.user2.com
> >
> > Thanks,
> > Sumarlidi E. Dadason
> >
> > SED - Graphic Design
> > _________________________________
> > E-mail: sed
sed.is
> > website: www.sed.is
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/