Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14057

Re: if condition in php syntax required

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: if condition in php syntax required
Date 2014-07-03 21:45 -0400
Organization A noiseless patient Spider
Message-ID <lp5108$f7g$1@dont-email.me> (permalink)
References <54cfee18-c312-47b0-85cc-46f0e34c50d4@googlegroups.com>

Show all headers | View raw


On 7/3/2014 9:31 PM, maxinetindia@gmail.com wrote:
> I am a newbie with no knowledge of php. i have a register.php file with piece of code in ..... tag that asks for username password and other details. The country is selected automatically and the script is included in the register.php file. I dont know how to find which is the correct variable and how to write if statement. The line where the variable can be found is echo ''.$ctr['country'].'';
> 
> I want to check the country in the if statement and if the country belongs to "India", it should show the register.php file contents (between the tags, else just show a message that "We accept registration only from India"
> 
> Can someone give me the syntax how to write? I searched for it but was very confused in php tags and semicolons
> 
> example
> 
> if country = india
> <div>
> .
> .
> .
> </div>
> else
> custom message
> endif
> 

The first thing is - if you're going to be dealing with PHP scripts, you
NEED to learn PHP or hire a consultant who does.  Don't expect to be
able to just copy scripts from the internet and expect them to work.
And don't expect others to help you all of the time just because you
don't know what you're doing.  All of us here are volunteers; we help
those who try on their own.  But we aren't unpaid consultants.

As to your question - why even bother to ask?  Just tell people you only
accept registrations from India, and remove the country selection code
all together.  Don't give someone a choice if there is only one correct
answer.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

if condition in php syntax required maxinetindia@gmail.com - 2014-07-03 18:31 -0700
  Re: if condition in php syntax required Jerry Stuckle <jstucklex@attglobal.net> - 2014-07-03 21:45 -0400
    Re: if condition in php syntax required maxinetindia@gmail.com - 2014-07-03 18:54 -0700
      Re: if condition in php syntax required Jerry Stuckle <jstucklex@attglobal.net> - 2014-07-03 22:08 -0400
      Re: if condition in php syntax required Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-07-04 17:02 +0000
  Re: if condition in php syntax required Denis McMahon <denismfmcmahon@gmail.com> - 2014-07-04 02:34 +0000
    Re: if condition in php syntax required maxinetindia@gmail.com - 2014-07-03 19:50 -0700
  Re: if condition in php syntax required Arno Welzel <usenet@arnowelzel.de> - 2014-07-05 03:21 +0200

csiph-web