[PHP] re:Switch - Case Statement Questions

2012-11-16 Thread Omar Muhsin
Hello,

I was just wondering after writting the code in version 2 here below, it turns 
out in testing that it actually PHP is not validating the expressions instead 
always I get the first case.

1.Using nested if statement {THE INTENDED BEHAVIOR}:
if ($count > 14)
$boxes = 3;
elseif($count > 7 && $count <= 14)
$boxes = 2;
else
$boxes = 1;

2. Using Switch {ALWAYS FIRST CASE!!!}

//$boxes = 1;
//switch ($count) {
//case ($count > 14):
//$boxes = 3;
//break;
//case ($count > 7 && $count <= 14):
//$boxes = 2;
//break;
//case ($count <= 7):
//default :
//$boxes = 1;
//break;
//}


Does anyone know the answer why using the Switch it always execute the first 
case ?

Many thanks

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



Re: [PHP] Re: What font/size do you use for programming?

2008-07-10 Thread Omar Noppe
Is there any reason to pick a black background en white fonts in your  
editor (for example writability)?




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





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



[PHP] copy function

2003-12-18 Thread Omar
Is there a way to copy a file from 1 server to a different one?
I have this code in a win 2k server, and i try to copy the file to a win NT
server:

if (is_file($file_att))
  if (copy($file_att,'\servername\folder\'.$file_name))
echo "succesful";
  else
echo "failure";

It gives me this warning:

Warning: Unable to create '\servername\folder\image.jpg': Invalid argument
in D:\Intranet\sitio\Documentos\copyf.php on line 161
failure

I need this to work on any computer of the network. What kind of permission
do I need so any computer can use this script?

Thanks for the help.

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



[PHP] mssql_connect problem

2003-12-17 Thread Omar
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.

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



[PHP] preg_match

2003-10-10 Thread Omar
Hello everyone.

In this line
preg_match("/[^a-z0-9'\?!-]", $item)

i can´t find de way to add vowels with accent (á,é,í,ó,ú,ñ,Ñ) and other
characters to the preg_match function.
Can anyone help me?
The documentation of this function is not very clear (or complete) to me.

Thank you.

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



[PHP] MS SQL query problem

2003-08-28 Thread Omar
I have a sql query, something like
SELECT x FROM server1.table WHERE x IN (SELECT x FROM server2.table)

I get a warning when loading the page. This is the warning:
Warning: MS SQL message: Heterogeneous queries require the ANSI_NULLS and
ANSI_WARNINGS options to be set for the connection. This ensures consistent
query semantics. Enable these options and then reissue your query. (severity
16)

I don´t know what to do, where to look...
Thanks for any help.

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



[PHP] cookies and iexplorer

2003-06-06 Thread Omar
I have this login page, if the login is correct, i create 3 cookies:
 - user = $login
 - password = $pass
 - seepage = 1

on the other pages, i placed a condition:
if $seepage != 1
  go to login page
else
  show page

It works fine to some people (works fine for me), but there are other people
who can´t see a page with the condition. We tryed changin the security leven
on the browser (internet explorer 5.x & 6), and lots of other related
things, but they still can´t see the page.
Do you have any advice? I don't have a clue about what could be wrong with
these people.

Thank you.



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



Re: [PHP] Get data from 5 tables

2003-03-05 Thread Osman Omar
ok,

how do I know which data come from which table?



On Wed, 5 Mar 2003, olinux wrote:

> SELECT * FROM table1, table2, table3, table4
> WHERE id = 1 AND
> table1.id=table2.id AND
> table2.id=table3.id AND
> table3.id=table4.id AND
> etc.
> 
> 
> or you can use a JOIN
> http://www.mysql.com/doc/en/JOIN.html
> 
> 
> --- Osman Omar <[EMAIL PROTECTED]> wrote:
> > Hi,
> > 
> > How do I query to get data from 5 tables with same
> > id. (id=1).
> > 
> > eg,
> > 
> > table1
> > id  data
> > 1   blue
> > 2   green
> > 
> > table2
> > id  data
> > 1   yellow
> > 3   green
> > 
> > table3
> > id  data
> > 1   black
> > 4   white
> > 
> > etc.
> > 
> > thanks
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> 
> 


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



[PHP] Get data from 5 tables

2003-03-05 Thread Osman Omar
Hi,

How do I query to get data from 5 tables with same id. (id=1).

eg,

table1
id  data
1   blue
2   green

table2
id  data
1   yellow
3   green

table3
id  data
1   black
4   white

etc.

thanks


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



[PHP] problem including a file

2002-12-30 Thread Omar
I have an include line in all the php files i write
something like --> include('connection.inc');
The include path is d:\includes. (win nt 4, php 3.0.11) It worked fine
before but today failed to open the include file.
Does anyone has a clue about what could cause this problem?
Thank you.



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




Re: [PHP] Re: Stumped!

2002-12-16 Thread Omar
Check out your while
 {
 } <--- i don´t see a closing one

echo ("$meetingName ");
try:
echo ''.$meetingName.'';


<[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hmm, I am still getting a parse error on the last line of code...


In a message dated 12/16/2002 1:49:26 PM Eastern Standard Time,
[EMAIL PROTECTED] writes:

> $sql = "SELECT .";
> $sql_e = mysql_query($sql);
>
> while ($result = mysql_fetch_array($query_e)) {
> .
> }
>
> You were missing the mysql_query
>
>
> <[EMAIL PROTECTED]> escribió en el mensaje
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >I am trying to display a column from my database as a list.  Each listing
> >needs to be a URL that links to another script that brings up all of the
> data
> >in the row to edit.  I keep getting a parser error and I can't figure it
> out.
> > Here is the code and any help is greatly appreciated.
> >
> > >$db = mysql_connect("localhost", "Uname", "PW");
> >
> >$select_db = mysql_select_db("machmedi_meetingRequest",$db);
> >$sql = "SELECT * FROM requests";
> >
> >while ($result = mysql_fetch_array($query)) {
> >$id= $result["id"];
> >$meetingName= $result["meetingName"];
> >
> >echo ("$meetingName ");
> >?>
> >
>
>


Christopher Parker
Senior Corporate Technical Specialist, Corporate Events
America Online Inc.
Phone: 703.265.5553
Fax: 703.265.2007
Cell: 703.593.3199





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




[PHP] Re: Stumped!

2002-12-16 Thread Omar
$sql = "SELECT .";
$sql_e = mysql_query($sql);

while ($result = mysql_fetch_array($query_e)) {
.
}

You were missing the mysql_query


<[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to display a column from my database as a list.  Each listing
> needs to be a URL that links to another script that brings up all of the
data
> in the row to edit.  I keep getting a parser error and I can't figure it
out.
>  Here is the code and any help is greatly appreciated.
>
>  $db = mysql_connect("localhost", "Uname", "PW");
>
> $select_db = mysql_select_db("machmedi_meetingRequest",$db);
> $sql = "SELECT * FROM requests";
>
> while ($result = mysql_fetch_array($query)) {
> $id= $result["id"];
> $meetingName= $result["meetingName"];
>
> echo ("$meetingName");
> ?>
>



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




[PHP] trouble with update from php 3 to php 4.2.3

2002-12-04 Thread Omar
I updated php from version 3 to 4.2.3 on a win NT 4 server (with iss 4).
Everything went ok, but the include() function.
I have problems when including files.
I tried to specify a directory in the php.ini file but it still didn't work.
This is how i have the include line:
include ('file.inc');

I copied the file to the folder where my php file is, to the directory where
originally was (x:\path\includes) and it doesn't work.
I really need some help.
Thanx.




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




[PHP] Re: Refresh my Memory

2002-10-10 Thread Omar Campos

Visit
http://javascript.internet.com/user-details/resolution-page.html
it'll be helpful.


"Stephen" <[EMAIL PROTECTED]> escribió en el mensaje
000e01c270a9$08ba5b90$0200a8c0@melchior">news:000e01c270a9$08ba5b90$0200a8c0@melchior...
Hello,

I forget exactly how to do this so I'm turning to you all for some help. How
can I make it so that if a user does not have a resolution of atleast
1024x768, it sends them to another page or recomends that they up their
screen size before viewing the page? Any help will be great. Thanks!

Thanks,
Stephen Craton
http://www.melchior.us



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




[PHP] slow form / server problem

2002-10-10 Thread Omar Campos

Hi. I run php in win2k server, IIS and MS SQL Server 2k.
I've created some data bases and tables. On the beginning, sending a php
form (through the intranet) was quick. Now, it spends 32 seconds (sometimes
less) to send a form.
I've tried on a empty data base but it's still slow. I don´t have a clue
about what could it be?
Maybe the HDD of the server, maybe the SQL Server
Could you help me.

Thank you so much.



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




[PHP] mysql_num_rows error

2002-10-08 Thread Omar Campos

I have a file. I'll paste from line 32 to 34



I get the next warning:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /home/olimpiad/public_html/base/alta1.php on line 34

I'm running the script on a linux server.
could someone help me.
Thank you.



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




[PHP] Compiling PHP on Linux

2002-07-23 Thread Osman Omar

Hi 

I try to compile php and got error message 
any idea? 


system: 
  Redhat 7.2 
  Apache 2.0.39 (for redhat 7.0 from apache website) 
  php 4.2.2 

error messages 
--- 
/bin/sh /usr/tmp/php-4.2.2/libtool --silent --mode=compile gcc  -I.
-I/usr/tmp/php-4.2.2/sapi/apache2filter -I/usr/tmp/php-4.2.2/main
-I/usr/tmp/php-4.2.2 -I/usr/local/apache2-39/include
-I/usr/tmp/php-4.2.2/Zend -I/usr/include/freetype2/freetype
-I/usr/tmp/gd-2.0.1/ -I/usr/tmp/php-4.2.2/ext/mysql/libmysql
-I/usr/tmp/php-4.2.2/ext/xml/expat  -D_REENTRANT
-I/usr/tmp/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthread -DZTS -prefer-pic 
-c php_functions.c 
php_functions.c:93:27: missing binary operator before '!' 
make[3]: *** [php_functions.lo] Error 1 
make[3]: Leaving directory `/var/tmp/php-4.2.2/sapi/apache2filter' 
make[2]: *** [all-recursive] Error 1 
make[2]: Leaving directory `/var/tmp/php-4.2.2/sapi/apache2filter' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/var/tmp/php-4.2.2/sapi' 
make: *** [all-recursive] Error 1 



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




[PHP] addslashes

2002-06-21 Thread OMAR IGNACIO CAMPOS GALAN

When I use addslashes to add a back slash to a single quote, it returns 3
back slashes (example: 'it\\\'s'. Is that correct? Am I doing something
wrong?

Thank you

Omar Campos Galán
Desarrollo de Formas Electrónicas
CompuSoluciones
Tel. (0133) 3818-1554  Fax (0133) 3818-1599
www.compusoluciones.com


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




Fw: [PHP] RE:[PHP] PHP- ABOUT CONFIGURE APACHE SERVER

2001-07-19 Thread Yassel Omar Izquierdo Souchay

May  i change this ?

ScriptAlias /php/ "C:/WINNT/system32/inetsrv/php/"
   AddType application/x-httpd-php .php .php3 .phtml
Action application/x-httpd-php "/php/php.exe"

by this other?

ScriptAlias /php/ "C:/WINNT/system32/inetsrv/php/sapi"
   AddType application/x-httpd-php .php .php3 .phtml
Action application/x-httpd-php "/sapi/php4apache.dll"

toUse CGIs modules.?

I'm asking




- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 7:54 AM
Subject: [PHP] RE:[PHP] PHP- ABOUT CONFIGURE APACHE SERVER


Well, you gotta edit the file httpd.conf 9i dont know where had you
installed apache, but i think u can find this file at: c:\program
files\apache group\apache\conf.

Open it!
Go to line where it is specified "document root"...

DocumentRoot "C:\Inetpub\wwwroot\"

after that... edit this:
#
# This should be changed to whatever you set DocumentRoot to.
#


To use PHP: use this

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php3 .php .phtml .php3 .html .htm
Action application/x-httpd-php3 "/php/php.exe"


> MY PROBLEMS IS. THAT I DON'T KNOW HOW TO CONFIGURE MY APACHE SERVER TO USE
> MY C:\Inetpub\wwwroot\SITES I HAVE THERE
> THAT'S MY PROBLEM.
> THANKS FOR YOUR COLABORATION.
> YOIS
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Fw: [PHP] PHP- ABOUT CONFIGURE APACHE SERVER

2001-07-19 Thread Yassel Omar Izquierdo Souchay

MY PROBLEMS IS. THAT I DON'T KNOW HOW TO CONFIGURE MY APACHE SERVER TO USE
MY C:\Inetpub\wwwroot\SITES I HAVE THERE
THAT'S MY PROBLEM.
THANKS FOR YOUR COLABORATION.
YOIS


- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 7:32 AM
Subject: Re: [PHP] PHP- OF TOPIC--Sorry abotut my english


What problems r  you having?

> Hi agin
> I have APCHE SERVER Installed in my Machine.
> And i have Win2k pro installed. 
> And as you see i want to use.
> So i having troubles to configure the WEB server. 
> If somebody knows how to do it, please it would help me much.
> Thanks
> Yassel (Cybername=YOIS)
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP- OF TOPIC--Sorry abotut my english

2001-07-19 Thread Yassel Omar Izquierdo Souchay



Hi agin
I have APCHE SERVER Installed in my Machine.
And i have Win2k pro installed. 
And as you see i want to use.
So i having troubles to configure the WEB server. 
If somebody knows how to do it, please it would help me much.
Thanks
Yassel (Cybername=YOIS)




[PHP] PHP- OF TOPIC

2001-07-19 Thread Yassel Omar Izquierdo Souchay

Hi agin
I have APCHE SERVER Installed in my Machine.
And i have Win2k pro installed. 
And as you sww i want to use.
So i having troubles to configure the WEB server. 
If somebody knows how to do it, please it would help me much.
Thanks
Yassel (Cybername=YOIS)




Re: [PHP] displaying icons

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Put the same text
inside php
example
" the next code

- Original Message -
From: "Petr Jůza" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 2:47 PM
Subject: [PHP] displaying icons


> Hi everybody!
> Please, have somebody any experience with displaying icons (type files
> *.ico) in web pages?
>
> When I have a pure html file that contain , all
is
> OK - the icon is shown.
> But when I create a html page with assistance PHP, the icon isn't shown.
>
> Please, could you help me??
> Thank you!
>
> Best Regards, PETER.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP- Smoething i don't understand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hi friends
thanks averybodoy for help me
i used the solition of  "Jason Bell" [EMAIL PROTECTED]

thanks Jason
with this

> try this:
> 
> mysql_connect("YOUR_DB_HOST","DB_USERNAME","DB_PASSWORD");
> mysql_select_db("DB");
> $query = "select * from info where FirstName='$FirstName' and
> LastName='$LastName' and email='$email'";
> $result = mysql_query($query);

í already resolved the problem. much of your have reason. I didn't put the host name 
and the user..
Thanks again for Jason and Everybody

"This is the best PHP list"




[PHP] php- something that i don't understand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hey guys 
here is my code

4: mysql_connect() or die ("Problemas conectandose a la base de datos"); 
5: $query="select * from info where FirstName='$FirstName' and 
6: LastName='$LastName' and email='$email'"; 
7: $result = mysql_db_query("users", $query); 
*8: $r=mysql_fetch_array($result); 
9: $count=$r["count"];

and i follow redcieving this message

Warning: Supplied argument is not a valid MySQL result resource in 
c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8


thanks for your answers
Yassel




[PHP] PHP- something tha i don't understand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hi again
Here is the part of before code

8:$result = mysql_db_query("users", $query); 
9:$r=mysql_fetch_array($result); 
10: $count=$r["count"];

And the error message is 
Warning: Supplied argument is not a valid MySQL result resource in 
c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9


If somebody see something abnormal please let me know.

Thanks 
Yassel



[PHP] PHP- something i don't undestand

2001-07-17 Thread Yassel Omar Izquierdo Souchay

Hi
I'm having
trouble with  this part of code

9:   $result = mysql_db_query("users", $query);
10: $r=mysql_fetch_array($result);

The error message is :
Warning: Supplied argument is not a valid MySQL result resource in
c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9.

Please if somebody knows what it's wrong
thanks
Yassel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] File Uploads and Get Method

2001-05-03 Thread Omar Elkassir

when i upload a file, the form method must be POST because when GET is used,
it adds backslashes to the windows path name that already has backslashes,
and this causes an error.  for instance, the following snippet of code --

if ($add){
$newimage = "whatever.gif";
copy($image, $directory. "/" .$newimage);
}
print("
");

produces the following error

Warning: Unable to open C:\\My Documents\\My Pictures\\Sample.jpg

which is the image i'm trying to upload.  notice the double slashes in the
path (btw, adding $image = str_replace("","\\",$image);  does not help).
so the solution is to use the POST method.


now, on the same form, i have a multiple select box, where you can select
multiple values from one select box.  the code is as follows --


Australia
Brazil
Russia
USA


if the user selects more than one country, then if you echo $country, it
will show you only the last selected value for country.  however, what you
can do is break the query string at the ampersands, figure out all the
countries the user has selected and put them in an array.  in order to have
a query string,  the GET mothod must be used.  that solves this problem.

OOPSto upload the image, the POST method must be used, but to figure out
the values from a multiple select box, the GET method must be used.  if i
use one, then the other breaks.  does anyone have any ideas?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]