php-general Digest 18 Dec 2003 02:40:50 -0000 Issue 2479
Topics (messages 172879 through 172921):
Re: mail question (mime)
172879 by: Bill Green
sql query and some math
172880 by: Patrik Fomin
172881 by: Jay Blanchard
172886 by: Sven
172898 by: Kim Steinhaug
Addslashes limit
172882 by: Cesar Cordovez
172884 by: Marek Kilimajer
172892 by: CPT John W. Holmes
Re: Inserting function into mail()???
172883 by: Eric Bolikowski
Re: Addslashes limit [SOLVED]
172885 by: Cesar Cordovez
Re: saving resource objects
172887 by: Leendert
mssql_connect problem
172888 by: Omar
172899 by: Mike Smith
PHP causing IE to crash
172889 by: Matt MacLeod
Re: Trying to make my session code smarter
172890 by: Chris Shiflett
172918 by: Gerard Samuel
172921 by: Chris Shiflett
Re: Comparison between Postnuke and PHPnuke
172891 by: YC Nyon
List-Unsubscribe
172893 by: Oksana Yasynska
Re: strange!
172894 by: manoj nahar
172895 by: Chris
Page Redirects - How can it be done
172896 by: Hunter, Jess
172897 by: Vail, Warren
172902 by: RT
172905 by: Matt Matijevich
php/mysql data display
172900 by: JLake
172901 by: Jay Blanchard
172903 by: JLake
172904 by: Jay Blanchard
Help need with image2wbmp() arguments
172906 by: Ivan Dermanov
CLI question
172907 by: Rodney Green
172908 by: Jay Blanchard
Quickform select element...
172909 by: Bobber
Levenshtein and Similar_Text Comparison
172910 by: Gohaku
Re: File upload problem
172911 by: Dino Costantini
172912 by: Dino Costantini
PHP LDAP query - need to add Exchange fields
172913 by: Ben Crothers
172915 by: Ben Crothers
Re: [apache-br] extension no RH9
172914 by: Mauricio
extension in RH9
172916 by: Mauricio
Re: PostNuke vs PHPNuke
172917 by: YC Nyon
172919 by: CPT John W. Holmes
Links of Tables from other DB
172920 by: KidLat Ngayon
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 ---
Thanks for your replies. Figured it out, just blind. The $headers were
written correctly (except for \r\n at end of lines though \n seems to work
in this case). The problem was in the call to the boundary, the boundary has
to start with -- outside the quoted string definition of the boundary, and
end same with -- at the end of the message.
--
Bill
--
--- End Message ---
--- Begin Message ---
Hi,
q1)
i got a database with 2 diffrent tables,
i want to take out all the information that arent duplicated from
on of the tables, like this:
$sql = "SELECT t1.rubrik, t1.info, t2.priser FROM table1 AS t1, table2 AS t2
WHERE t1.arkiv = '0' ORDER BY t1.rubrik";
the problem is that i got alot of duplicates (its for another purpose), so i
need to filter out the duplicates in the rubrik field to get just one match
each, like:
id - rubrik - info
0 - aaaa - some info
1 - bbbb - some info
2 - cccc - some info
3 - aaaa - some info
4 - dddd - some info
would print out
0 - aaaa - some info
1 - bbbb - some info
2 - cccc - some info
3 - dddd - some info
q2)
i got like 100 matches from a database into a $num variable,
then i want to devide that by 3 aslong as it can be done, eg:
while ($num != 0) {
ïf ($num / 3 = true){
some code to display some fields from a database
$num = $num - 3;
}
else {
some other code to display
$num = 0;
}
}
basicly i want the if statement to check if its more then 3 posts left to
print out, if not its gonna print out the remaining last 1 - 2 post in a
diffrent way (for the looks)
regards
patrick
--- End Message ---
--- Begin Message ---
[snip]
q1)
i got a database with 2 diffrent tables,
i want to take out all the information that arent duplicated from
on of the tables, like this:
$sql = "SELECT t1.rubrik, t1.info, t2.priser FROM table1 AS t1, table2 AS t2
WHERE t1.arkiv = '0' ORDER BY t1.rubrik";
[/snip]
It's a SQL question, but I'll answer...
$sql = "SELECT DISTINCT(t1.rubrik), t1.info, t2.priser FROM table1 AS t1, table2 AS t2
WHERE t1.arkiv = '0' ORDER BY t1.rubrik";
[snip]
q2)
i got like 100 matches from a database into a $num variable,
then i want to devide that by 3 aslong as it can be done, eg:
while ($num != 0) {
ïf ($num / 3 = true){
some code to display some fields from a database
$num = $num - 3;
}
else {
some other code to display
$num = 0;
}
}
basicly i want the if statement to check if its more then 3 posts left to
print out, if not its gonna print out the remaining last 1 - 2 post in a
diffrent way (for the looks)
[/snip]
if(($num / 3) == true)
Happy Holidays!
--- End Message ---
--- Begin Message ---
Patrik Fomin schrieb:
...
q2)
i got like 100 matches from a database into a $num variable,
then i want to devide that by 3 aslong as it can be done, eg:
while ($num != 0) {
ïf ($num / 3 = true){
some code to display some fields from a database
$num = $num - 3;
}
else {
some other code to display
$num = 0;
}
}
basicly i want the if statement to check if its more then 3 posts left to
print out, if not its gonna print out the remaining last 1 - 2 post in a
diffrent way (for the looks)
hi patrik,
for your second question maybe 'modulus' helps you.
<?php
$mod = $num % 3;
?>
gives you your remaining results (0, 1 or 2) depending on division by 3.
another possibility could be the use of 'limit' in your
sql-select-statement.
hth SVEN
--- End Message ---
--- Begin Message ---
Your first query, could it be that you dont have any reference between the
two tables?
You should have a link between them, like
where t1.id=t2id
Or else you do not have any reasonable way of predicting the outcome of the
query. Atleast this is what I know from my own experience.
Especially if t2 has more entries for each entry in t1, your query will
result
in unpredictable manner.
Hope this helps.
--
Kim Steinhaug
---------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
---------------------------------------------------------------
"Patrik Fomin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> q1)
> i got a database with 2 diffrent tables,
> i want to take out all the information that arent duplicated from
> on of the tables, like this:
>
> $sql = "SELECT t1.rubrik, t1.info, t2.priser FROM table1 AS t1, table2 AS
t2
> WHERE t1.arkiv = '0' ORDER BY t1.rubrik";
>
> the problem is that i got alot of duplicates (its for another purpose), so
i
> need to filter out the duplicates in the rubrik field to get just one
match
> each, like:
>
> id - rubrik - info
>
> 0 - aaaa - some info
> 1 - bbbb - some info
> 2 - cccc - some info
> 3 - aaaa - some info
> 4 - dddd - some info
>
> would print out
> 0 - aaaa - some info
> 1 - bbbb - some info
> 2 - cccc - some info
> 3 - dddd - some info
>
>
> q2)
> i got like 100 matches from a database into a $num variable,
> then i want to devide that by 3 aslong as it can be done, eg:
>
> while ($num != 0) {
>
> ïf ($num / 3 = true){
> some code to display some fields from a database
>
> $num = $num - 3;
> }
> else {
> some other code to display
> $num = 0;
> }
> }
>
> basicly i want the if statement to check if its more then 3 posts left to
> print out, if not its gonna print out the remaining last 1 - 2 post in a
> diffrent way (for the looks)
>
>
> regards
> patrick
--- End Message ---
--- Begin Message ---
HI!
Is it just me or addslahes truncates the result to 65535 chars? Any
comments? Or can it be that a blob field in a MySQL database is just
65535 chars, I don't think so...
Cesar.
--- End Message ---
--- Begin Message ---
Cesar Cordovez wrote:
HI!
Is it just me or addslahes truncates the result to 65535 chars? Any
comments? Or can it be that a blob field in a MySQL database is just
65535 chars, I don't think so...
Cesar.
BLOB is just 65535 chars. Use MEDIUMBLOB (2^24 bytes) or LONGBLOB (2^32
bytes). Also textarea field in browsers has a limit.
--- End Message ---
--- Begin Message ---
From: "Cesar Cordovez" <[EMAIL PROTECTED]>
> Is it just me or addslahes truncates the result to 65535 chars? Any
> comments? Or can it be that a blob field in a MySQL database is just
> 65535 chars, I don't think so...
Think again...
BLOB, TEXT L+2 bytes, where L < 2^16
MEDIUMBLOB, MEDIUMTEXT L+3 bytes, where L < 2^24
LONGBLOB, LONGTEXT L+4 bytes, where L < 2^32
---John Holmes...
--- End Message ---
--- Begin Message ---
"Tristan Pretty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ok, here's my code that I want to pick a random line from a text file, and
> then mail myself 10 times with a different line each time...
> But It simply won't work...
> Anyone know why?
>
> <?
> function randomline($filename) {
> $file = file($filename);
> srand((double)microtime()*1000000);
> $abc = $file[rand(0,count($file))];
> }
> $i = 0;
> while (2 > $i) {
> $abc = randomline('text.txt');
> mail("[EMAIL PROTECTED]", "$abc", "$abc", "From: [EMAIL PROTECTED]");
> $i++;
> }
> ?>
>
> <HTML>
> <BODY>
> Mails sent!
> </BODY>
> </HTML>
>
>
The problem in your code is that your function does'nt have a return
statement.
That means that $abc will contain nothing after
$abc = randomline('text.txt');
Here is the code that will work:
<?
function randomline($filename) {
$file = file($filename);
srand((double)microtime()*1000000);
return $file[rand(0,count($file))];
}
$i = 0;
while (2 > $i) {
$abc = randomline('text.txt');
mail("[EMAIL PROTECTED]", "$abc", "$abc", "From: [EMAIL PROTECTED]");
$i++;
}
?>
<HTML>
<BODY>
Mails sent!
</BODY>
</HTML>
--- End Message ---
--- Begin Message ---
Hi.
Turns out that addslashes is not guilty of truncating it's result.
Marek is right here. Changed the type of the field from BLOB to
LONGBLOB and everything works great!
Thanks!
Marek Kilimajer wrote:
Cesar Cordovez wrote:
HI!
Is it just me or addslahes truncates the result to 65535 chars? Any
comments? Or can it be that a blob field in a MySQL database is just
65535 chars, I don't think so...
Cesar.
BLOB is just 65535 chars. Use MEDIUMBLOB (2^24 bytes) or LONGBLOB (2^32
bytes). Also textarea field in browsers has a limit.
--- End Message ---
--- Begin Message ---
"Michael Lewis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I posted this on the PHP-DB list and then realized it was a more general
> question about PHP than DB so I am posting it here also hoping someone can
> help.
>
> I have a fairly common problem that I have not been able to find the
> solution for in the documentation and FAQs. I have to access a MSSQL box
> from a LAMP box using PHP. That part works fine (thank you freetds.org). I
> need to display results from user queries 10 at a time with the basic NEXT
> and BACK logic. I can use the mssql_data_seek function to move amongst the
> record set. The problem is how do I save the results variable between web
> page updates? I cannot save the record set variable in my session because
it
> always returns as zero. Consider the following code:
>
> <?php
> session_start();
> include("localsettings.php");
> $s = mssql_connect($Server, $User, $Pass) or die("Couldn't connect to SQL
> Server on $Server");
> mssql_select_db($SDB, $s) or die("Couldn't open database $SDB");
> $sql="select * from products where prod_id='95038'";
> $ress=mssql_query($sql) or die(mssql_get_last_message());
> $_SESSION['ress']=$ress;
> print $ress."\n";
> $ress=$_SESSION['ress'];
> print $ress."\n";
> ?>
>
> The first time I print RESS is comes back as RESOURCE OBJECT #12, the
second
> time as 0. When I look in the session file, it is zero.
>
> Help!
>
> How can I pass this variable and its contents so they are usable to the
next
> web page?
>
> Thanks in advance.
>
> Michael
Although still in beta phase, you might want to have a look at what SRM
could do for you. www.vl-srm.net
--- End Message ---
--- Begin Message ---
Hello.
I have a sql server named CLUSTER01 (on win 2k servers, iis, etc), i try to
connect to it :
$db_conn = mssql_connect("CLUSTER01", $db_usuario, $db_password);
and it gives me this message:
Warning: 0 is not a MS SQL link index in x
The user name and password are correctly created in the logins of the sql
server.
What else could be?
Thank you for your help.
--- End Message ---
--- Begin Message ---
Omar wrote:
Hello.
I have a sql server named CLUSTER01 (on win 2k servers, iis, etc), i try to
connect to it :
$db_conn = mssql_connect("CLUSTER01", $db_usuario, $db_password);
and it gives me this message:
Warning: 0 is not a MS SQL link index in x
The user name and password are correctly created in the logins of the sql
server.
What else could be?
Thank you for your help.
Have you tried:
Maybe substitute sa for the user and the sa password (JUST FOR TESTING).
Try the FQDN of the server, or just put the IP address.
$server = "server.domain.com";
$user = "dbuser";
$password = "dbpassword";
mssql_connect($server,$user,$password);
Check php.ini, uncomment out
extension=php_mssql.dll
If your running php on a server that does not have SQL Server on it, I
think at least you need to install the SQL client tools.
Good luck!
Mike Smith
--- End Message ---
--- Begin Message ---
Hi,
I posted recently regarding a PHP script that crashed Internet
Explorer. The crash continued to occur until I removed any use of
sessions in my scripts. The pages seem to work fine now, but of course
I have lost the sessions functionality.
Does anybody have any suggestions why Sessions would cause this crash,
and if so, whether or not there are any work arounds.
This only occured in IE6 on Win XP.
Thanks,
Matt
--- End Message ---
--- Begin Message ---
--- Gerard Samuel <[EMAIL PROTECTED]> wrote:
> On Wednesday 17 December 2003 01:33 am, Justin Patrin wrote:
> > You can turn on URL rewriting for sessions. I'm not sure where it
> > is just now....just search the PHP docs.
>
> Yes I know about this feature.
> Unfortunately, its an insecure feature.
You can use GET data, POST data, or cookies. Since these users opt to not
use cookies, and you seem to not want to use GET data, I suppose passing
the information via POST is the only option left. :-)
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
On Wednesday 17 December 2003 11:58 am, Chris Shiflett wrote:
> You can use GET data, POST data, or cookies. Since these users opt to not
> use cookies, and you seem to not want to use GET data, I suppose passing
> the information via POST is the only option left. :-)
>
Its not that I dont want to use GET, Im just heeding the warning about its
insecurities from the manual.
The code Im writing, is meant for others to use, and may not have access to
ini directives.
But from what I've read in the archives (http://
marc.theaimsgroup.com/?l=php-general&m=107116421414558&w=2), that
something may be doable within my code.
Ill let it sit on the brain for a bit, and see what needs to be done,
where I can "safely" use the url rewriting feature, for this small
pecentage of users...
Thanks
--- End Message ---
--- Begin Message ---
--- Gerard Samuel <[EMAIL PROTECTED]> wrote:
> Its not that I dont want to use GET, Im just heeding the warning about
> its insecurities from the manual. The code Im writing, is meant for
> others to use, and may not have access to ini directives. But from what
> I've read in the archives
> (http://marc.theaimsgroup.com/?l=php-general&m=107116421414558&w=2),
> that something may be doable within my code. Ill let it sit on the
> brain for a bit, and see what needs to be done, where I can "safely"
> use the url rewriting feature, for this small pecentage of users...
There is an article on session security in PHP Magazine's free PDF:
http://www.phpmag.net/ssl/phppdf/
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
--- End Message ---
--- Begin Message ---
I am comparing between this two php-based CMS?
My focus is really
1. the availability of modules/add-ons.
Not too sure, but seems PHPnuke has more add-ons than Postnuke.
2. ease of maintaining a group of contributors/writers
Nyon
--- End Message ---
--- Begin Message ---
__
This communication is intended for the use of the recipient to whom it
is addressed, and may contain confidential, personal, and or privileged
information. Please contact us immediately if you are not the intended
recipient of this communication, and do not copy, distribute, or take
action relying on it. Any communications received in error, or
subsequent reply, should be deleted or destroyed.
---
--- End Message ---
--- Begin Message ---
Change this line
if($dowork) {
to
if($_POST[dowork]) {
it should work the. In your php.ini the variable register_gloabal seem
to be off.
Manoj Nahar
Tom Holton wrote:
Hello everyone,
I looked through the FAQs and documentation and I cannot find this
anywhere:
We have a new Redhat server with this kernal: 2.4.20-20.9smp #1 SMP
We used redhat itself to install apache and php (I used to always do it by
hand)
apache: Server version: Apache/2.0.40
PHP Version 4.2.2
I found the PHP version out by making a file containing: <?phpinfo()?>
I also can get statements like
print "something"
and even
$TT =TRUE;
if($TT) print "something else";
to work.
But, incredibly to me, I cannot get form variables to be sent and "seen".
See the end of the email for the example script.
I can take this very simple script that does not work on this new server
and have it work on my current server which is running PHP Version 4.1.2
and Apache Server version: Apache/1.3.22 (Unix)
I saw that there were incompatibility issues with PHP's prior to version
4.2.3 with Apache 2.0, but, since I can get some statements to work, and
it is only because the form variables are not recognized, I thought it
must be some new directive in httpd.conf of php.ini
Any help or info on this is much appreciated!
<?php
$TT=TRUE;
if($TT) print "TT worked";
if($dowork) {
print "<br>These statements do not print when the dowork button is
pushed";
print "<br>Field 1: $fld1";
print "<br>Field 2: $fld2";
print "<br>Field 3: $fld3";
}
print "<BR>this statement prints";
?>
<form name=asd method=POST>
<br><input name=fld1 size=12>
<br><input name=fld2 size=12>
<br><input name=fld3 size=12>
<br><input type=submit name=dowork value='do work'>
</form>
?>
--- End Message ---
--- Begin Message ---
That should be $_POST['dowork'] , $_POST[dowork] will attempt to use dowork
as a constant
-----Original Message-----
From: manoj nahar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 10:51 AM
To: Tom Holton
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] strange!
Change this line
if($dowork) {
to
if($_POST[dowork]) {
it should work the. In your php.ini the variable register_gloabal seem
to be off.
Manoj Nahar
Tom Holton wrote:
>Hello everyone,
>I looked through the FAQs and documentation and I cannot find this
>anywhere:
>
>We have a new Redhat server with this kernal: 2.4.20-20.9smp #1 SMP
>We used redhat itself to install apache and php (I used to always do it by
>hand)
>apache: Server version: Apache/2.0.40
>PHP Version 4.2.2
>
>I found the PHP version out by making a file containing: <?phpinfo()?>
>
>I also can get statements like
>
>print "something"
>
>and even
>
>$TT =TRUE;
>if($TT) print "something else";
>
>to work.
>But, incredibly to me, I cannot get form variables to be sent and "seen".
>See the end of the email for the example script.
>
>I can take this very simple script that does not work on this new server
>and have it work on my current server which is running PHP Version 4.1.2
>and Apache Server version: Apache/1.3.22 (Unix)
>
>I saw that there were incompatibility issues with PHP's prior to version
>4.2.3 with Apache 2.0, but, since I can get some statements to work, and
>it is only because the form variables are not recognized, I thought it
>must be some new directive in httpd.conf of php.ini
>
>Any help or info on this is much appreciated!
>
>
><?php
>
>$TT=TRUE;
>if($TT) print "TT worked";
>
>if($dowork) {
> print "<br>These statements do not print when the dowork button is
>pushed";
> print "<br>Field 1: $fld1";
> print "<br>Field 2: $fld2";
> print "<br>Field 3: $fld3";
>}
>
>
>print "<BR>this statement prints";
>
>?>
>
><form name=asd method=POST>
><br><input name=fld1 size=12>
><br><input name=fld2 size=12>
><br><input name=fld3 size=12>
><br><input type=submit name=dowork value='do work'>
></form>
>
>?>
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I have created a simple login/authentication script to help protect some of
my PHP pages. Here is where I am running into a little trouble in
understanding.
Let's Say I have the following pages protected
Page1.php
Page2.php
Page3.php
If the user is not logged in, the "inc." file will send them to login.php,
upon proper log in, it will shoot the person over to Page1.php.
But let's say the user tries to go to Page3.php, the script will send them
to the login.php page, which will then send them to Page1.php. How could I
go about making it so if the person is trying to goto page3.php, that after
proper login, they will be directed to page3.php and not page1.php?
Thanks in advance for any assistance
Jess
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
--- End Message ---
--- Begin Message ---
Have you considered Sessions
http://www.php.net/manual/en/ref.session.php
Warren Vail
-----Original Message-----
From: Hunter, Jess [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 11:04 AM
To: PHP - General List
Subject: [PHP] Page Redirects - How can it be done
I have created a simple login/authentication script to help protect some of
my PHP pages. Here is where I am running into a little trouble in
understanding.
Let's Say I have the following pages protected
Page1.php
Page2.php
Page3.php
If the user is not logged in, the "inc." file will send them to login.php,
upon proper log in, it will shoot the person over to Page1.php.
But let's say the user tries to go to Page3.php, the script will send them
to the login.php page, which will then send them to Page1.php. How could I
go about making it so if the person is trying to goto page3.php, that after
proper login, they will be directed to page3.php and not page1.php?
Thanks in advance for any assistance
Jess
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
What if you use something like SourceForge. If you try to access a page
the requires you to be logged in when it redirects you to the login page
it includes in the URL the page that the user tried to access
(ie login.php?redirect=page3.php) Then when the user successfully logs
in they redirect to the page. If it's not set the go to page1.php.
On Wed, 2003-12-17 at 14:04, Hunter, Jess wrote:
> I have created a simple login/authentication script to help protect some of
> my PHP pages. Here is where I am running into a little trouble in
> understanding.
>
> Let's Say I have the following pages protected
>
> Page1.php
> Page2.php
> Page3.php
>
> If the user is not logged in, the "inc." file will send them to login.php,
> upon proper log in, it will shoot the person over to Page1.php.
>
> But let's say the user tries to go to Page3.php, the script will send them
> to the login.php page, which will then send them to Page1.php. How could I
> go about making it so if the person is trying to goto page3.php, that after
> proper login, they will be directed to page3.php and not page1.php?
>
> Thanks in advance for any assistance
>
> Jess
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
"I have a photographic memory. I just forgot the film" --Unknown
=============================
Ryan Thompson
[EMAIL PROTECTED]
http://osgw.sourceforge.net
--- End Message ---
--- Begin Message ---
<snip>
What if you use something like SourceForge. If you try to access a
page
the requires you to be logged in when it redirects you to the login
page
it includes in the URL the page that the user tried to access
(ie login.php?redirect=page3.php) Then when the user successfully logs
in they redirect to the page. If it's not set the go to page1.php.
</snip>
just grab the $_SERVER['REQUEST_URI'] when they try to access a page
that they need to be logged in to see. Save it in a session variable or
include it in a redirect get variable and redirect them to the login
page. Once they have looged in grab the session variable or the get
variable and redirect them to the proper place.
--- End Message ---
--- Begin Message ---
I have a small database that I want to display data from. in such a way that
it shows shows in a table with the table header being the department
category and the table cells being the categories for each department. I
have no problem connecting to the database) I imagine that I will need
nested loops, but I haven't seen a tutorial showing quite what I am looking
for. If anyone can point me in the right direction that would be great.
--- End Message ---
--- Begin Message ---
[snip]
I have a small database that I want to display data from. in such a way
that it shows shows in a table with the table header being the
department category and the table cells being the categories for each
department. I have no problem connecting to the database) I imagine that
I will need nested loops, but I haven't seen a tutorial showing quite
what I am looking for. If anyone can point me in the right direction
that would be great.
[/snip]
Probably just a good query would do. Show us some data in its storage
format and then show us an example of what you want the output to be. We
can then go from A to B. Until then your question is rather vague.
--- End Message ---
--- Begin Message ---
Data is as such right now for testing purposes:
ID, catName, catLink, catDepartment.
I will have multiple instances of the same text in catDepartment. I realize
this is a fopaux. I'm just trying to do a quick fix.
none the less I want the data formatted like this:
DEPARTMENT NAME 1(catDepartment) DEPARTMENT NAME...n(catDepartment)
-------------------------------------------- -------------------------
--------------------
Category1(catName)
Category1(catName)
Category2(catName)
Category2(catName)
Category...n(catName)
Category...n(catName)
hopefully this makes things less vague.
Thanks,
J.
"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
I have a small database that I want to display data from. in such a way
that it shows shows in a table with the table header being the
department category and the table cells being the categories for each
department. I have no problem connecting to the database) I imagine that
I will need nested loops, but I haven't seen a tutorial showing quite
what I am looking for. If anyone can point me in the right direction
that would be great.
[/snip]
Probably just a good query would do. Show us some data in its storage
format and then show us an example of what you want the output to be. We
can then go from A to B. Until then your question is rather vague.
--- End Message ---
--- Begin Message ---
[snip]
Data is as such right now for testing purposes:
ID, catName, catLink, catDepartment.
I will have multiple instances of the same text in catDepartment. I
realize
this is a fopaux. I'm just trying to do a quick fix.
none the less I want the data formatted like this:
DEPARTMENT NAME 1(catDepartment) DEPARTMENT
NAME...n(catDepartment)
--------------------------------------------
-------------------------
--------------------
Category1(catName)
Category1(catName)
Category2(catName)
Category2(catName)
Category...n(catName)
Category...n(catName)
[/snip]
You need a crosstab query in SQL. Please search google for "crosstab
query".
--- End Message ---
--- Begin Message ---
There is a problem with PHP 4.3.4 under Windows by image2wbmp() example from PHP
Manual.
Example 1. image2wbmp() example
-------------------------------------------------------------------------------------------
<?php
$file = 'php.jpg';
header('Content-type: ' . image_type_to_mime(IMAGETYPE_WBMP));
image2wbmp($file); // output the stream directly
?>
-------------------------------------------------------------------------------------------
First of all, the header must be:
header ("Content-type: ".image_type_to_mime_type (IMAGETYPE_WBMP));
The second, I do not understand why this don't work:
<?php
$file = 'php.jpg';
header ("Content-type: ".image_type_to_mime_type (IMAGETYPE_WBMP));
image2wbmp($file);
?>
by reporting:
"image2wbmp(): supplied argument is not a valid Image resource"!?
This is working correctly but there is not the same result as in example above:
<?php
$file = 'php.jpg';
jpeg2wbmp($file,"php.wbmp",64,120,4);
?>
Is it bug in image2wbmp() or something with my php setings is wrong?
Ivan Dermanov,
[EMAIL PROTECTED]
17.dec.2003.
Belgrade,
--- End Message ---
--- Begin Message ---
I'm using the CLI version 4.3.4 on Windows XP Pro. The script I'm
writing has only a couple of functions, a couple of "if" conditionals
and a "while" loop. At the very top of the script I have an echo
statement with a message I want printed to the console window. The
problem is that it's not echoed until all of the functions and other
stuff is executed. Why is this the case? Anything I can do to get the
echo statement to run first thing?
Thanks,
Rod
--- End Message ---
--- Begin Message ---
[snip]
I'm using the CLI version 4.3.4 on Windows XP Pro. The script I'm
writing has only a couple of functions, a couple of "if" conditionals
and a "while" loop. At the very top of the script I have an echo
statement with a message I want printed to the console window. The
problem is that it's not echoed until all of the functions and other
stuff is executed. Why is this the case? Anything I can do to get the
echo statement to run first thing?
[/snip]
Use output buffering and flush the echo statement ....
http://us2.php.net/manual/en/function.flush.php
--- End Message ---
--- Begin Message ---
I'm trying to get familiar with quickform in the Pear HTML module. I
have a form with a select box created like this:
$form->addElement('select', 'nickname', 'Is this a nickname?',
array(1 => 'Yes', 0 => 'No') );
Now, how do I tell the select box to use the default value of 'No'?
--- End Message ---
--- Begin Message ---
Hi everyone,
I have been using the levenshtein function and similar_text function to
evaluate which is the better function to use.
I have read that the levenshtein function runs faster than similar_text.
I haven't noticed any runtime differences but I have noticed that
levenshtein seems to be more accurate.
Since the levenshtein function is based on Edit Distances and
similar_text is based on Decision Trees, I'm wondering when and why
similar_text would be used instead of levenshtein.
Thanks.
-gohaku
--- End Message ---
--- Begin Message ---
sto cercando di scrivere una pagina per l'upload di file, ho copiato dei sorgenti ma
non funzionano. queste sono le pagine:
-----form.html--------
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="upfile">
<input type="hidden" name="MAX_FILE_SIZE" value="10000">
<input type="submit" value="Invia il file">
</form>
--------upload.php-----------
<?php
// QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
// DI PHP PRECEDENTI ALLA 4.1.0
if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
/********************* VARIABILI DA SETTARE ********************/
// Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
$upload_dir = $_SERVER["DOCUMENT_ROOT"] . "/esempi";
// Eventuale nuovo nome da dare al file uploadato
$new_name = "ciao.dino";
// Se $new_name è vuota, il nome sarà lo stesso del file uploadato
$file_name = ($new_name) ? $new_name : $_FILES["upfile"]["name"];
if(trim($_FILES["upfile"]["name"]) == "") {
die("Non hai indicato il file da uploadare !");
}
if(@is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
@move_uploaded_file($_FILES["upfile"]["tmp_name"], "$upload_dir/$file_name")
or die("Impossibile spostare il file, controlla l'esistenza o i permessi della
directory
dove fare l'upload.");
} else {
die("Problemi nell'upload del file " . $_FILES["upfile"]["name"]);
}
echo "L'upload del file " . $_FILES["upfile"]["name"] . " è avvenuto correttamente";
?>
-----------------------
non carica nulla e non restituisce alcun input, se cerco di visualizzare l'html, dal
browser, di upload.php mi scrive il codice php. non penso sia un problema del server
http perchè nella stessa cartella ci sono pagine php che esegue correttamente.
grazie per qualsiasi aiuto.
--- End Message ---
--- Begin Message ---
i'm trying to write a page which allows user to upload file. theese are my
sources but they didn't work, anyone could help me?
-----form.html--------
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="upfile">
<input type="hidden" name="MAX_FILE_SIZE" value="10000">
<input type="submit" value="Invia il file">
</form>
--------upload.php-----------
<?php
// QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
// DI PHP PRECEDENTI ALLA 4.1.0
if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
/********************* VARIABILI DA SETTARE ********************/
// Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
$upload_dir = $_SERVER["DOCUMENT_ROOT"] . "/esempi";
// Eventuale nuovo nome da dare al file uploadato
$new_name = "ciao.dino";
// Se $new_name è vuota, il nome sarà lo stesso del file uploadato
$file_name = ($new_name) ? $new_name : $_FILES["upfile"]["name"];
if(trim($_FILES["upfile"]["name"]) == "") {
die("Non hai indicato il file da uploadare !");
}
if(@is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
@move_uploaded_file($_FILES["upfile"]["tmp_name"], "$upload_dir/$file_name")
or die("Impossibile spostare il file, controlla l'esistenza o i permessi
della directory
dove fare l'upload.");
} else {
die("Problemi nell'upload del file " . $_FILES["upfile"]["name"]);
}
echo "L'upload del file " . $_FILES["upfile"]["name"] . " è avvenuto
correttamente";
?>
-----------------------
upload.php doesn't upload anything and doesn't output any error message. i
don't think it's an apache problem, because this is the only page that
doesn't work.
--- End Message ---
--- Begin Message ---
Hoping this is an easy question to answer, apologise upfront if this is so
basic, but just been put in charge of a PHP app with LDAP interface to M$
Exchange, and trying to figure out how it works.
At the moment it works fine and extracts fields like first- and surname,
title, department, etc. I need to add the 'office' field, and added it at
the end of this filter line:
---------------------------------------------------
$filter =
"(|(sn=$search[$i]*)(givenname=$search[$i]*)(title=$search[$i]*)(department=
$search[$i]*)(office=$search[$i]*))";
----------------------------------------------------
...but so far it's not working. I *know* there's data in the 'office'
field -- any ideas as to what I'm missing?
Thanks a lot in advance,
Ben
--- End Message ---
--- Begin Message ---
Hoping this is an easy question to answer, apologise upfront if this is so
basic, but just been put in charge of a PHP app with LDAP interface to M$
Exchange, and trying to figure out how it works.
At the moment it works fine and extracts fields like first- and surname,
title, department, etc. I need to add the 'office' field, and added it at
the end of this filter line:
---------------------------------------------------
$filter =
"(|(sn=$search[$i]*)(givenname=$search[$i]*)(title=$search[$i]*)(department=
$search[$i]*)(office=$search[$i]*))";
----------------------------------------------------
...but so far it's not working. I *know* there's data in the 'office'
field -- any ideas as to what I'm missing?
Thanks a lot in advance,
Ben
--- End Message ---
--- Begin Message ---
Hello All!
I installed Oracle 9i and it's working perfectly. I use a linux server to
connect using a client in this other machine.
I need to put HTTPD 2.0.40, PHP 4.2.2, Oracle 9i working together on a
RedHat 9...
Hardly, searching on the web, I could compile the oracle.so module using the
same version of php and httpd I have. It compiled with no errors and I got
the oracle.so and oracle.la on modules directory.
Looking for what I should do next, I read .ini of PHP on how to make that
module works. So, as it says, a copied the module in the extension_dir
(/usr/lib/php4) and created a oracle.ini in /etc/php.d.
Even when I restart the service or restart the computer I still get the same
error message:
Fatal error: Call to undefined function: ocilogon() in
/var/www/html/teste_db.php on line 18
I compiled the module, in this case, because I would like to let apache with
all modules that it is installed now.
Am I forgeting someting here to make it works?
Somebody could help me with it???
Thanks people!
Maurício
----- Original Message -----
From: "Mauricio" <[EMAIL PROTECTED]>
To: <Undisclosed-Recipient:@agp5.com.br;>
Sent: Wednesday, December 17, 2003 9:25 PM
Subject: [apache-br] extension no RH9
> Olá Todos!
>
> Estou com o Oracle 9i instalado e funcionando corretamente sendo acessado
de
> uma outra máquina Linux;
> RedHat 9.0
> A versão do httpd é a 2.0.40 e o PHP é o 4.2.2.
>
> Com muito custo, consegui compilar a biblioteca do oracle como uma
extension
> para o php/apache. O módulo é criado sem problemas e ele encontra todas as
> bibliotecas do oracle no $ORACLE_HOME.
>
> Meu problema é que não estou conseguindo carregar este módulo nem pelo
> APACHE e nem pelo PHP.
>
> Lendo os comentarios dos .conf e .ini do PHP vi que é necessário criar um
> arquivo chamado oracle.ini no diretório /etc/php.d e colocar o módulo
> oracle.so no extension_dir (/usr/lib/php4).
>
> Mas mesmo assim reiniciando o httpd o Apache/PHP relata o mesmo erro:
>
> Fatal error: Call to undefined function: ocilogon() in
> /var/www/html/teste_db.php on line 18
>
> Será que existe mais alguma coisa a ser feita para que o Apache/Php
> encontrem as bibliotecas compartilhadas do Oracle?
>
> Alguém pode me ajudar?
>
> Obrigado!
>
> Maurício
>
>
>
> http://linuxserver.linuxsecurity.com.br
>
> Para cancelar sua assinatura envie um e-mail para:
> [EMAIL PROTECTED]
>
> Para mandar e-mail ao Moderador:
> [EMAIL PROTECTED] ou
> [EMAIL PROTECTED]
>
>
>
>
> Seu uso do Yahoo! Grupos é sujeito às regras descritas em:
http://br.yahoo.com/info/utos.html
>
--- End Message ---
--- Begin Message ---
Hello All!
I installed Oracle 9i and it's working perfectly. I use a linux server to
connect using a client in this other machine.
I need to put HTTPD 2.0.40, PHP 4.2.2, Oracle 9i working together on a
RedHat 9...
Hardly, searching on the web, I could compile the oracle.so module using
the
same version of php and httpd I have. It compiled with no errors and I got
the oracle.so and oracle.la on modules directory.
Looking for what I should do next, I read .ini of PHP on how to make that
module works. So, as it says, a copied the module in the extension_dir
(/usr/lib/php4) and created a oracle.ini in /etc/php.d.
Even when I restart the service or restart the computer I still get the
same
error message:
Fatal error: Call to undefined function: ocilogon() in
/var/www/html/teste_db.php on line 18
I compiled the module, in this case, because I would like to let apache
with
all modules that it is installed now.
Am I forgeting someting here to make it works?
Somebody could help me with it???
Thanks people!
Maurício
--- End Message ---
--- Begin Message ---
I am comparing between this two php-based CMS?
My focus is really
1. the availability of modules/add-ons.
Not too sure, but seems PHPnuke has more add-ons than Postnuke.
2. ease of maintaining a group of contributors/writers
Nyon
--- End Message ---
--- Begin Message ---
YC Nyon wrote:
I am comparing between this two php-based CMS?
My focus is really
1. the availability of modules/add-ons.
Not too sure, but seems PHPnuke has more add-ons than Postnuke.
2. ease of maintaining a group of contributors/writers
You forgot #3: The ease of your sight getting hacked into because of
these security nightmares!
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Greetings Guyz.....
I would just like to ask for a help regarding on
"Links of Tables from other DB". I'm just only a
newbie in PHP Programming.
What I have right now is a query result from my table,
and what I wanted to do is on my one of the table I
had is to have a link or button that will open another
page that will get the data from the other table.
It would be highly appreciated if anyone could give me
a sample script or link for a tutorial.
Many Thanks in advance.....
Regards,
ERWIN
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
--- End Message ---