Re: [PHP] Message check then post

2005-08-03 Thread disguised.jedi
On 8/3/05, George B [EMAIL PROTECTED] wrote:
 I am coding a message board. I am about done. I have all the forms
 needed for the message. So it all works out. The user types in his name,
   message title, and the message itself. Then clicks submit. The Submit
 button takes him to the message check. The message check shows all the
 stuff the user entered. Then it has echo which says 'Is this correct'?
 And then there is a button. Yes When the user clicks yes it goes to
 another PHP file which runs the SQL query to put in the entereddata into
 the database
 $query = INSERT INTO forum (user,name,message) VALUES
 ('$username','$name','$message');
 $result = mysql_query($query);
 
 But see, the problem is that it is entering blanks into the DB. I think
 that is because the $username $name and $message are in the other file?
 I have no idea how to by-pass this problem. What should I do?
Use hidden form values.  You have displayed the data along with your
is this OK? message, so in that file, do this...

form name=message action=see [1] below method=post
input type=hidden name=user value=?php echo $username; ?
input type=hidden name=name value=?php echo $name; ?
input type=hidden name=message value=?php echo $message; ?

The Is this OK? stuff goes here.

input type=submit value=Yes, post it!
input type=button value=No, take me back!
onClick=window.location.href='see[2] below'
/form

[1] - The page with the database code goes here.
[2] - The previous page goes here.

This will stick the form values back inside a form which will be
posted to the next page.  The user can't see or edit them.  Hidden
form values are very useful, I'd recommend you take a closer look at
them!

Hope that helps!

-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Install directions for Win2003 SP1??

2005-07-17 Thread disguised.jedi
On 7/13/05, Grosz, Steve (IPG IT) [EMAIL PROTECTED] wrote:
 Does anyone have a step by step, screenshots would be great, of how to
 install PHP 4.x on a Win2003 SP1 server?
 
 I've tried going through the install instructions on PHP.net's site for
 windows, but its still not working, so I think I'm missing something
 somewhere along the way.

Tell us what's going on!  Instead of a step-by-step tutorial, you can
tell us what you've been having problems with, and we can help you
troubleshoot that specific issue.  That tutorial works pretty well for
most systems, so another tutorial probably won't make anything work
better.  Plus, most of us on this list don't carry tutorials in our
back pockets! :-)

Give me an error message, and I'd be more than happy to help!

-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: x years old

2005-07-02 Thread disguised.jedi
 attempted-humor
 I think the Credit Card Industry using ceil() alot ;P
 /attempted-humor

attempted-laugh
HAHAHAHAHAHAHAHAHAHAah.*sigh*
/attempted-laugh



-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] test

2005-05-31 Thread disguised.jedi
On 5/31/05, Justin Hannus [EMAIL PROTECTED] wrote:
 testing
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
What about it?


-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] .INC files

2005-05-31 Thread disguised.jedi
On 5/30/05, Martin Zvarik [EMAIL PROTECTED] wrote:
 Hi,
 
 I saw files like file.inc.php and file.inc
 
 What is the *.inc suffix good for ?
 
 Thank you for replies.
 
 Martin
 
 
I think it means that the files were meant to be included...not called
by themselves.  I'm just guessing though...:)  Then the server could
be configured to deny access to these file types.  Then the only way
the code can be executed is to run the file that includes it

Anyone else out there know for sure??

-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP and USB Devices

2005-05-31 Thread disguised.jedi
On 5/31/05, Joe Harman [EMAIL PROTECTED] wrote:
 Has anyone out there found a way to get information from a USB device
 running on their computer... what i am trying to do is retrive the
 fingerprint ID that the Microsoft USB fingerprint reader returns for a
 finger print and put it in a webpage form???
 
 There has to be a way to do it...
 
 --
 Joe Harman
 -
 Do not go where the path may lead, go instead where there is no path
 and leave a trail. - Ralph Waldo Emerson
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
AFAIK, the fingerprint reader acknowledges the fingerprint is correct,
then inputs some HUGE password into the form, and if it isn't correct,
it doesn't put the password in.

So is what you are doing really needed?

If so, I'd look into a browser plugin...this isn't something PHP can do

-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] TEST

2005-05-31 Thread disguised.jedi
On 5/31/05, Martin Zvarik [EMAIL PROTECTED] wrote:
 test dammit, doesnt work


it worksgmail doesn't show you your own posts

--
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free


-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to make a script sleep for 5 seconds?

2005-05-30 Thread disguised.jedi
On 5/30/05, Robert Cummings [EMAIL PROTECTED] wrote:
 Sorry to hijack this thread but I was wondering how to make a script
 sleep for 5 seconds?

 Thanks most gratefully in advance from the bottom of my heart,
 Rob.

 --
 Disclaimer: This has been a weak attempt at jest. Only 2 cute and fluffy
 bunny rabbits were harmed during this endeavour.
RTFM - http://www.php.net/sleep

Try this: sleep(5);

It's amazing how useful the manual can be . . .

--
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free


-- 
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sending a string with $_POST/$_GET

2005-05-17 Thread disguised.jedi
 I want to write a string to a variable and use $_POST or $_GET to retrieve
 it on another page.
 
 I keep gettting an undefined index errror. Can someone show me how this is
 done?
/*
How are you trying to accomplish this?  Are you setting the $_GET in
the page code, or using a hidden form?  (If you are using the form,
you can skip this part.  If you aren't, or don't know what I mean,
read on!)  For example:

This code (page1.php):
?php 
$_GET['myvalue'] = 'This is MY GET VALUE';
$_POST['myvalue'] = 'This is MY POST VALUE';
?

With this code (page2.php):
?php
echo $_GET['myvalue'];
echo $_POST['myvalue'];
?
Will not return an error, but the second page won't echo anything. 
However, if you access page2.php with the URL like this:
http://localhost/page2.php?myvalue=This is MY GET VALUE

The first line will output: This is MY GET VALUE

To get the second line to work, you will need to use this:
(page1.php)
form action=page2.php method=post
input type=hidden value=This is MY POST VALUE
input type=submit
/form

When the button is clicked, page2.php, which is the same as before,
will load, and the second line will cause the output of This is MY
POST VALUE.  You can make both lines of page2.php work by
changing the action attribute of the form to page2.php?myvalue=This
is MY GET VALUE.  That way, they will both work.
*/
 Do I have to use session_start() ?
/*
This would be better.  You can use sessions the way I think you are
trying to use $_GET and $_POST.  Just start the session on the first
page, and set an element in $_SESSION and on the next page you can
start the session again and read the value out of the array.  Like
this:

(page1.php)
?php
session_start();
$_SESSION['test'] = 'test value';
?

(page2.php)
?php 
session_start();
echo $_SESSION['test'];
?

The page, page2.php, will show test value if you run page1.php
first.  $_SESSION is probably the easiest of all the superglobals to
use.

Try those, and if I'm completely off-base, and not even helping, try
posting some code, which is ALWAYS a good thing to do.  A big post
asking for help never hurt anyone.  Most people almost never read the
short ones.

Happy coding!!!
*/

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re-initiating an autostarted session

2005-05-16 Thread disguised.jedi
 But this code *still* does not destroy the cookie on the client side.
 Are you doing that somewhere else?
/*
Look in the user contributed notes in the session-destroy page.  There
is a function to wipe out the session and has worked nicely for me!
http://www.php.net/session_destroy
*/

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] changing php ini location

2005-05-15 Thread disguised.jedi
On 5/14/05, emre [EMAIL PROTECTED] wrote:
 i am not using apache 2.0
/*
Why aren't you?  Apache 2.0 is your best bet.  It really is the best
one available!
*/
 as i mentioned before i am using apache 1.3 which means that i dont have the
 oppurtunity to use phpnidir config parameter. since apache 1.3 doesnt
 support that.
 
  i cannot compile php neither,  since i m using a php precompiled windows
 edition.
/*
It sure sounds like you are out of luck.  Your only option is to get
Apache 2.0 and use that directive.  Can I ask why in the world you are
doing this?  Are you aware you can change almost any option in php.ini
in your script with the ini_set function?

http://www.php.net/ini_set
*/

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] text with $

2005-05-09 Thread disguised.jedi
On 5/9/05, Martín Marqués martin@bugs.unl.edu.ar wrote:
 I have a text variable that contains $ symbols, that when I pass it out PHP
 thinks that the $ mean that a variable name comes right after.
/*
This is standard behavior, as far as I know.  Are you using an IDE, or
just a standard text editor?  Many IDEs will notify you of this, or
just escape it automatically.
*/ 
 I tried escaping the $ put with no luck.
/*
Escaping didn't work?  That's strange.  Could you post the code?  This
would help, as I think you might not be escaping it correctly.  See
below...
*/ 
 Is there something I can do?
/*
'Single Quotes?'  Be sure that when you escape it you are using \, not
/!  Again, try posting code.  You're always more likely to get
responses if you post the code, and/or any error messages you get.
*/

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] I'm having a blond moment with a while loop???

2005-05-08 Thread disguised.jedi
On 5/8/05, George Pitcher [EMAIL PROTECTED] wrote:
 Hi guys,
 
 I'm doing something dumb but I can't see it.
 
 The basic premise is:
 
 sql search of orders sorted by customer
 set g_customer_id to ''
 loop through resultset
   if customer_id not same as last record's customer_id (g_customer_id)
 get customer email details
 set up message header if this is the first record for a customer
 set item details
   else
 set item details
 set g_customer_id to customer_id
   endif
   send email
 end loop
This looks fine to me.  Although you might want to use an $i that gets
incremented instead of the customer IDs.

 The problem is that as a sample I have two records from one demo customer
 (me) and I can only get my email to handle one record - either sending
 separate records for each record or one email covering the last record only
Not sure I understand what is going on..Could you post the code? 
It's kind of hard to troubleshoot code I can't see.

However, I can offer this suggestion.  Check your syntax.  Make sure
your loops have double equal signs, and be sure that the while loop
has a way of moving on in the records. (I didn't see anything like
that in the outline)

Also, you might want to try adding some echo statements in at the
various steps that output what is going to happen on the next line of
code.  That way you can see what it's doing, and how many times it's
doing it.  Even output the data in the table with a print_r to make
sure the data PHP has is the data you want it to loop through.  Adding
output to troubleshoot your code is always a good thing to do.

Take two of these and call me in the morning.  That is, try this
stuff, and if you can fix it, great.  If not, reply WITH CODE POSTED
and I'll be happy to tell you what I can, and I'm sure others will be
too.

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] FlashPHP Issue

2005-05-05 Thread disguised.jedi
 How I can get the width and height of a swf file with php?
http://www.php.net/ming

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php newbie question with xml files

2005-05-04 Thread disguised.jedi
 I have an xml document storing some data I need. What I want to do is this:
 1. Scan to the end of the file.
 2. Find the closing tag.
 3. Insert a new entry in before the closing tag.

There are specific classes and functions in the PHP core that can help
you do just this.

 I've tried:
 1. Creating new files and renaming them to be the original.
 2. Writing the file to a dummy file and insert my lines part way through
 then finish the last tag.

I don't think this is the right approach to take.  Maybe using the DOM
and/or the XML Parser built-in to php would help you.

 My problem is I'm looking for a /endtag and it comes up as endtag. Is
 there anyway to force PHP to read the .xml file as a text file so it wont
 strip off the xml tag information?
 
 I've used fopen with fgets and fwrite, and file with fwrite

Again, this isn't the approach to take.  There are built-in functions
for this sort of thing, as well as classes on PEAR that will help you.
 Try google!

Read through all of this and decide which approach you want to take
before you start anything...

If you use Windows or compile PHP as an Apache module in Linux, you're
all set with the XML Parser.  If not, you'll need to get the library
according to the directions in the manual.

http://www.php.net/xml

Read everything in that thoroughly, and understand it before you
continue with this approach.  Copy and play with the examples to see
how it all works.  If you'd rather handle things in an environment
designed to create and manipulate XML dynamically, rather than just
read and insert raw strings, keep reading.

You can get the DOM XML working easily in Windows, and even easier in
a GNOME environment on a linux box.  The manual has excellent
instructions.

http://www.php.net/domxml

This extension is Object-Oriented (OO), and if you don't know what
that is, you better read up on it before you try this out.  If you do,
and have an OK understanding of how OO works in PHP, then read on!  If
not, read the article

http://www.php.net/oop

Now, understand that DOM XML is very particular about the syntax and
such in an XML file.  The file MUST start with the XML declaration
(without quotes) ?xml version=1.0 in order for DOM to try and use
it.

Use the functions to read right through it all.  You'll find that this
is probably exactly what you need!

I'd use DOM XML personally.  I included the other in case you didn't
want to have to install everything.

Have fun, and good luck with PHP!

-- 
[EMAIL PROTECTED]

PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored. 
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is this possible in PHP?

2005-05-04 Thread disguised.jedi
 I want a script that can display a list of all the websites currently
 hosted on my server.. (i have root access to the server)

 Say I have a page sitesonmyserver.php..it shud show a list of all the
 websites hosted on my server..eg:
 abc.com
 xyz.om

 And any additional info if possible?

I'd make a script that went through the httpd.conf file with DOM and
pulled out all the virtual hosts.  Either that or looked at the home
directory listings for each site.  If this is what you were getting at
(seeing as you mentioned root access and what-not), then read the next
paragraph.  If not, you can skip the next paragraph.

This is quite a dangerous thing to do.  Giving PHP root access to your
server is like giving a homeless guy your credit card.  Anyone can
access the resources that PHP uses if they try hard enough.  You might
as well just hand every hacker on the web a little Post-It note with
your root password on it.

 Is such a thing possible in PHP.. or does any such script exists?

Definitely.  If you take the right approach!  I'd use a database.  You
could certainly find a class or script that could accomplish the
database lookup that would get what you wanted.

I'd start by reading the manual sections on mySQL database queries.

http://us4.php.net/mysql

Hope this helps!

--
The Disguised Jedi
[EMAIL PROTECTED]

Now you have my $0.02.  Or .01 Pounds, .014 Euros, or $0.025 CAN.  I'm
world-wide BABY!
PHP rocks!
Knowledge is Power.  Power Corrupts.  Go to school, become evil

Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php