Use $_GET["select"] for the switch statement
Some of the people on this list would even recommend you make another
variable first, such as $userselect = $_GET["select"] and use
$userselect as your switch statement, though I think it pointless.
Or turn register_globals on in the php.ini file (not
switch($_GET['select']){
case 1:
..
-Peter
> -Original Message-
> From: Edward Kehoe [mailto:emkehoe@;learn.senecac.on.ca]
> Sent: Friday, October 25, 2002 19:47
> To: [EMAIL PROTECTED]
> Subject: [PHP] Trouble with switch statements
>
>
> Ok...I just recently installed Apa
Ok...I just recently installed Apache1 and PHP 4.2.3 on my computer and I've
configured everything. However, I can't seem to get my switch statements to
accept variable values from the address bar. So if I type in:
http://www.my-site.com/index.php?select=1
It displays the text in the default part
I am setting a MySQL update page where a user is provided a HTML form to
update with data auto poulated from a MySQL database via PHP.
All the form element work except for TEXTAREA.
No matter what encoding I use (htmlspecial, htmlentities etc) I get the
browser displaying garbeld text.
Example:
php-general Digest 27 Oct 2002 05:26:21 - Issue 1668
Topics (messages 121529 through 121576):
Re: passthru problems generating WAVs with mpg123
121529 by: Justin French
Re: upload files
121530 by: Chad Cotton
PHP Manual Book
121531 by: Stephen
121539 by: Jas
on 27/10/02 2:31 PM, Jason Wong ([EMAIL PROTECTED]) wrote:
> On Sunday 27 October 2002 10:40, DaRk--ObJeCtS wrote:
>> alright i wanna know where i could see the source of predifened functions
>> like session_register. Thx.
>
> the manual?
errr, no the SOURCE... download it from php.net... did ar
On Sunday 27 October 2002 10:40, DaRk--ObJeCtS wrote:
> alright i wanna know where i could see the source of predifened functions
> like session_register. Thx.
the manual?
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting
On Saturday, October 26, 2002, at 09:45 PM, John W. Holmes wrote:
Ok then without asp how do I get
alright i wanna know where i could see the source of predifened functions
like session_register. Thx.
--
Dark |++| Darkobjects.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello,
I'm afraid that your question is more of a "How can I use Flash MX?"
question.
Maybe you should get a good book about Flash MX or just google for some more
other tutorials...
- E
"Stephen" <[EMAIL PROTECTED]> wrote:
> I'm tyring to follow a DevArticle tutorial on creating a online users
Ok.
I've had to wrestle with some peculiar issues with my sessions...
1) If at any point, I give my session a name different than the default
using session_name('XYZ'), my session won't be created. Is there a limit to
the number of characters a session name can have? Capitalization? ANYTHING?
2)
Or,
You can use this:
http://www.php.net/manual/en/function.is-numeric.php
- E
"John W. Holmes" <[EMAIL PROTECTED]> wrote:
> > > Then make sure $id is a number. You can use is_int, or (int), or
> > whatever.
> >
> > It appears that any numeric values passed via the URL (..?param=10001)
> ar
That's impossible to answer!! My guess is that the "few letters" you change
affect the way the script runs, so it's probably causing an error.
Without seeing *WHAT* you change, I can only guess.
Justin
on 27/10/02 10:31 AM, Trasca Ion-Catalin ([EMAIL PROTECTED]) wrote:
> If I have a php file
> Ok then without asp how do I get
> > Bottom line is that you want to use addslashes() or
magic_quotes_gpc()
> > on any variable you're going to insert into a query string. If
you're
> > inserting a variable that should be a number, make sure it is one.
>
> If I have magic quotes turned on, do I still need to worry about using
> a
I'm tyring to follow a DevArticle tutorial on creating a online users script in flash.
Problem is, I can't find where the actions properties are to enter things like this:
loadVariablesNum("count.php?RND="+random(999), 0);
Please help!! I'm using Flash MX, same as the tutorial. I've also posted
Ok then without asp how do I get
John W. Holmes wrote:
>
> Bottom line is that you want to use addslashes() or magic_quotes_gpc()
> on any variable you're going to insert into a query string. If you're
> inserting a variable that should be a number, make sure it is one.
If I have magic quotes turned on, do I still need to worry
If I have a php file who calls another php file which change some letters on
the first file, why my php code on the first file won't work anymore?
I hope I was explicit enough in my question.
--
Trasca Ion-Catalin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://
Ken Kirtley wrote:
> I'm new to PHP and so this may be something of a newbie question. My bad if
> it is. I've spent a week now looking for information on capturing the
> referral site with php so that I can store it with some session information.
> If any of you have any idea how to accomplish
$HTTP_REFERER
$_SERVER["HTTP_REFERER"]
Samuel | http://enetwizard.net
-Original Message-
From: Ken Kirtley [mailto:kdkirtley@;earthlink.net]
Sent: Saturday, October 26, 2002 5:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Referral Site...
I'm new to PHP and so this may be something of a
I'm new to PHP and so this may be something of a newbie question. My bad if
it is. I've spent a week now looking for information on capturing the
referral site with php so that I can store it with some session information.
If any of you have any idea how to accomplish this I would greatly
appreci
Or, more simply - set up an ODBC DSN on the Windows box to the MySQL
database, and simply link the tables into Access.
Best regards,
Andrew Hill
Director of Technology Evangelism - OpenLink Software
Universal Data Access and the Virtuoso Universal Server
http://www.openlinksw.com/virtuoso/whatis.
> > Then make sure $id is a number. You can use is_int, or (int), or
> whatever.
>
> It appears that any numeric values passed via the URL (..?param=10001)
are
> automatically treated as strings. If I pass ?param=1001 to the
following
> script...
So turn it into an integer.
$param = (int)$_POST[
hi,
does anyone know of a blogger with ODBC support?
cheers,
jaxon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
John W. Holmes wrote:
> Then make sure $id is a number. You can use is_int, or (int), or whatever.
It appears that any numeric values passed via the URL (..?param=10001) are
automatically treated as strings. If I pass ?param=1001 to the following
script...
$type = '';
if (is_string($para
> I'm confused about when I should escape single or double quotes.
Should
> all
> quotes be stored as \" or \' in a database as well?
Escape both, just use addslashes. The key here is that if you are
inserting a variable into a string (which is all a query is), then you
want to make sure that the
Add this to the header string...
"Bcc: [EMAIL PROTECTED]\r\n";
Andre Dubuc wrote:
Perhaps some kind guru can spare me some time. I've tried to get the "From:
" field pre-filled for a registration/confirmation email that I send out.
I've managed to get the "To: ' field working great, but no
How would you then build into the headers an 'invisible' BCC (blind carbon
copy)?
-Original Message-
From: Monty <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Saturday, October 26, 2002 3:53 PM
Subject: [PHP] Re: Getting the "From: [EMAIL PROTECTED]" to work
>Andr
John W. Holmes wrote:
> Then make sure $name has all single quotes escaped within it. If all of
> them are escaped, then it's just a string and can't do any harm. If they
> aren't escaped, then the user can break out of your own SQL and put
> their own.
I'm confused about when I should escape si
You need to build your header and include that in your mail() call:
$lc_headers = "From: $lc_from_name <$lc_from_email>\n";
$lc_headers .= "X-Sender: <$lc_sender>\n";
$lc_headers .= "X-Mailer: PHP\n"; // mailer
$lc_headers .= "Return-Path: <$lc_return>\n"; // Return path for errors
$lc_hea
Andre Dubuc wrote:
> Perhaps some kind guru can spare me some time. I've tried to get the "From:
> " field pre-filled for a registration/confirmation email that I send out.
To add to John's reply, here's how to do a multi-parameter Header. Also note
the \r\n at the end of each of these lines.
Thanks John,
I had the maual in front of me, but I didn't understand that you had to put
the 'From:' stuff in a 'header'. That's why it wasn't working. I presumed
(wrongly again) that 'headers' were optional, and I got sidetracked by the
success of the "To:" field.
Thanks for clearing that up.
http://www.php.net/manual/en/function.mail.php
>>if(@mail($to, $from, $subject, $message))
There is no 'from' field. This must be put in the headers.
Andre Dubuc wrote:
Perhaps some kind guru can spare me some time. I've tried to get the "From:
" field pre-filled for a registration/confi
[snip]
> if(@mail($to, $from, $subject, $message))
Go back to the manual. The parameters for mail are
mail(to,subject,message,headers).
You have to pass the From: address in the headers.
$to = "[EMAIL PROTECTED]";
$subject = "Your email";
$message = "Your email is good";
$headers = "From: [EMAIL
> > You can still use extract($_POST).
> > It is as safe/vulernable as $_POST['isAdmin'].
> >
> > In either case, use only variables that you know are yours and be
> certain
> > these contain values which you believe to be safe. For instance, if
you
> expect
> > a variable called $firstname to cont
Perhaps some kind guru can spare me some time. I've tried to get the "From:
" field pre-filled for a registration/confirmation email that I send out.
I've managed to get the "To: ' field working great, but no matter where I
stick the 'From:' code, it doesn't send the email. Any ideas what I'
So if you have...
and
<%
asp junk;
m$ junk;
%>
it your server will parse both the php and asp code?
Jason Porembski wrote:
Yes it does. But I need the php to work in an ASP page =(
- Original Message -
From: "John Nichel" <[EMAIL PROTECTED]>
To: "Jason Porembski" <[EMAIL PROT
$counter is not related to the session at all with register_globals OFF.
Use $HTTP_SESSION_VARS['count']++;
---John Holmes...
> -Original Message-
> From: Alexandre [mailto:alexandre@;cmsmedical.com.br]
> Sent: Saturday, October 26, 2002 2:42 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Pr
You can't have both. Either the script is parsed by PHP or it's parsed
by ASP.
---John Holmes...
> -Original Message-
> From: Jason Porembski [mailto:jporembs@;optonline.net]
> Sent: Friday, October 25, 2002 11:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP]
If you are not running PHP under a Windows platform the most efficient way
to solve your problem is with a PHP extension I developed. It handles
constants and provides a type of persistent variable too. It has been
immensely useful for my projects.
http://pwee.sourceforge.net/
Lance
> -Origi
Hello,
When I try the code bellow with register_globals=On, it work was expected,
the counter variable is incremented each time that I load the page, but,
when I try with register_globals=Off, it doesn´t work, the counter variable
is incremented just in the first time, the session variable is not
On Sunday 27 October 2002 02:45, Stephen wrote:
> Hello,
>
> I was just wondering if the entire PHP manual at php.net was published into
> a book or not. I was going to print it out once but it turned out to be
> about 1000+ pages...
It would be out of date as soon as it's published and before it
Hello,
When I try the code below and register_globals=On, its work fine, the
counter variable is incremented each time that I load the page, but, when
register_globals=Off, its does not work, the counter variable is save just
in first time and never more.
How can I fix this? With out to turn re
Hello,
When I try the code below and register_globals=On, its work fine, the
counter variable is incremented each time that I load the page, but, when
register_globals=Off, its does not work, the counter variable is save just
in first time and never more.
How can I fix this? With out to turn re
For some reason I get the following e-mail every time I make a post here
recently and not sure why:
---
This message was created automatically by mail delivery software (Exim).
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The fol
Rick Emery wrote:
> You can still use extract($_POST).
> It is as safe/vulernable as $_POST['isAdmin'].
>
> In either case, use only variables that you know are yours and be certain
> these contain values which you believe to be safe. For instance, if you expect
> a variable called $firstname to
> Well, one way you can avoid similar things to happen is, you can do
> something like, say, create a user that can only SELECT. If the user can
> only SELECT then it cannot DELETE.
This is a great suggestion from Rick. I already use this method. I have
several MySQL users set up for various funct
I'm not attempting to solve this puzzle, but, regarding the output from
print_r(), try this for nicely formatted output:
echo "";
print_r($myarray);
echo "";
Looks much better.
Monty
> From: [EMAIL PROTECTED] (Peter Harkins)
> Newsgroups: php.general
> Date: Sat, 26 Oct 2002 02:37:51 -0700
> T
I use the following function to do this...
function countRecords($query, $dbcon=0) {
if ($dbcon==0) { $ dbcon = connDbase(); }
$query = "SELECT COUNT(*) ".$query;
$res = mysql_query($query, $ dbcon); // Query DB.
return mysql_result($res, 0, "count(*)");
}
Here's how it's used:
Hello,
I was just wondering if the entire PHP manual at php.net was published into a book or
not. I was going to print it out once but it turned out to be about 1000+ pages...
Thanks,
Stephen Craton
http://www.melchior.us
http://php.melchior.us
I just wrote a file upload script and all the information that I needed was
here in the manual:
http://www.php.net/manual/en/features.file-upload.php
There were a couple of "common pitfalls" that it points out, which you
should check. Make sure you've defined the various configuration variables
I'm SURE you've got a good reason, but why are you wanting to generate a WAV
on demand? The loss in file quality occurs going from WAV > MP3, so then
later going back to WAV would only result in a bigger file size, with ZERO
benefit in audio quality.
Just asking :)
Justin
on 26/10/02 4:53 PM,
php-general Digest 26 Oct 2002 16:54:49 - Issue 1667
Topics (messages 121513 through 121528):
ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...
121513 by: vic
121514 by: John Nichel
121515 by: vic
121516 by: John Nichel
121517 by: vic
I've written a little script for VoiceXML applications to generate a WAV
from an MP3 on demand:
#file wavwrapper.php
header('Content-Type: audio/wav');
$filename = $_GET['filename'];
$mp3dir="/var/www/mp3s/";
$playercmd="/usr/local/bin/mpg123 -m -w - -q -4 --8bit";
passthru("$playercmd $mp3dir/
Does it work when you do it like this
Jason Porembski wrote:
Hey folks. I am attempting to run PHP code with
Hey folks. I am attempting to run PHP code with
On Thu, 24 Oct 2002 21:26:30 +, John W. Holmes wrote:
> What is supposed to be in the session? Maybe these users are just
> denying cookies?
Maybe... But my php compiled with --use-trans-sid and use this feature.
In the session i store account, access timestamp etc...
P.S. And 10% of traffic
On Saturday 26 October 2002 18:23, James Taylor wrote:
> There's got to be a better way to go about this: I am constantly doing
> mysql queries where I am doing
> a count(), so a sample query would be like this: "select count(*) from
> database". I'm expecting only
> ONE value back exactly, and th
Hi,
Saturday, October 26, 2002, 8:23:23 PM, you wrote:
JT> There's got to be a better way to go about this: I am constantly doing mysql
JT> queries where I am doing
JT> a count(), so a sample query would be like this: "select count(*) from
JT> database". I'm expecting only
JT> ONE value back exac
There's got to be a better way to go about this: I am constantly doing mysql
queries where I am doing
a count(), so a sample query would be like this: "select count(*) from
database". I'm expecting only
ONE value back exactly, and that's the count results. However, to get this
data into a variabl
If you know what recursion is and like a challege, here's a puzzle
to keep you up nights. If not, you'll probably just want to mutter to
yourself "what a poor, unlucky bastard" and pass on by.
I'm parsing some data files into a PHP array and am stumped. I'm at
a loss for how to do
On Thu, Oct 24, 2002 at 04:37:56PM -0400, GC wrote:
> Hi, I wrote a simple page that tries to enter a string into a LDAP server.
> I get the following error:
>
> Warning: LDAP: add operation could not be completed. in
> /var/www/html/user/adduser_p.php on line 65
>
> Where in my log files can I g
On Friday 25 October 2002 02:04, Chris Boget wrote:
> > 1) Does anyone know of a JS mailing list that actually has a good
> > amount of traffic (receives more than 10 email messages a day)?
>
> Dunno
google -> javascript weenie
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open So
64 matches
Mail list logo