On 4/9/07, Peter Lauri <[EMAIL PROTECTED]> wrote:
You might be able to do this by putting an .htaccess file in your webroot of
non-ssl:
--
RewriteEngine On
RewriteRule ^/(.*)$ https://www.yourdomain.com/$1 [L]
--
This appears to work:
RewriteEngine On
RewriteCond %{SERVER_PORT} !^44
On 4/9/07, Martin Marques wrote:
This should be done with the rewrite instruction of apache, or what ever
instructionyour web server has.
Um...guess I will have to check with our hosting company about this. Thanks.
- Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vis
What's the prescribed method for redirecting a user forcibly to from
the non-SSL secured version of a page to the SSL-secured version? Is
this handled at the web server level or at the script level. I found
this by googling:
{header("Location: https://".$_SERVER['SERVER_NAME'].$_SERVER
['S
I'm trying to build some functionality commonly seen on the web where
a user enters a zip code and they are provided with a listing of
business or entity locations sorted by geographical distance. I've got
a client with a distributor network and I need to create something
like this for them. They
On Jun 30, 2006, at 5:04 PM, Adam Zey wrote:
I mean, do this:
foreach ( array_keys($workArr) as $key ) {
echo $workArr[$key]['foo'];
}
instead of this:
foreach ( $workArr as $key => $value ) {
echo $value['foo'];
}
Okay, I think I get the idea.
So using my code example...
On 6/30/06, Adam Zey <[EMAIL PROTECTED]> wrote:
I think that will work, but there is one huge improvement you can make.
You are making millions of copies of your work array! Not only do you
pass the entire array by value recursively, but foreach makes copies of
the arrays it loops through! So wh
Thanks to everybody who posted on this thread. I wanted to post back
the solution I came up with after removing the DB query from the
recursion. In case anyone else is trying to accomplish the same thing,
this is how I solved it (criticisms welcome, and note that I have not
tested it extensively y
Hi Larry,
Thanks for the help. I was just coming to a similar conclusion last
night after reading the warnings on this thread about querying the
database recursively. I guess my test data with 7 posts is not a
rigorous simulation. :-)
I've looked through the posts on the PHP general list
On Jun 30, 2006, at 12:05 AM, Larry Garfield wrote:
I've written such a system before more than once. You do the
sorting in SQL,
and then traverse the data recursively in PHP to build the tree.
It's a
single SQL query. Check the archives for this list for about 3-4
weeks ago,
I think.
, almost. I read the article suggested by K.Bear and found the
recommended solution to be a bit more complicated than I wanted to
implement. I then found another way to do this using the existing
"Adjacency List Model" through a recursive function. So basically, you
query the database for the post
On 6/29/06, Adam Zey <[EMAIL PROTECTED]> wrote:
Just throwing an idea out there, but you can do the sorting entirely in
the SQL query. The trick is to figure out the best way.
The first idea that came to mind (and it sucks, but it works), is a text
field with padded numbers separated by dots, a
This question might deviate from PHP into the domain of MySQL but I
thought best to post here first. I'm building a message board system
with PHP/MySQL. I'm trying to present the messages to the users in
threaded order rather than flat. I'm having a lot of trouble figuring
out how to sort the post
ific reason for doing it, just wasn't sure what
the ramifications of having open sessions alive through the
maintenance period and afterward might be so I thought it best to just
kill them. It doesn't sound like anything horrible can happen except
some inconvenience maybe.
Regards, Adam
Ben Liu
/20/06, Adam Zey <[EMAIL PROTECTED]> wrote:
Ben Liu wrote:
> Hello All,
>
> I'm not sure this is strictly a PHP related question or perhaps a
> server admin question as well. What do you do when you are trying to
> shutdown a web application for maintenance (like a me
ance.php"
where maintenance.php could contain something like:
Down for MaintenanceSite down
for maintenance!
(Or, to be sure, you could do both.)
jon
Ben Liu wrote:
> Hello All,
>
> I'm not sure this is strictly a PHP related question or perhaps a
> server admin question as well.
Hello All,
I'm not sure this is strictly a PHP related question or perhaps a
server admin question as well. What do you do when you are trying to
shutdown a web application for maintenance (like a membership or
registration-required system)? I understand that you can temporarily
upload or activat
e items in a $_POST
array without rearranging the elements on the original form, or post-
processing them item by item.
Thanks for any insights...
- Ben
The script that processes the form looks like:
On Jun 9, 2006, at 7:12 PM, Richard Lynch wrote:
name="bool[0][careers
t be careful with associative arrays, I think before version
5.12.there was a bug, if you want that PHP makes an associative array
of form elements.
http://bugs.php.net/bug.php?id=37276
Enjoy
Mindaugas
On 6/9/06, Ben Liu <[EMAIL PROTECTED]> wrote:
Hi Mike,
Thanks for pointing that out. I
Hi Mike,
Thanks for pointing that out. I hadn't thought of it but you are
right. But I still don't think this addresses the issue of ordering.
The basic problem is that the way a $_POST variable gets processed is
in the order it is in on the original form. If you want to present the
fields in one
sorry, mysql_data_seek()
On 6/8/06, sam <[EMAIL PROTECTED]> wrote:
After I've looped through a resource do I have to run the query again
to load up 'mysql_fetch_assoc' or is there some kind of reset
function I can't find?
$q = "SELECT * FROM table;
$s = mysql_query($q, $pe) or die(mysql_error(
$query.="$key, ";
break;
case "ccc"
$query.="$key, ";
break;
}
}
In switch you can order by ordening the cases.
Hope help.
- Original Message -
From: "Ben Liu" <[EMAIL PROTECTED]>
To: "João Cân
Hello João,
You are right that the $_POST variable does not receive anything for
unchecked boxes. I didn't realize that. But I still need the foreach
loop for other reasons:
So it looks like this:
foreach ($_POST as $key => $data) {
$query.="$key, ";
}
Instead o
Der...of course. Thanks Ron! I knew the answer was simple. :-)
-Ben
On 6/8/06, Ron Clark <[EMAIL PROTECTED]> wrote:
why not create an array with the keys in the order you want ( $array=
array(value1,value2,). Then loop through the array and use the
values as keys to the $_POST variable and
Also, I need to re-order the elements in a custom manner, not simply
alphabetical or reverse alphabetical or some logical way like that,
more like how the original form is presented, by related fields. More
specifically, the form is for a membership system, the system collects
typical demographic
I probably should add some more details to my question:
The names of the form checkboxes could be changed from ie:
bool_careers, bool_speaking, bool_internship, etc. to a single array
bool_questions[], for instance. The problem with that is that I am
using the form checkbox names later to process
also, so having the loop allows
for some future-proofing.
- Ben
On 6/8/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:
On 08/06/06, Ben Liu <[EMAIL PROTECTED]> wrote:
You can access the values in the $_POST array in any order, so if you know
the checkbox names why not output them
Hello All,
I'm using a form (method="POST") to collect 30 boolean values from the
end user using a series of checkboxes in the form. The form is
arranged in a table so that the 30 check boxes are not a long list but
rather three columns (with related items columnized). The problem is
when I itera
Nevermind, got it to work with this:
while ([EMAIL PROTECTED]($result)) {
foreach ($_POST as $key => $data) {
if ($data) $output.="$row[$key]\t";
} // foreach $_POST
}// while $row
Had a poorly positioned statement throwing
I guess I was just "talking the problem out." :-)
Writing that post helped me think of iterating through $_POST. Now
I've come to this problem:
Before I did this and it works:
while ([EMAIL PROTECTED]($result)) {
if ($fieldname1) $output.="$row[fieldname1]\t";
if ($fieldname2)
Hello All,
I've written a clunky script that presents a form to a user with 30
checkboxes on it to match 30 fields in a table. The user checks off
each field they want to appear in a text file produced by the script.
The script I wrote captures each checkbox response to a separate
variabl
set the path myself, what would be a good location? (I assume
it should be outside the web space). Should I make up some random
folder name (one time) and story my session data within that
directory, within my own home directory?
Ben Liu wrote:
Hello All,
I'm using a single develo
Ach, correction: "Chuck is correct here." = "*Richard* is correct here."
No morning coffee yet, sorry.
- Ben
On Apr 20, 2006, at 7:22 PM, Richard Lynch wrote:
On Thu, April 20, 2006 1:46 pm, Ben Liu wrote:
After a bit more research, I think I understand why Joch
may make
them more difficult to find, but it does not guarantee security as
Chuck points out. This is discussed at [http://php.net/manual/en/
ref.session.php] as pointed out by Jochem.
- Ben
On Apr 20, 2006, at 7:22 PM, Richard Lynch wrote:
On Thu, April 20, 2006 1:46 pm, Ben Liu wrote
t; Let me know how you get on. I have encountered the session leakage issue
> before also and it scared the willies out of me.
>
>
> On 20/04/06, Ben Liu < [EMAIL PROTECTED]> wrote:
> > Hi Dave,
> >
> > Thanks, I think the method recommended by Robin using the func
Thanks Jochem, this should give me all I need to solve this problem. -Ben
On 4/20/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Ben Liu wrote:
> > Hi Dave,
> >
> > Thanks, I think the method recommended by Robin using the function
> > ini_set() would work, but some
/20/06, Dave Goodchild <[EMAIL PROTECTED]> wrote:
> You can use ini_set to alter this value locally (until the script exits) in
> the script itself, which saves having to use a separate ini file if that is
> the only value you want to change.
>
>
> On 20/04/06, Ben Liu &
Thanks for the response Robin, I'm reading up on session.cookie_path
now. It seems that this would require creating separate php.ini files
for each application.
On 4/20/06, Robin Vickery <[EMAIL PROTECTED]> wrote:
> On 20/04/06, Ben Liu <[EMAIL PROTECTED]> wrote:
> > He
Hello All,
I'm using a single development server to host multiple client
projects, many of which require session management. I've noticed that
sometimes when I test these various web apps (which are simply in
separate sub directories) I get session leakage where logging in and
establishing a sessi
I've been tinkering with AJAX for a few weeks now. I've used it in a
simple user registration system form. Instead of submitting a desired
username and waiting for a round trip to the server to verify that
the username is not already in use, I used AJAX to perform the DB
query in the backgr
39 matches
Mail list logo