I tested this on PHP 4.2.3 and in my case return does break a while loop.
Jason
-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 3:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Will return break loop?
Really quick question. Will return
Example (not tested)
$fp = fopen('file.csv', 'r'); // open file for reading
while ($data = fgetcsv ($fp, 1000, ,)) { // read each line of file
if ($data[1] == $key) { // determine if key matches the current row
$name = $data[1]; // assign information to variables
Good idea but remember some people turn off javascript and cookies :)
Make your site as accessible as you can, using Jerry's suggestion is a good
idea and then accept some people will be bent on not being able to use your
site by disabling as much functionality in their browsers as they can or
It will probably behave the same way include does, which is correct
behavior.
$file=include(whatever) is telling php to store the result from include in
the $file variable, not storing a command in it.
You could do $file='include()', and then you would wind up with a variable
with whatever text
You need to tell PHP to input the value and you should be using 's
example:
input type=text name=driver length=20 value=?php echo
$_GET['driver']; ?
This example assumes you are using at least PHP 4.1, also you may use
$_REQUEST instead of $_GET if you are going to be using both GET and POST
It is not necessary for MySQL Server to run on the same server as your web
server, if the client is compiled you can connect to any MySQL server even
if it is not on the local machine.
Many hosts run seperate database servers on their LAN that you can connect
to from your host, or they may have
I've watched this thread now I'll comment because it applies to many other
things.
Yes even if you take some steps to protect your code it may still be
distributed, but it WILL be distributed if you don't.
Think about security, as a sysadmin I can't just not apply security updates,
you apply
Prior to submittal the PHP variable $maxa has no value. PHP is a server
side language, not a client side language.
If you want to use the value of a form in javascript use the javascript
objects to access the value of the field.
Jason
-Original Message-
From: ZILBER,LEONID
Chapter 3 in the PHP manual covers setting PHP configuration directives via
the .htaccess file.
I use this to enable register globals where needed so that I can keep it off
for the scripts that do not depend on them.
Jason
-Original Message-
From: Jeff Bearer [mailto:[EMAIL PROTECTED]]
You may also look at SSH port forwarding, this allows you to create an
encrypted tunnel between the two machines, then you connect to the local
port, the data gets encrypted sent across the wire and decrypted at the
destination.
Look at -L in your ssh man or search google for ssh tunneling
If I understand you properly this code will do what you want
?php
// data to write to file
$contents = 'your data goes here';
// filename base
$filename = 'name';
$startnum = '1';
// get new filename until the filename does not exist
while
Take a look at www.hotscripts.com
They probably have PHP form validiation and I know they have javascript form
validation.
Jason
-Original Message-
From: Tarjei Huse [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 1:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Form validation
I like ActiveState Komodo, it isn't free (I didn't find anything free that
did what I needed) but they do have a non commericial license and a trial
period. http://www.activestate.com.
Jason
-Original Message-
From: Lauri Vain [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 22, 2002
Rather than using true and false you can use 1, 0 it saves key strokes,
reduces script size, etc
Also use ' instead of if you don't need it evaluated by PHP.
if (custom_function) {
print 'Custom Function succeeded!';
} else {
print 'There was a problem!';
}
One thing I've
I assume form works correctly if you go directly to your index page.
You need to show us the html code for your form. Make sure your action=
is set properly.
If you are using PHP you need to show relevant code.
Please be more specific about your domain, www.mydomain.com/mypage.html does
not
You actually want
RewriteEngine on
RewriteBase /
RewriteRule *$ index.php
Jason
-Original Message-
From: [ rswfire ] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 4:20 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Would this work? (mod_rewrite)
This
And I fall victim to my own stupidity/cache again.
You actually want
RewriteEngine on
RewriteBase /
RewriteRule ^$ index.php
This works for me on my domain, you can check it out by going to
http://demo.shadotechdesigns.com and http://bug.shadonet.com
Jason
-Original Message-
From: [
Rather than executing a system utility you can just use the built in PHP
functions.
gethostbyaddr() - resolves an IP address into a hostname
gethostbyname() - resolves hostname into an IP address
More information is available in the PHP manual, you can access it online at
Make sure you are locking the file if you do this,
With a high amount of traffic text based counters don't usually work too
well because you have to deal with contention, what if two users view a page
at the same time, you will run into a corrupt or inaccurate number.
If you do file locking do
Have you tried using virtual() ?
virtual() is an Apache-specific function which is equivalent to !--#include
virtual...-- in mod_include. It performs an Apache sub-request. It is
useful for including CGI scripts or .shtml files, or anything else that you
would parse through Apache. Note that for
You could assign a randomly generated confirmation code to the link
for example
http://yoursitel.com/membershipconfirm.php?user=jsheetsconfirmid=1238D7adfd
a
Then when the user hits that link have membershipconfirm.php check the
database, confirm the user and the confirmid, if it matches remove
Make sure you have session_start() before any output is sent to the browser,
also look for whitespace at the top of your file, sometimes a blank line or
a space can cause this error.
The reason you get this error is session_start() needs to add information to
the headers but because they have
Hi Sean,
I'd suggest looking at some of the PHP and database tutorials available, for
the database you most likely would be interested in learning about MySQL, at
least at first. There are a lot of good resources on the PHP website at
http://www.php.net and good MySQL documentation available at
Hi Chris,
Have a look at
http://www.hotscripts.com/PHP/Scripts_and_Programs/Networking_Tools/Ping/
There are 3 ping scripts there.
Jason
-Original Message-
From: Chris Grigor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 8:48 AM
To: Php-General-List (E-mail)
Subject:
Hi Denis,
You need to give some more information, what database are you using, how is
your database table layed out? If you are using MySQL you need to use the
mysql_ functions, you can find out more about these in the PHP manual.
If you need some help getting started with PHP there are some
Not sure on the 404 part, you might look at CURL.
For the DNS part you could do
if (!gethostbyname(server1.dydns.org)) {
header (Location server2.dycns.org);
}
This function is in the PHP manual.
Jason
-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]]
Sent:
I'm currently running the SAPI module for apache on Windows NT and 2000,
works fine.
You can configure apache to only bind to the 127.0.0.1 IP address, this will
prevent requests being served over the network.
Jason
-Original Message-
From: Steve Clay [mailto:[EMAIL PROTECTED]]
Sent:
If your checkbox name was cbox setup as input type=checkbox name=cbox
value=true you could check for it like this
?php
// if you have PHP 4.1+ use this code
if ($_REQUEST['cbox'] == 'true') {
// do code
}
?
You could also just check to make sure that the box variable is set rather
than
Looking through the php.ini file brought me to the following setting:
; Check HTTP Referer to invalidate externally stored URLs containing ids.
;session.referer_check
I looked in the manual and found this explanation:
session.referer_check contains the substring you want to check each HTTP
They are much the same, both include a file.
To quote the PHP manual require() and include() are identical in every way
except how they handle failure. include() produces a Warning while require()
results in a Fatal Error. In other words, don't hesitate to use require() if
you want a missing
You can't send use setcookie after headers have been sent to the browser,
you can have white space in a php block because this is not sent to the
browser. The exception is if you have output buffering enabled.
Jason
From: qartis [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 13, 2002 5:14
On a Unix or Unix-like operating systems you should be able to do a df -i to
get a report on how many inodes are being used and the number remaining.
The output differs slightly from os to os but the base information should be
there.
Example output from FreeBSD 4.5 follows
Filesystem 1K-blocks
Hi Ron,
Look at the mysql_list_tables function, it looks like it will provide what
you are are looking for.
http://www.php.net/manual/en/function.mysql-list-tables.php is the link to
the manual
Jason
-Original Message-
From: Ron Clark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday,
I was looking for the same type of information a few weeks ago, I eventually
found what I was looking for in the phpbb system.
Here is the code that they used.
//put right after your first opening PHP tag
$mtime = microtime(); // page creation timers
$mtime = explode( ,$mtime);
You probably do not have register globals set to on, this is often times set
to off for security purposes. Instead you can use $_GET, $_POST, $SERVEr,
etc, these are documented on the PHP website.
Also instead of echoing all that HTML from PHP you should consider jumping
out of PHP and then use
Change it to == 1
if($current_month == 1)
Jason
-Original Message-
From: Jacob Walker [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] problem with working with dates
I'm sorry to bother the newsgroup with this, but I've been
36 matches
Mail list logo