php-general Digest 12 Aug 2004 11:46:50 -0000 Issue 2932
Topics (messages 193517 through 193537):
Re: MySQL & PHP Examples & Training Providers Required
193517 by: Justin Patrin
193532 by: Lester Caine
193537 by: Jay Blanchard
Re: scan a text string to pick up certain words
193518 by: Alex Shi
Escaping quotes
193519 by: Alex Hogan
193520 by: Justin Patrin
193525 by: Tom Rogers
193531 by: Justin Patrin
Re: PHP/MySQL based webmail?
193521 by: Hardik Doshi
193522 by: Justin Patrin
Query Question
193523 by: Karl-Heinz Schulz
193524 by: Jason Davidson
193526 by: Karl-Heinz Schulz
Encoding
193527 by: Kevin
193528 by: Jason Wong
phpBB, PHP5, MySQL 4, and IIS 6
193529 by: JNJ
193530 by: Jason Wong
mod rewrite urls
193533 by: Maris
193534 by: Ed Lazor
php+iptables
193535 by: Joel n.solanki
apache htaccess mod rewrite with php querystring urls
193536 by: raisinlove
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Wed, 11 Aug 2004 18:20:23 -0400, Lukasz Karapuda <[EMAIL PROTECTED]> wrote:
> Michael,
>
> My company has recently developed a Web site module for a local
> manufacturing company. The Web site module is a PHP and MySQL application
> composed of several screens and advanced engineering functionality
> (graphing, calculations etc). One of the database tables for the application
> has over 110,000 records.
>
> Why I chose to reply to your email is because PHP is not usually used for
> the development of more complex functionality like the Web site module that
> we have developed.
I beg to differ. Many large and complex sites are written in PHP.
There are also many large and complex programs written in PHP which
are in production use. Take TYPO3, for example: http://www.typo3.org
> The module performed well in testing. It has not been
> released for production yet, so I don't have a good performance report on
> the production version of the Web site module (with many concurrent users).
>
> I could provide you the URL to the Web site when it is released to
> production.
>
> Regards,
>
> --
> Lukasz Karapuda
> VP Application Development - newline Creations LLC
> > e-mail: [EMAIL PROTECTED]
> > http://www.thenewline.com
>
>
>
>
> > -----Original Message-----
> > From: Harlequin [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 7:07 PM
> > To: [EMAIL PROTECTED]
> > Subject: MySQL & PHP Examples & Training Providers Required
> >
> > Hi all.
> >
> > This might sound like a strange request but here goes.
> >
> > I'm looking for some examples of sites that are purely MySQL
> > and PHP running on Unix and that contain a few thousand
> > records preferably held in relational databases.
> >
> > Rationale:
> >
> > I need to justify PHP as a tool of choice over say vb.net or
> > Oracle. My recommendation, despite my limited knowledge of
> > MySQL and PHP is that even if we have 10-15 databases holding
> > upwards of 10,000 records each PHP and MySQL are the tools of
> > choice and I doubt that there are any functions missing that
> > you'd find in VB.Net. I could be wrong and if so, please let me know.
> >
> > My other question is that I am looking for training in the
> > UK, preferably in the North. I have no idea about
> > accreditation or certification requirements and wondered if
> > anyone could provide any recommendations...?
> >
> > Thanks for your time guys.
> >
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
--- End Message ---
--- Begin Message ---
Justin Patrin wrote:
On Wed, 11 Aug 2004 18:20:23 -0400, Lukasz Karapuda <[EMAIL PROTECTED]> wrote:
Why I chose to reply to your email is because PHP is not usually used for
the development of more complex functionality like the Web site module that
we have developed.
I beg to differ. Many large and complex sites are written in PHP.
There are also many large and complex programs written in PHP which
are in production use. Take TYPO3, for example: http://www.typo3.org
I'll second that, PHP is an excellent choice for website development -
especially when supported by the correct web server and database ;)
MANAGING a PHP project can be fun. Remember to track all changes to
EVERY file, but the ability to drop into a particular function and make
corrections and changes means that little niggles do not need to wait
for a full system update like we have with older Builder C++ based
applications.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
--- End Message ---
--- Begin Message ---
[snip]
> On Wed, 11 Aug 2004 18:20:23 -0400, Lukasz Karapuda
<[EMAIL PROTECTED]> wrote:
>>Why I chose to reply to your email is because PHP is not usually used
for
>>the development of more complex functionality like the Web site module
that
>>we have developed.
>
> I beg to differ. Many large and complex sites are written in PHP.
> There are also many large and complex programs written in PHP which
> are in production use. Take TYPO3, for example: http://www.typo3.org
I'll second that, PHP is an excellent choice for website development -
especially when supported by the correct web server and database ;)
[/snip]
I'll third this. Extremely complex applications are programmed using
PHP. I responded off list to Michael about this, but we are using PHP to
process and report on millions of records per day in MySQL databases.
--- End Message ---
--- Begin Message ---
It works the way as supposed :)
Thanks!
> On Wed, 11 Aug 2004 18:07:57 -0400, Alex Shi <[EMAIL PROTECTED]> wrote:
> > Hi All,
> >
> > I guess regex can do the trick but I don't know much about regex :((
> > Here is what I want:
> > Say a text string in which there're several words enclosed by "{"
> > and "}", for example {hellow}. I need to pick up each of the words
> > like this and print them or do some processing one by one.
> > Can any one please show me an example how to do this in PHP.
> > Thanks in advance!
> >
>
> preg_match_all('/{([^}]*)}/', $text, $matches);
> print_r($matches[1]);
>
> --
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder
>
> paperCrane --Justin Patrin--
--- End Message ---
--- Begin Message ---
Hi All,
I have this expression;
$query = "INSERT INTO $table (%s) VALUES (%s)";
$query = sprintf($query, implode(",", $fld), implode(",",
$val));
$result = mssql_query($query) or die($errmsg);
I am trying to insert values from an array into the database.
I keep getting the error that I can't pass column names in this context.
I know it's because I'm not enclosing $val in quotes.
I've tried a number of variations;
implode("\"","\"", $val)
implode("\',\'", $val)
implode(",", "\"".$val."\"") - This blows up nicely ;-)
Where am I going wrong on this?
alex hogan
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
--- End Message ---
--- Begin Message ---
On Wed, 11 Aug 2004 19:03:32 -0500, Alex Hogan
<[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have this expression;
> $query = "INSERT INTO $table (%s) VALUES (%s)";
> $query = sprintf($query, implode(",", $fld), implode(",",
> $val));
> $result = mssql_query($query) or die($errmsg);
> I am trying to insert values from an array into the database.
> I keep getting the error that I can't pass column names in this context.
> I know it's because I'm not enclosing $val in quotes.
> I've tried a number of variations;
> implode("\"","\"", $val)
> implode("\',\'", $val)
> implode(",", "\"".$val."\"") - This blows up nicely ;-)
>
> Where am I going wrong on this?
>
1) By using implode to do this
2) By not escaping quotes in the data
If you look in the PEAR::DB code, here's how they quote field names:
function quoteIdentifier($str)
{
return '[' . str_replace(']', ']]', $str) . ']';
}
and here's how they quote values:
function quoteSmart($in)
{
if (is_int($in) || is_double($in)) {
return $in;
} elseif (is_bool($in)) {
return $in ? 1 : 0;
} elseif (is_null($in)) {
return 'NULL';
} else {
return "'" . str_replace("'", "''", $in) . "'";
}
}
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
--- End Message ---
--- Begin Message ---
Hi,
Thursday, August 12, 2004, 10:03:32 AM, you wrote:
AH> Hi All,
AH> I have this expression;
AH> $query = "INSERT INTO $table (%s) VALUES (%s)";
AH> $query = sprintf($query, implode(",", $fld), implode(",",
AH> $val));
AH> $result = mssql_query($query) or die($errmsg);
AH> I am trying to insert values from an array into the database.
AH> I keep getting the error that I can't pass column names in this context.
AH> I know it's because I'm not enclosing $val in quotes.
AH> I've tried a number of variations;
AH> implode("\"","\"", $val)
AH> implode("\',\'", $val)
AH> implode(",", "\"".$val."\"") - This blows up nicely ;-)
AH> Where am I going wrong on this?
AH> alex hogan
You can do it this way but you must make sure that any strings in your
values array have been escaped before with mysql_escape_string() and
probably trimmed as well.
$fields = array('id','name','age');
$values = array(1,'Dave',40);
$table = 'test';
$sql = sprintf("INSERT INTO %s (%s) VALUES
('%s')",$table,implode(',',$fields),implode("','",$values));
echo $sql;
(It's perfectly ok to quote numbers)
--
regards,
Tom
--- End Message ---
--- Begin Message ---
On Thu, 12 Aug 2004 12:34:30 +1000, Tom Rogers <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Thursday, August 12, 2004, 10:03:32 AM, you wrote:
> AH> Hi All,
>
> AH> I have this expression;
> AH> $query = "INSERT INTO $table (%s) VALUES (%s)";
> AH> $query = sprintf($query, implode(",", $fld), implode(",",
> AH> $val));
> AH> $result = mssql_query($query) or die($errmsg);
> AH> I am trying to insert values from an array into the database.
> AH> I keep getting the error that I can't pass column names in this context.
> AH> I know it's because I'm not enclosing $val in quotes.
> AH> I've tried a number of variations;
> AH> implode("\"","\"", $val)
> AH> implode("\',\'", $val)
> AH> implode(",", "\"".$val."\"") - This blows up nicely ;-)
>
> AH> Where am I going wrong on this?
>
> AH> alex hogan
>
> You can do it this way but you must make sure that any strings in your
> values array have been escaped before with mysql_escape_string() and
> probably trimmed as well.
The question was about mssql, not mysql. using str_replace("'", "''",
$str) should work.
>
> $fields = array('id','name','age');
> $values = array(1,'Dave',40);
> $table = 'test';
>
> $sql = sprintf("INSERT INTO %s (%s) VALUES
> ('%s')",$table,implode(',',$fields),implode("','",$values));
> echo $sql;
>
> (It's perfectly ok to quote numbers)
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
--- End Message ---
--- Begin Message ---
Hi Chris,
Horde is little bit heavier than Squirrelmail. You can
buy a Zend acclerator to speed up the things.
I think your community is not that big and Horde works
fine in our organization where we have 1000 users and
all are pretty active.
Look and feel matters in the web mail so before you
make any decision then consider this issue as well.
Let me know if you need more information about Horde.
Thanks,
Hardik
--- Chris Shenton <[EMAIL PROTECTED]> wrote:
> "Matthew Sims" <[EMAIL PROTECTED]> writes:
>
> > Uh, well...Squirrelmail is simply a webpage. The
> number of simultaneous
> > users is defined by the web server application,
> aka Apache.
>
> Perhaps we view it differently. Apache is a web
> server. SquirrelMail
> and Horde are applications, written in PHP. I'm
> curious about user
> experiences deploying both, especially in terms of
> resource
> consumption and scalability.
>
>
> > IMAP doesn't HAVE to be on the same box. You can
> use SM to connect
> > to an another server running your mail.
>
> Yes. But both Squirrel and Horde must speak IMAP to
> the mail server,
> whether on localhost or remote. IMAP's nontrivial
> and introduces more
> load on the web app server than -- say -- a
> POP-based mail GUI. Or
> static web pages.
>
> I'm also quite interested in fault-tolerance. I can
> deploy a couple
> of physical boxes running SquirrelMail behind load
> balancers. But
> Squirrel stores stuff like user address books and
> preferences on the
> web server's disk; this obviously won't work in a
> load balanced
> arrangement where a client connection is just as
> likely to go to "the
> other" box. I could put the files on a back-end
> NetApp NFS server
> like I do for my (balanced) SMTP/IMAP mail servers;
> this may introduce
> NFS file locking problems and corruption by
> simultaneous access to the
> same NFS-resident file. (My SMTP/IMAP servers use
> Maildir to avoid NFS
> problems).
>
> Does Horde have these same implementation issues?
> How does it store
> preferences and such? It seems a much more
> resource-intensive
> application than the relatively simpler
> SquirrelMail, but I haven't
> done any benchmarks to compare the two.
>
>
> Basically it boils down to this question of web app
> scalability and
> resource needs: can I support a community of (say)
> 2500 people, where
> maybe 100 are actively using webmail at any given
> instant on a box
> like a Sun Netra running Slowaris with 1GB RAM? Or
> some 2GHz i86 box
> with 1GB running FreeBSD? If not, how are you folks
> worrying the
> scalability issue?
>
>
> While this isn't specifically a PHP question, I
> think scalability of
> PHP applications is germane to the list.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
--- End Message ---
--- Begin Message ---
On Wed, 11 Aug 2004 18:25:34 -0700 (PDT), Hardik Doshi
<[EMAIL PROTECTED]> wrote:
> Hi Chris,
>
> Horde is little bit heavier than Squirrelmail. You can
> buy a Zend acclerator to speed up the things.
You can also get the free TurckMMCache to cache the parsed PHP files.
>
> I think your community is not that big and Horde works
> fine in our organization where we have 1000 users and
> all are pretty active.
>
> Look and feel matters in the web mail so before you
> make any decision then consider this issue as well.
>
> Let me know if you need more information about Horde.
>
> Thanks,
> Hardik
>
>
> --- Chris Shenton <[EMAIL PROTECTED]> wrote:
>
> > "Matthew Sims" <[EMAIL PROTECTED]> writes:
> >
> > > Uh, well...Squirrelmail is simply a webpage. The
> > number of simultaneous
> > > users is defined by the web server application,
> > aka Apache.
> >
> > Perhaps we view it differently. Apache is a web
> > server. SquirrelMail
> > and Horde are applications, written in PHP. I'm
> > curious about user
> > experiences deploying both, especially in terms of
> > resource
> > consumption and scalability.
> >
> >
> > > IMAP doesn't HAVE to be on the same box. You can
> > use SM to connect
> > > to an another server running your mail.
> >
> > Yes. But both Squirrel and Horde must speak IMAP to
> > the mail server,
> > whether on localhost or remote. IMAP's nontrivial
> > and introduces more
> > load on the web app server than -- say -- a
> > POP-based mail GUI. Or
> > static web pages.
> >
> > I'm also quite interested in fault-tolerance. I can
> > deploy a couple
> > of physical boxes running SquirrelMail behind load
> > balancers. But
> > Squirrel stores stuff like user address books and
> > preferences on the
> > web server's disk; this obviously won't work in a
> > load balanced
> > arrangement where a client connection is just as
> > likely to go to "the
> > other" box. I could put the files on a back-end
> > NetApp NFS server
> > like I do for my (balanced) SMTP/IMAP mail servers;
> > this may introduce
> > NFS file locking problems and corruption by
> > simultaneous access to the
> > same NFS-resident file. (My SMTP/IMAP servers use
> > Maildir to avoid NFS
> > problems).
> >
> > Does Horde have these same implementation issues?
> > How does it store
> > preferences and such? It seems a much more
> > resource-intensive
> > application than the relatively simpler
> > SquirrelMail, but I haven't
> > done any benchmarks to compare the two.
> >
> >
> > Basically it boils down to this question of web app
> > scalability and
> > resource needs: can I support a community of (say)
> > 2500 people, where
> > maybe 100 are actively using webmail at any given
> > instant on a box
> > like a Sun Netra running Slowaris with 1GB RAM? Or
> > some 2GHz i86 box
> > with 1GB running FreeBSD? If not, how are you folks
> > worrying the
> > scalability issue?
> >
> >
> > While this isn't specifically a PHP question, I
> > think scalability of
> > PHP applications is germane to the list.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
--- End Message ---
--- Begin Message ---
Why does this query not work?
It should only show the eventdetails for the shown event.
----------------------------------------------------------------------------
-----------------------------
<?php
$event = mysql_query("select id, information from event where id=".$id);
?>
<?php
$eventdetail_query = mysql_query("select titles, informations, file_name
from eventdetail, event where eventdetail.event = event.id");
while($eventdetail = mysql_fetch_row($eventdetail_query)){
print("<span style=\"font-family: Arial, Helvetica,
sans-serif;font-size:12px;\"><a target=_blank
href=\"../PDF/$eventdetail[2]\"
class=\"decisions_links\">".strip_tags(html_decode($eventdetail[0]))."</a></
span>");
print(" <span style=\"font-family: Arial, Helvetica,
sans-serif;font-size:12px;\">".html_decode($eventdetail[1])."</span>");
}
?>
----------------------------------------------------------------------------
-----------------------------
TIA
Karl-Heinz
Tracking #: B3BFF38AEF0C854C96E9B501DD35C6C783308CA5
--- End Message ---
--- Begin Message ---
whats the error, are there any matching fields for the columns
eventetail.event and event.id?
Jason
"Karl-Heinz Schulz" <[EMAIL PROTECTED]> wrote:
>
> Why does this query not work?
> It should only show the eventdetails for the shown event.
>
> ----------------------------------------------------------------------------
> -----------------------------
>
> <?php
> $event = mysql_query("select id, information from event where id=".$id);
> ?>
> <?php
>
> $eventdetail_query = mysql_query("select titles, informations, file_name
> from eventdetail, event where eventdetail.event = event.id");
>
> while($eventdetail = mysql_fetch_row($eventdetail_query)){
>
>
> print("<span style=\"font-family: Arial, Helvetica,
> sans-serif;font-size:12px;\"><a target=_blank
> href=\"../PDF/$eventdetail[2]\"
> class=\"decisions_links\">".strip_tags(html_decode($eventdetail[0]))."</a></
> span>");
> print(" <span style=\"font-family: Arial, Helvetica,
> sans-serif;font-size:12px;\">".html_decode($eventdetail[1])."</span>");
>
> }
>
> ?>
>
> ----------------------------------------------------------------------------
> -----------------------------
>
>
> TIA
>
> Karl-Heinz
>
>
>
>
> Tracking #: B3BFF38AEF0C854C96E9B501DD35C6C783308CA5
>
>
--- End Message ---
--- Begin Message ---
I found my problem.
$eventdetail_query = mysql_query("select DISTINCT titles, informations,
file_name from eventdetail, event where eventdetail.event = ".$id);
-----Original Message-----
From: Karl-Heinz Schulz [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 10:13 PM
To: 'Jason Davidson'
Subject: RE: [PHP] Query Question
Oops - it shows all the "eventdetails" for all the "events"
-----Original Message-----
From: Jason Davidson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 10:10 PM
To: Karl-Heinz Schulz; [EMAIL PROTECTED]
Subject: Re: [PHP] Query Question
whats the error, are there any matching fields for the columns
eventetail.event and event.id?
Jason
"Karl-Heinz Schulz" <[EMAIL PROTECTED]> wrote:
>
> Why does this query not work?
> It should only show the eventdetails for the shown event.
>
>
----------------------------------------------------------------------------
> -----------------------------
>
> <?php
> $event = mysql_query("select id, information from event where id=".$id);
> ?>
> <?php
>
> $eventdetail_query = mysql_query("select titles, informations, file_name
> from eventdetail, event where eventdetail.event = event.id");
>
> while($eventdetail = mysql_fetch_row($eventdetail_query)){
>
>
> print("<span style=\"font-family: Arial, Helvetica,
> sans-serif;font-size:12px;\"><a target=_blank
> href=\"../PDF/$eventdetail[2]\"
>
class=\"decisions_links\">".strip_tags(html_decode($eventdetail[0]))."</a></
> span>");
> print(" <span style=\"font-family: Arial, Helvetica,
> sans-serif;font-size:12px;\">".html_decode($eventdetail[1])."</span>");
>
> }
>
> ?>
>
>
----------------------------------------------------------------------------
> -----------------------------
>
>
> TIA
>
> Karl-Heinz
>
>
>
>
> Tracking #: B3BFF38AEF0C854C96E9B501DD35C6C783308CA5
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
How can I encode my string using my own key? Is there any method to do this?
i.e. using base64_encode() and convert_uuencode() functions?
--
Kevin
--- End Message ---
--- Begin Message ---
On Wednesday 11 August 2004 22:19, Kevin wrote:
> How can I encode my string using my own key? Is there any method to do
> this?
>
> i.e. using base64_encode() and convert_uuencode() functions?
What are you trying to do? Those functions are meant to convert 8-bit binary
files into a something suitable for transmission over a 7-bit environment.
Hence using your own key doesn't make sense.
If you want to encrypt data then look at manual > Mcrypt Encryption Functions.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
QOTD:
"Lack of planning on your part doesn't consitute an emergency
on my part."
*/
--- End Message ---
--- Begin Message ---
Guys -- I'm getting a headache trying to install phpBB. I have IIS 6
(Win2K3), PHP 5, MySQL 4. Every install has the same result -- "The PHP
configuration on your server doesn't support the database type that you
chose"
I've d/led the PHP 5 patched version -- same results.
I've enabled the php_mysqli extension in PHP.INI and DISabled the php_mysql
extension -- same result.
I've played with permissions to no avail and so on. Always the same result.
I've even moved DLLs to the system32 folder, updated permissions on the
various folders as recommended, and so on.
Anyone have any suggestions?
--- End Message ---
--- Begin Message ---
On Thursday 12 August 2004 12:56, JNJ wrote:
> Guys -- I'm getting a headache trying to install phpBB. I have IIS 6
> (Win2K3), PHP 5, MySQL 4. Every install has the same result -- "The PHP
> configuration on your server doesn't support the database type that you
> chose"
> Anyone have any suggestions?
Ask the phpBB support forum.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The seven year itch comes from fooling around during the fourth, fifth,
and sixth years.
*/
--- End Message ---
--- Begin Message ---
Hi,
struggling with the following:
I have an URL
www.mycompany.com/index.php?id=10&a=1&b=2&c=3
What I want to do is using mod_rewrite have
www.mycompany.com/10/?a=1&b=2&c=3
Have tried the following rewrite rules in .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/([0-9]*)/\?(.+)$
RewriteRule ^([0-9]*)/\?(.+)$ get.php?id=$1&$2 [L]
But this doesnt work, something's wrong with "?", because if
I put in rule any alphabetical character, for example "Z" then
www.mycompany.com/10/Za=1&b=2&c=3 works fine
Thanks,
Maris
--- End Message ---
--- Begin Message ---
It might be easier to do something like
<Files view>
ForceType application/x-httpd-php
</Files>
Then you could have your url
http://mycompany.com/view/10/?a=1&b=2&c=3
You can do the same thing with / but the scope ends up pretty big and
creates a lot of extra unnecessary processing.
-Ed
> -----Original Message-----
> From: Maris [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 11:43 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] mod rewrite urls
>
> Hi,
>
> struggling with the following:
>
> I have an URL
>
> www.mycompany.com/index.php?id=10&a=1&b=2&c=3
>
> What I want to do is using mod_rewrite have
>
> www.mycompany.com/10/?a=1&b=2&c=3
>
> Have tried the following rewrite rules in .htaccess
>
> RewriteEngine on
>
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_URI} ^/([0-9]*)/\?(.+)$
> RewriteRule ^([0-9]*)/\?(.+)$ get.php?id=$1&$2 [L]
>
> But this doesnt work, something's wrong with "?", because if
> I put in rule any alphabetical character, for example "Z" then
> www.mycompany.com/10/Za=1&b=2&c=3 works fine
>
> Thanks,
> Maris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Dear all Gurus,
I have read little manul from www.php.net
I want to create web based firewall with php+iptables . Can any one give
me some documentation or guides or Examples ??I am using redhat linux
..all things are installed.
I have little understood that i need to use shell_exec and exec to run
linux command. I am very newbie to php even dont know html so i m having
tough days with php.
if any one could help me out.
any docs.
Regards,
--
Joel N.Solanki
Network Administrator
Phone No: 0265-550001/2/3/4/5 Ext: 211/212
Digtial 2 Virtual Internet Service Provider.
http://www.packetraptor.com/
http://www.d2visp.com/
Gujarat (India)
--- End Message ---
--- Begin Message ---
Hi, I realize this isnt specificaly related to php, but most php
developers are familiar with this.
My website uses an index.php file to load all content with a template,
using urls like so:
http://www.foo.com/index.php?page=splash.html
In the same directory, there is a file called splash.html, but what I
would like to do is that if the source file is called, the php file
would load instead. So typing in:
http://www.foo.com/splash.html
would bring up:
http://www.foo.com/index.php?page=splash.html
instead.
The solution I found was to use an .htaccess file, but it only brings up
a 403 forbidden access error everytime. ModRewrite is enabled, so what
could be the problem? Here is the code I used:
RewriteEngine on
RewriteBase /
RewriteRule ^[A-Za-z0-9]\.html$ /index.php?page=$1
thanks for your help :)
-steph
--- End Message ---