FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » if condition in php syntax required
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: if condition in php syntax required [message #186344 is a reply to message #186343] Fri, 04 July 2014 02:08 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 7/3/2014 9:54 PM, maxinetindia(at)gmail(dot)com wrote:
> On Friday, July 4, 2014 7:15:42 AM UTC+5:30, Jerry Stuckle wrote:
>> On 7/3/2014 9:31 PM, maxi(at)gmail(dot)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
>>
>> jstuckle(at)attglobal(dot)net
>>
>> ==================
>
> Sorry to bother, i tried a lot however struggled to get the correct syntax. the country dropdown is working fine and it disabled coz user is not given a choice to select the country, it is picked up automatically. I wanted the custom message for a reason that I do not want users from other countries to register. even if i tell abroad country user not to register, I cannot stop them. I will get an entry in my database that i will need to delete.
>
> I thought I would get some help here and hence I posted. once again... sorry to bother
>

You can get help here. But if you're going to be using scripts (of any
kind), you need to learn the language that script is written in. You
will find this pretty much consistent across the internet. Some people
will help you for a bit. But if you don't try on your own, they'll
quickly stop helping. It's just a word to the wise.

As to your problem: If you've disabled the dropdown, then the user has
no choice and they won't be able to select a country. So there is
nothing to test for.

Also, you can never stop a person from registering; I could simply say
I'm from India, even though I'm in the United States. And if you don't
give me an option for the country, that's what I'll do. It will look
like I'm in India - but I'm not.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to revise my User Contributed Note on php.net
Next Topic: xmltes Template Engine
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 21:50:26 GMT 2024

Total time taken to generate the page: 0.04359 seconds