Dear Sanjeev,
you're right. I am sorry for my carelessness. I corrected my code and than try
it again. But again, it does not work as I expect.
I even put << prompt("this function is being called"); >> in the jsopsi() but
again the prompt does not come out. Pffuih... I am desperate only because
Hi, this is my first post to this newsgroup. Does this code look ok or is there
a more clean way of doing this? I am learning. Thank you for reading.
Jason
if ( !empty($_REQUEST['gender']) )
{
$registrationGender=$_REQUEST['gender'];
}
else {
On 8/26/07, Jason Cartledge <[EMAIL PROTECTED]> wrote:
I would replace $_REQUEST with $_GET or $_POST (as appropriate)
> if ( !empty($_REQUEST['gender']) )
> {
>$registrationGender=$_REQUEST['gender'];
> }
> else {
Personally I would use if(isset($_SESSIO
I would go for:
if (isset($_REQUEST['gender'])) $_SESSION['registrationGender'] =
$_REQUEST['gender'];
print isset($_SESSION['registrationGender']) ? "You are registered as
gender: ".$_SESSION['registrationGender'] : "Your gender is unknown";
And make no assumptions about a gender when yo
Is there a PHP command that turns text into HTML?
EXAMPLE:
"before"
Hi.
How are you doing?
"after"
Hi.
How are you doing?
Hello again;
I have a question about upload temp dir as defined in php.ini;
I have been working on a project that has registered users, each having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered to their
own user
the closest is nl2br() which converts line breaks to tags. Other than that,
you would need to look at regex manipulation to make those changes.
Bastien
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Date: Sun, 26 Aug 2007 10:36:06 -0400
jekillen wrote:
Hello again;
I have a question about upload temp dir as defined in php.ini;
I have been working on a project that has registered users, each having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff transfered t
Hi,
that's not a problem to specify where the uploaded file has to be moved
after upload. As you specify for each user a personal directory in the
system, you just need to use a function like move_uploaded_file() to
move the uploaded file to this directory. Each uploaded file goes to,
let's
Im trying to delete a composite key but cannot figure out the proper format.
Would somebody tell me where im messing up? I have an url that is supposed
to send the member id and game id to a delete query. And the delete query is
supposed to grab the id's based on type.
This is the link:
hre
Hi,
I tried this code by removing PHP codes and made as HTML. As you said prompt
dint come to me also. When I checked JavaScript errors then I saw that
prompt function had some errors (like ; in wrong place). I have corrected
the errors in script.
function jsopsi(){
prompt("This prompt c
Nathan Nobbe wrote:
look at C++, Java, and PHP. these languages are all written in C;
Just wanted to pick you up on this. PHP is the only language you've
listed that only has a single implementation. There are implementations
of C++ compilers that are writting in other languages. I can't spe
nitrox . wrote:
Im trying to delete a composite key but cannot figure out the proper
format. Would somebody tell me where im messing up? I have an url that
is supposed to send the member id and game id to a delete query. And the
delete query is supposed to grab the id's based on type.
This is
Not to sound like a total nob, but how do I get Apache 1.3.36 to use PHP5. I
have both 4 and 5 installed, but it still uses 4. I never had a problem with
4.
I read the followed the INSTALL file for PHP5, below. I reinstall Apache as
well and nothing - step 11.
I tried putting LoadModule php5_modu
I have a string with some HTML paragraphs, like so:
$text="First paragraph\nMore text\nSome more
text\nEnd of story";
I'd like to add an image before the last paragraph. I know that
preg_replace can replace only the first n occurrences of a string, but
how can I replace the _last_ occurrence of a
On Sun, August 26, 2007 3:41 pm, Dotan Cohen wrote:
> I have a string with some HTML paragraphs, like so:
> $text="First paragraph\nMore text\nSome more
> text\nEnd of story";
>
> I'd like to add an image before the last paragraph. I know that
> preg_replace can replace only the first n occurrences
On Sun, August 26, 2007 2:05 pm, Stut wrote:
> nitrox . wrote:
>> Im trying to delete a composite key but cannot figure out the proper
>> format. Would somebody tell me where im messing up? I have an url
>> that
>> is supposed to send the member id and game id to a delete query. And
>> the
>> del
On Sun, August 26, 2007 10:34 am, jekillen wrote:
> I have been working on a project that has registered users, each
> having
> a user space portion of the web site file system. I want them to be
> able to upload images and such and have the stuff transfered to their
> own user spaces. With one up
On Sun, August 26, 2007 9:36 am, Ron Piggott wrote:
>
> Is there a PHP command that turns text into HTML?
>
> EXAMPLE:
>
> "before"
>
> Hi.
>
> How are you doing?
>
> "after"
>
> Hi.
>
> How are you doing?
http://php.net/nl2br
You could also do:
echo "", str_replace("\n", "\n", $text), "\n";
Ano
On Sun, August 26, 2007 1:11 am, Richard Kurth wrote:
> I am trying to find out which string is the longest and then find out
> what
> is different between the two string. Sometimes String 2 is longer than
> String 1 The script below works sometimes but not all the time.
> Is there a better way t
On Sun, August 26, 2007 12:46 am, Robert Keizer wrote:
> I am currently working on a module testing class, I can't seem to find
> the
> correct syntax. Here is an example of the problem:
>
> function foo( $var ){
> include $var.'.php';
> return $var(); //
On Fri, August 24, 2007 11:03 am, Jason Pruim wrote:
> Hi Everyone,
>
> I'm attempting to figure out the proper way to use sessions to log
> someone into my system. The idea being, if they arn't logged in all
> they can see is the login form, and if they are logged in, they and
> have access to a d
On Fri, August 24, 2007 10:11 am, Steve Brown wrote:
>
>
> PHP Web Server Test
>
>
>
>
>
phpinfo(), which should never be called in a production setting, is
quite possibly the worst benchmark function you could choose. :-) :-)
:-)
> I ran ab in a loop 12 times with 10,000 connections an
On Sat, August 25, 2007 9:45 am, Robert Cummings wrote:
> PHP4 AND PHP5 developers don't even use OOP. Tell me what is
> compelling
> in PHP5 that doesn't rely on you being an OOP developer?
The XML stuff, if you need to parse XML a lot, which is not exactly a
niche market, but not everybody needs
On Sat, August 25, 2007 11:56 am, Nathan Nobbe wrote:
> so we would really have to
> dig deeper for a definition of 'basic oop' / 'true oop' etc.
I'll consider PHP true OOP when PECL has a Lisp extension for me to
write REAL oop code
:-)
Actually, that could be a kind of fun extension to write...
On Fri, August 24, 2007 3:20 am, Goltsios Theodore wrote:
>> Please do not encourage the use of $_REQUEST.
>>
>> You might as well just tell people to enable register_globals again.
This is *SO* not correct at all!
$_REQUEST[] is merely array_merge($_GET, $_POST, $_COOKIE);
It is *NOT* in any w
On Fri, August 24, 2007 6:34 am, Suamya Srivastava wrote:
> by doing this can i disable the register_globals?
You can disable register_globals by using these:
$_GET['foo']
$_POST['foo']
$_REQUEST['foo'];
$_COOKIES['foo'];
$_SESSION['foo'];
$_ENV['foo'];
$_SERVER['foo'];
and never, ever, ever, u
On 8/26/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> This is *SO* not correct at all!
>
> $_REQUEST[] is merely array_merge($_GET, $_POST, $_COOKIE);
Yes and it mimics being lazy - allowing overriding values from $_POST
vs. $_GET vs. $_COOKIE depending on what the programmer wants to
"trust"
I
On Sun, August 26, 2007 6:37 pm, mike wrote:
> On 8/26/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> It is *NOT* in any way, shape, or form, polluting the global
>> namespace
>> of all your variables, which is what register_globals is.
>
> That is why I said it was *one* reason register_globals w
On Fri, August 24, 2007 12:55 am, Angelo Zanetti wrote:
> Dear All
>
> I have been using nusoap to development a client that makes SOAP calls
> to a server. I have however been stuck on a small issue but can't
> seem
> to solve it and therefore I need to relook at using another package to
> get
On Thu, August 23, 2007 6:26 pm, Liz Kim wrote:
> Did anyone else run into this problem?
>
> PHP fails to connect to MSSQL7 with mssql_connect with the message:
> Changed database context to ''.
>
> I've been searching around but did not find a good solution for PHP.
> I did find this link:
> http:
On Thu, August 23, 2007 2:49 pm, Instruct ICC wrote:
> Can server1 receive a web page form post from remoteAttacker,
> identify it as spam (or a DoS or DDoS attack),
> hand off the socket to multiple threads on multiple servers owned by
> server1's owner,
> return multiple responses to remoteAttack
On Thu, August 23, 2007 4:46 pm, Stut wrote:
> Instruct ICC wrote:
>>> Wow, that's for that egg-sucking lesson. I would think it was clear
>>> from my answer that I know what a socket is.
>> Sorry. You understood the concept but it wasn't clear to me that
>> you
>> understood about the socket. Sa
On Thu, August 23, 2007 12:04 pm, Jason Pruim wrote:
> One of these days someone is going to get sick of hearing from me,
> but until that day comes I have another question :)
>
> I asked on a MySQL list about wether it's better to have 1 database
> with many tables, or many databases with 1 table
At 11:11 PM -0700 8/25/07, Richard Kurth wrote:
I am trying to find out which string is the longest and then find out what
is different between the two string. Sometimes String 2 is longer than
String 1 The script below works sometimes but not all the time.
Is there a better way to do this or te
On Aug 26, 2007, at 9:15 AM, brian wrote:
jekillen wrote:
Hello again;
I have a question about upload temp dir as defined in php.ini;
I have been working on a project that has registered users, each
having
a user space portion of the web site file system. I want them to be
able to upload im
>
> >I am trying to find out which string is the longest and then
> find out
> >what is different between the two string. Sometimes String 2
> is longer
> >than String 1 The script below works sometimes but not all the time.
> >Is there a better way to do this or tell me what is wrong with t
On Aug 26, 2007, at 2:56 PM, Richard Lynch wrote:
On Sun, August 26, 2007 10:34 am, jekillen wrote:
I have been working on a project that has registered users, each
having
a user space portion of the web site file system. I want them to be
able to upload images and such and have the stuff tran
On Thu, August 23, 2007 9:45 am, Colin Guthrie wrote:
> Dan Shirah wrote:
>> You shouldn't need to recompile PHP.
>>
>> Just go into your PHP.ini file and uncomment the line:
>> ;extension=php_mssql.dll
>>
>> After that you can go to the [MSSQL] section of the .ini file and
>> change the
>> rest of
The definition of 'empty' changed several times in the life of PHP.
I think an empty array was always empty though...
Still, if it's giving you grief, just use http://php.net/count
On Wed, August 22, 2007 4:06 pm, Dan Shirah wrote:
> From my understanding, if $result_deferred_comments is empty,
On Wed, August 22, 2007 3:04 pm, James Ausmus wrote:
> Hello - I'm trying to find a (sane) way to, in an extended class,
> override the parent class's constants, something like the following
> (which doesn't actually work):
Call me crazy, but if you're over-riding it, then it's not a constant,
so
You could change the PHP source to not emit an error when a function
doesn't exist and matches the list in disable_functions...
But since a whole heck of a lot of scripts would NOT "just work"
without exec, that would probably not be such a Good Idea...
On Thu, August 23, 2007 12:25 am, Samuel Vo
At 6:00 PM -0700 8/26/07, Richard Kurth wrote:
>I am trying to find out which string is the longest and then
find out
>what is different between the two string. Sometimes String 2
is longer
>than String 1 The script below works sometimes but not all the time.
>Is there a better way to d
On Sun, August 26, 2007 3:03 pm, Beauford wrote:
> I tried putting LoadModule php5_module /usr/local/apache/libphp5.so in
> my
> http.conf, but it doesn't exist.
>Example 2-2. Installation Instructions (Static Module Installation
> for
>Apache) for PHP
I think "static module installation
I'm curious as to how everyone organises and includes their classes in
PHP5. Let's take a simple example that has 3 classes: customer, order,
and database. The database class has a base sql db class (I know there
is PDO and other things but this class is already written and working)
and classes t
On Wed, August 22, 2007 3:31 pm, mike wrote:
>> I thing a good FAQ entry would be how this patch fits in with
>> Suhosin
>> and what are the comparable/conflicting concepts, are they
>> compatible
>> with each other etc.
>>
>> http://www.hardened-php.net/suhosin/a_feature_list.html
>>
>>
>> Both sy
Bruce Cowin wrote:
> I'm curious as to how everyone organises and includes their classes in
> PHP5. Let's take a simple example that has 3 classes: customer, order,
> and database. The database class has a base sql db class (I know there
> is PDO and other things but this class is already written
On Sunday 26 August 2007, Bruce Cowin wrote:
> I'm curious as to how everyone organises and includes their classes in
> PHP5. Let's take a simple example that has 3 classes: customer, order,
> and database. The database class has a base sql db class (I know there
> is PDO and other things but thi
On Sun, August 26, 2007 8:00 pm, Richard Kurth wrote:
>> >I am trying to find out which string is the longest and then
>> find out
>> >what is different between the two string. Sometimes String 2
>> is longer
>> >than String 1 The script below works sometimes but not all the
>> time.
>> >Is there a
On Thu, August 23, 2007 12:58 pm, Samuel Vogel wrote:
> That'd be at least some kind of a solution.
> I'm thinking of overwriting the functions I want to block with one,
> that
> just returns true and does nothing.
> How would I do that?
E. You don't.
Well, okay, you *COULD* install the "Run
Bruce Cowin wrote:
I'm curious as to how everyone organises and includes their classes in
PHP5. Let's take a simple example that has 3 classes: customer, order,
and database. The database class has a base sql db class (I know there
is PDO and other things but this class is already written and w
On Wed, August 22, 2007 1:09 am, Vanessa Vega wrote:
> i have a table generated using PHP & javascript...the data on that
> table
> came from a form where several
> data was inputted... I want
> to let them see a preview of the data they entered, so i put a link or
> button that when clicked, will
If you want to capture the output of your current script, toss
ob_start() at the top and $data = ob_get_content() at the bottom and
then munge it as you will.
Though I also think you'd be better off putting the JS validation
in-line with the Anyone have a good method of grabbing the current page
On Tue, August 21, 2007 6:14 am, Humani Power wrote:
> Hi everybody. I have a Fedora Core 7 with php 5, and I want to upload
> an
> image.
> The funniest thing is that my script works fine in other computer but
> not in
> this one.
> I look for the error in /var/log/httpd/error.log and I found th
> I'll say it again:
>
> regsiter_globals has *NOTHING* to do with $_REQUEST.
>
> Zero.
> Zilch.
> Nada.
> Zip.
To me it allows for the same [lazy] behavior. Period. I've had other
people agree. Say what you want about it.
> No, it only relies on one "Designer" who wants their request to look
> l
Put all your classes into a single directory structure.
Use http://php.net/set_include_path (or php.ini or .htaccess) to
provide the FULL PATH to that directory.
PHP now knows where to "start" its search, and essentially prepends
that directory when it does an include.
Assume this directory stru
On Mon, August 20, 2007 11:50 am, Sascha Braun, CEO @ fit-o-matic wrote:
> could somebody please explain me, what loop construct is
> faster? The for, while or foreach.
If you are doing anything where the speed of for/while/foreach
matters, you shouldn't have done that in PHP in the first place, b
On Mon, August 20, 2007 8:54 am, Maarten Balliauw wrote:
> Here's the thing: I'm trying to do some dynamic code compilation
> within
> PHP using eval(). The code I'm trying to compile raises an E_ERROR
> (Fatal).
>
> Here's a simple example:
>
> $code = ' $returnValue = 12*A+; '; // Clearly inco
On Mon, August 20, 2007 12:41 am, Augusto Morais wrote:
> Hi,
>
>
> I want create a variable based in another variable. Example:
>
>
> $foo (a simple variable);
>
> $myvar_foo
>
>
> Does it possible?
"variable variables" will do it.
But 99.% of the time, you're better off just using an array
On Sat, August 18, 2007 6:31 pm, nitrox . wrote:
> Is it not considered good practice to have a primary key on a lookup
> table for a database?
> I have 3 tables setup, games, memberleagues and members. The
> memberleagues table holds the id of the games table and members table.
> The problem I hav
On Sun, August 26, 2007 9:16 pm, Bruce Cowin wrote:
> I'm curious as to how everyone organises and includes their classes in
> PHP5. Let's take a simple example that has 3 classes: customer,
> order,
> and database. The database class has a base sql db class (I know
> there
> is PDO and other thi
On Tue, August 21, 2007 3:08 am, Per Jessen wrote:
> N0K wrote:
>
>> But if it run in the browser, i think it have to run in cli, dont
>> you
>> think ?
>
> No, certainly not by default. They are very different environments, as
> you have already found out.
If you want to force it to work, you cou
Are you sure it's not --with-apxs2 instead of --with-apx2 ???
On Fri, August 17, 2007 8:00 am, ROUKOS Michel wrote:
> Hi,
>
> I am integrating httpd-2.0.59 with php-5.2.1 and Sybase 12.5 on a
> solaris 8 machine. I followed these steps:
> Install apache:
>
> ./configure --prefix=/usr/local/apache2
When re-writing this example to a form of "create_function", the same
problem occurs:
$temporaryCalculationFunction = @create_function('', $code); // E_ERROR
here
if ($temporaryCalculationFunction === FALSE) {
$returnValue = '#N/A';
} else {
$returnValue =
On 27/08/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Sun, August 26, 2007 3:41 pm, Dotan Cohen wrote:
> > I have a string with some HTML paragraphs, like so:
> > $text="First paragraph\nMore text\nSome more
> > text\nEnd of story";
> >
> > I'd like to add an image before the last paragraph. I
65 matches
Mail list logo