Hi,
Yes, what Ashley said is correct. Also, if you want to avoid writing
$perm several times in the if, or if you have a lot of permissions you
can do:
if (in_array($perm, array(11, 22)))
And you can put in that array all the permissions you need to.
Regards,
Jonathan
On Fri, Dec 18, 2009 at
Thank you Ashley, it makes perfect sense. I don't know why I didn't just set
up some tests like Shiplu suggested!
I've rewritten all my code BACK to the correct way. (I thought it looked
cooler, oh well).
On Fri, Dec 18, 2009 at 10:47 AM, Ashley Sheridan
wrote:
> On Fri, 2009-12-18 at 10:21 -0
On Fri, 2009-12-18 at 10:21 -0800, Allen McCabe wrote:
> In a nutshell:
>
> Will this work?
>
> if ($perm == (11 || 12))
>
>
> Explanation:
>
> I am laying the groundwork for a photo viewing system with a private and
> public mode, and additionally if an admin is logged in, there is an
> addi
In a nutshell:
Will this work?
if ($perm == (11 || 12))
Explanation:
I am laying the groundwork for a photo viewing system with a private and
public mode, and additionally if an admin is logged in, there is an
additional level of permission. I came up with a number system to make it
easier (an
1 OR page = 3 AND page != 2) OR (page = 2 OR page = 3 AND
page != 1)
Has somebody an idea how to solve this?
I've read the entire thread and can see that this is a MySQL query you
want to make (I was about to tell you about the == comparison and the
$ in a variable in PHP).
What you want is all results containing 1,2 or 3, so make a "WHERE
page IN(1,2,3)" and use PHP logic to figure out if a free slot is
available or not. Or rewrite your booking routine (use data and time
fields instead, maybe by creating a bunch of free slots and then a
booked field with a default of "0", changed to "1" when booked)
At 11:52 AM +0100 12/7/09, Merlin Morgenstern wrote:
Hello everybody,
I am having trouble finding a logic for following problem:
Should be true if:
page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3
The result should never contain 1 AND 2 in the same time.
This obviously
nt to make (I was about to tell you about the == comparison and the $
in a variable in PHP).
What you want is all results containing 1,2 or 3, so make a "WHERE page
IN(1,2,3)" and use PHP logic to figure out if a free slot is available
or not. Or rewrite your booking routine (use data
Merlin Morgenstern wrote:
You have described the problem very well. This is exactly where I can
not find a solution.
the page number translates to the following: 1= first page 2= following
pages 3= all pages
This are the options a user has while booking a product on my site. Now
if ther is
On Mon, 2009-12-07 at 12:49 +0100, Merlin Morgenstern wrote:
>
> Ashley Sheridan wrote:
> > On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote:
> >> Hello everybody,
> >>
> >> I am having trouble finding a logic for following problem:
> >>
> >> Should be true if:
> >> page = 1 OR page =
Ashley Sheridan wrote:
On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote:
Hello everybody,
I am having trouble finding a logic for following problem:
Should be true if:
page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3
The result should never contain 1 AND 2
On Mon, 2009-12-07 at 11:52 +0100, Merlin Morgenstern wrote:
> Hello everybody,
>
> I am having trouble finding a logic for following problem:
>
> Should be true if:
> page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3
>
> The result should never contain 1 AND 2 in the sam
Devendra Jadhav wrote:
what do you think about this?
if( ! (page == 1 && page == 2)){
//here
}
Well a simple && (and) does not help.
I want to have all results that contain either page = 1 OR page = 3, AND
in the same time I want to have the results that contain page=2 OR page= 3
, B
what do you think about this?
if( ! (page == 1 && page == 2)){
//here
}
On Mon, Dec 7, 2009 at 4:22 PM, Merlin Morgenstern wrote:
> Hello everybody,
>
> I am having trouble finding a logic for following problem:
>
> Should be true if:
> page = 1 OR page = 3, but it should also be true if pa
Hello everybody,
I am having trouble finding a logic for following problem:
Should be true if:
page = 1 OR page = 3, but it should also be true if page = 2 OR page = 3
The result should never contain 1 AND 2 in the same time.
This obviously does not work:
(page = 1 OR page = 3) OR (page = 2 OR
If this seems simple to you remember I have no formal training in logic
structure or DB design
Neither do I - and probably a lot of others here too ;)
the value of a status field is given in the sdk text as such...
...This number is determined by adding the following values togeth
This is verbatim from the manufacturer except I replaced the code info with
vanilia filler to keep from getting in trouble with them.
See how long it takes you to write the shortest SQL code that returns all
State a and State f records.
If this seems simple to you remember I have no formal trai
On Sun, 2008-10-19 at 11:26 -0400, Robert Cummings wrote:
> On Sun, 2008-10-19 at 10:03 +0100, Ashley Sheridan wrote:
> > On Sun, 2008-10-19 at 01:10 -0400, Robert Cummings wrote:
> > > On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote:
> > > > Hi all
> > > >
> > > > This is not exactly PHP, but a
On Sun, 2008-10-19 at 10:03 +0100, Ashley Sheridan wrote:
> On Sun, 2008-10-19 at 01:10 -0400, Robert Cummings wrote:
> > On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote:
> > > Hi all
> > >
> > > This is not exactly PHP, but an issue that we have to work out in code
> > > (whatever we use) -
>
On Oct 18, 2008, at 11:10 PM, Robert Cummings wrote:
On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote:
To cut down on fraudulent orders, our cc processor (whatever we call
them), to enable "Address Verification System (AVS)", ...
The
docs make this clear that they want: "The numeric port
On Sun, 2008-10-19 at 01:10 -0400, Robert Cummings wrote:
> On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote:
> > Hi all
> >
> > This is not exactly PHP, but an issue that we have to work out in code
> > (whatever we use) -
> > I am working on a shopping cart site which will have orders from any
On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote:
> Hi all
>
> This is not exactly PHP, but an issue that we have to work out in code
> (whatever we use) -
> I am working on a shopping cart site which will have orders from any
> country.
>
> To cut down on fraudulent orders, our cc processor
AVS generally only exists for us and canada and parts of the uk, if I
remember correctly. Usually they're just looking for the beginning
part of the street address, not the concatenation or anything else
like that. No need for apartment numbers, for example if you're just
looking at avs.
If you're
Hi all
This is not exactly PHP, but an issue that we have to work out in code
(whatever we use) -
I am working on a shopping cart site which will have orders from any
country.
To cut down on fraudulent orders, our cc processor (whatever we call
them), to enable "Address Verification Syste
tedd wrote:
> If two, or more, users hit the site at the same time then a RACE
> condition may have one user getting something they didn't ask for or
> not getting anything at all.
>
> The complicated way I figure I could solve this would be to:
>
> 1. Generate a random string name for the file
tedd wrote:
Hi gang:
Here's the logic problem.
First the site:
http://php1.net/b/zip-files/
Now, the site works well enough. The user selects what they want, clicks
Submit, the order is assembled in zip file and presented to the user for
downloading.
However, as it stands now, before the
On Wed, Jul 9, 2008 at 6:11 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> generate a unique hash as the name based on the contents of the zip, then
> if 2 people
> happen to want exactly the same selection you won't have to build/zip it
> twice ...
> just check if the zip happens to exist before tr
generate a unique hash as the name based on the contents of the zip, then if 2
people
happen to want exactly the same selection you won't have to build/zip it twice
...
just check if the zip happens to exist before trying to build it.
have the script do garbage collection on old zip files ... i
On Wed, Jul 9, 2008 at 7:45 PM, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> Here's the logic problem.
>
> First the site:
>
> http://php1.net/b/zip-files/
>
> Now, the site works well enough. The user selects what they want, clicks
> Submit, the order is assembled in zip file and presented to th
Write a script that cron runs that checks dates of files and removes 1 month
old ones?
On Wed, Jul 9, 2008 at 4:45 PM, tedd <[EMAIL PROTECTED]> wrote:
> Hi gang:
>
> Here's the logic problem.
>
> First the site:
>
> http://php1.net/b/zip-files/
>
> Now, the site works well enough. The user select
Hi gang:
Here's the logic problem.
First the site:
http://php1.net/b/zip-files/
Now, the site works well enough. The user selects what they want,
clicks Submit, the order is assembled in zip file and presented to
the user for downloading.
However, as it stands now, before the script assemb
Hi, I am doing an online calendar for holiday application.
Now I got a table with these fields among many others.
`req_id` int(11) NOT NULL auto_increment,
`req_date` date NOT NULL,
`username` varchar(100) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`days_off` int
Hi, I am doing an online calendar for holiday application.
Now I got a table with these fields among many others.
`req_id` int(11) NOT NULL auto_increment,
`req_date` date NOT NULL,
`username` varchar(100) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`days_off` int(
Wee Keat wrote:
Hey Jeff,
How are you mate? Was lazying around and saw your email to the list. :)
What exactly do you need help with? Is it the following line?
// Stuck here
$html_menu .= "$sub_page";
}
$html_menu .= '';
Do you need to get the value of the link and
On Thu, 16 Dec 2004 13:11:02 +1100, Jeffery Fernandez
<[EMAIL PROTECTED]> wrote:
> I am trying to build a html menu dynamically from data sitting in an
> array. I have been successful so far until it came to the point of
> populating the sub-menu of the system. Can someone help me out with the
> lo
I am trying to build a html menu dynamically from data sitting in an
array. I have been successful so far until it came to the point of
populating the sub-menu of the system. Can someone help me out with the
logic or is there a simpler way of doing it? Thanks
/**
* This function builds the a
> -Original Message-
> > Wow, Michael. Nice response.
>
> Could we please trim our posts? Thank you.
Sorry. Thought I'd sent it to him only.
-Ed
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thursday 12 August 2004 01:26, Ed Lazor wrote:
> Wow, Michael. Nice response.
Could we please trim our posts? Thank you.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
Wow, Michael. Nice response.
-Ed
> -Original Message-
> From: Michael Sims [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 9:03 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] PHP logic - Whats going on here?
>
> Kim Steinhaug wrote:
> [snip]
>
Michael Sims wrote:
> string at various points to see what it contains. You may need to
> drill down into the actual source code for the Send() method to see
> what it things the body string is.
Errr... s/things/thinks/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: ht
Kim Steinhaug wrote:
[snip]
> For some reason the above results in a blank mail, no $body at all,
> rest is fine. However, if I include a dummy for if all goes well :
>
>if(!$mail->Send()) {
> echo $lang_error['mailer_error'] . "\n";
>} else {
> // Why do I need this one???
>
On 08/11/2004 9:28 AM, Kim Steinhaug <[EMAIL PROTECTED]> wrote:
> Thanks for your reply, it all seems logical when you think of it,
> still I also think it sounds logical without the extra ELSE statement
> since the function has to executed for the first IF to do the comparison,
> meaning that the
Thanks for your reply, it all seems logical when you think of it,
still I also think it sounds logical without the extra ELSE statement
since the function has to executed for the first IF to do the comparison,
meaning that the email should be sendt in the first place. (If it didnt
how could it stat
[snip]
Then to send the mail we use this :
if(!$mail->Send()) {
echo $lang_error['mailer_error'] . "\n";
}
As you see above, Ive dropped the "what if all goes well" loop, since I
believe that the $mail->Send() is initiaded in the first statement
For some reason the above results i
Ive stumbled onto a rather strange problem, atleast I cant see why this
is happening. Im using phpMailer to send mails, and I have the following
straight forward code :
$mail = new phpmailer();
$mail->IsSendmail();
$mail->From = '[EMAIL PROTECTED]';
$mail->FromName = 'From Name';
$mail->
> What's in your array?
$array1[0] = 'firstname';
$array1[1] = 'lastname';
$array1[2] = 'tkt_title';
I got that fixed.
Thanks.
alex hogan
**
The contents of this e-mail and any files transmitted with it are
confidential and i
Alex Hogan wrote:
I gotcha..,
I do have one question though. I ran your code and it only returns the
first letter for that element in the array. For instance fieldone
returns as f and tableone returns as t.
The output looks like this;
SELECT f,f,f FROM t,t.
alex
What's in your array?
--
***
On 20 April 2004 16:44, Alex Hogan wrote:
> foreach ( $array1 as $flds ) {
> if ( $start ) {
> $query .= $flds;
> $start = false;
> } else {
> $query .= ", " . $flds;
>
> }
> }
$query .= implode(", ", $array1);
Cheers!
Mike
--
Apr 20 at 9:55am, Alex Hogan wrote:
> function myselect($array1, $array2){
> $query = "SELECT".foreach($array1 as $flds){ $flds[$i]; }.
> "FROM".foreach($array2 as $tbls){ $tbls[$n]; } ...
Alex, if you merely wish to place the values of an array into your
query, you might also try doing it th
[snip]
I do have one question though. I ran your code and it only returns the
first letter for that element in the array. For instance fieldone returns
as f and tableone returns as t. The output looks like this; SELECT f,f,f
FROM t,t.
[/snip]
Never mind I found it. It should be;
$query = "SELEC
[snip]
> $query = "SELECT ";
> $start = true;
> foreach ( $array1 as $flds ) {
> if ( $start ) {
> $query .= $flds[$i];
> $start = false;
> } else {
> $query .= ", " . $flds[$i];
> }
> }
> $query .= " FROM ";
> $start = true;
> foreach ( $
Alex Hogan wrote:
Hi All,
I am having a logic problem. (insert jokes here) I am trying to create a
function that will allow me to pass any number of fields and tables into a
blanket query.
I am getting an error; Unexpected foreach. I have tried placing the loop in
several different places and am
Hi All,
I am having a logic problem. (insert jokes here) I am trying to create a
function that will allow me to pass any number of fields and tables into a
blanket query.
I am getting an error; Unexpected foreach. I have tried placing the loop in
several different places and am getting the same
Hi everyone,
Last Friday I struggled for a long time with displaying some data that's
stored using the Modified Preorder Tree Traversal method. Without making
this email overly long and complicated (like my first draft was) I'd
like to simply ask if someone has any links or functions or instructio
d']))
echo "found";
etc...
}
You get my point, but the big part is the select * <-- part of the sql
call
you have to identify each column that you want back with an alias otherwise
they stomp all over one another.
Jim Lucas
- Original Message -
From: "Petre A
Don't know whether it's just because it's late at night here in the UK or
whether I'm being a bit dim, but wouldn't it be much, much easier to store
all the data in your non-main tables in a single table and distinguish the
type of data (i.e. fof, pub, gov, etc) by a field. This would simpli
> select * from main
> left join fof on main.id = fof.id
> left join pub on main.id = pub.id
> left join gov on main.id = gov.id
> left join med on main.id = med.id
> left join ngo on main.id = ngo.id
> left join ow
Hi List
OK, I've posted this on the MySQL list as well, but it seems a bit quiet
there, and arguably it could definately be a PHP rather than mysql question
depending on whether it can be done with one query (then it was/is a mysql
query), or whether it should be done with some structures and mult
Crockford wrote:
>
>
>
>
> > -Original Message-
> > From: Marco Tabini [mailto:marcot@;tabini.ca]
> > Sent: 11 November 2002 14:46
> > To: Tony Crockford
> > Cc: Php-General@Lists. Php. Net
> > Subject: Re: [PHP] Logic headache, please help.
&g
> -Original Message-
> From: Marco Tabini [mailto:marcot@;tabini.ca]
> Sent: 11 November 2002 14:46
> To: Tony Crockford
> Cc: Php-General@Lists. Php. Net
> Subject: Re: [PHP] Logic headache, please help.
>
>
> How about building an array of all the levels
How about building an array of all the levels:
$a = array();
for ($i = 1; $i <= $maxlevels; $i++)
$a[] = $i;
then for each level you can create a new array that is the difference
between the original array and an array that contains the current level:
for ($i = 1; $i <= $maxlevels; $i++
Hi all,
brief explanation:
I'm building a select list, to exclude certain directories from a search
(with Ht://dig).
The structure is like this:
All levels
Level 1
Level 2
Level 3
Level 4
for four levels, where the option value should be all lv's except the
current option level.
I have a var
Hi,
I'm working on a message board. Everything is working fine, except some of
the beta testers have requested the desire to have a "6 new replies" type
system, so that they can easily recognise threads with new posts.
The board is open to both guests (email) and users (userid), and the plan
wo
On Tue, Jun 04, 2002 at 04:40:26AM +0400, Ricardo Fitzgerald wrote:
>
> I'm trying to echo a neat table
I've GOT to bust your chops. That table and your code are anything BUT
neat. For neat, you need to put tags to close each cell. Also
nest your code properly...
if ($value2 ==0) {
,
but it's a better solution than all of the IFs that was just posted...
---John Holmes...
> -Original Message-
> From: Naintara Jain [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 5:47 PM
> To: Ricardo Fitzgerald
> Cc: Php-General@Lists. Php. Net
&
IL PROTECTED]
[mailto:[EMAIL PROTECTED]
t]On Behalf Of Naintara Jain
Sent: Tuesday, June 04, 2002 2:37 PM
To: Ricardo Fitzgerald; [EMAIL PROTECTED]
Subject: RE: [PHP] Logic -- conditional statements
The problem here is that you have defined three different variables
$value1,$value2,$value3.
Keep only
ECTED]
[mailto:[EMAIL PROTECTED]
t]On Behalf Of Ricardo Fitzgerald
Sent: Friday, July 10, 2893 3:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Logic -- conditional statements
Hi to all,
I'm trying to echo a neat table with values from a form, depending on
the values it echoes a table with one row with
Hi to all,
I'm trying to echo a neat table with values from a form, depending on
the values it echoes a table with one row with two or with three:
Then I have conditional nested statements, to validate these variables
and wrote the table with the proper values in each case, the problem
is the tab
"Dan McCullough" <[EMAIL PROTECTED]> wrote:
> Question. I am trying to check to see if a certain piece of code should
be run. Here is an
> example.
> if ($type != "add") || ($type != "edit") || ($type != "delete") {//if this
or this or this then
> then run this code
As pointed out, your paranth
now change || to && and see if that does the job
-Original Message-
From: Dan McCullough [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 12:57 PM
To: PHP General List
Cc: Richard S. Crawford
Subject: Re: [PHP] Logic
that didnt work,i started off with
if ($type
that didnt work,i started off with
if ($type != "add") {
that works
} else {
this works
}
I have done this before I'm just having a brain cramp.
if (($type != "add") || ($type != "edit") || ($type != "delete")) {
print $subcat_output;
} else {
print "Back to List of Subcategories";
}
---
You need parentheses around the entire antecedent:
if (($type !="add") || ($type !="edit") || ($type !="delete")) { //etc
^--- Note these parentheses---^
Hope that helps.
At 05:28 PM 12/4/2001, Dan McCullough wrote:
>Question. I am trying to check to see if a
Question. I am trying to check to see if a certain piece of code should be run. Here
is an
example.
if ($type != "add") || ($type != "edit") || ($type != "delete") {//if this or this or
this then
then run this code
} else {
then run this
}
Is this correct, for some reason this isn't working
It's not really, but kind of, a PHP question. I mean it is being written in PHP :)
I am putting together a search feature for our classified ads and there are about 4000
each day. Now I am bulding a query to search by newspaper, date, and keywords. One
last thing is categories.
Curious how
try:
http://php.resourceindex.com/Complete_Scripts/Link_Management/
you should be able to find some examples here.
__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
PHP Ge
hey-
I'm in the process of writing a links page for a website. I want to have all
the links seperated by category, and those categories would be placed in
different columns. This means also that different categories of links could
be on the same row in the table used to lay it all out. i'm pullin
I have a simple page that offers three items(7700,7701,7702). I am trying to figure
the best way to calculate the price for each shirt depending on the amount they want.
The breakdown of prices is:
Any 3 shirts for $50
7700 - 3 for $33 or $14.99
7701 & 7702 - 3 for $50 or $25.
So I sort throu
76 matches
Mail list logo