Jump to content

Need Help With PHP


Thomas Rozanov

Recommended Posts

During the process of learning PHP (which I have ) I came up with a couple of questions. Maybe some PHP experts could answer them.

1) You know how you put } or { after each statement I think. What's the rule for that? What do they do ? Which side do i put? { or } ?

2)How do I make a website url a variable? however I want one part of the website to be able to change (text-box) .

Like ex. $example= http://twitter.com/recessionwire but i want the recessionwire part to be changable when someone types in text box.

Thanks Guys!

Link to comment
Share on other sites

if($condition){
// Do things
}

for the second you need a form somewhere, and in the appropriate module it's sent to

$url = 'http://www.twitter.com/';
$post = $this->post->input:
$twitter = $url.$post;

where your input field is named input.

Link to comment
Share on other sites

if($condition){
// Do things
}

for the second you need a form somewhere, and in the appropriate module it's sent to

$url = 'http://www.twitter.com/';
$post = $this->post->input:
$twitter = $url.$post;

where your input field is named input.

Thanks A Lot Tom!

Could you explain number one more clearly please. I don't get it honestly.

And for # 2 http://mpmap02.flightgear.org/?pilots_filter_callsign=example

I need this site. So the example part is what i need to change. :

$url = 'http://mpmap02.flightgear.org/?pilots_filter_callsign=';
$post = $this->post->input:
$input = $url.$post;

Link to comment
Share on other sites

The { and } (curly brackets) are used to contain statement blocks. You don't need to put one after every statement. They are used for blocks of statements which are grouped together. For example:

if ($x==1)
{
 statement 1;
 statement 2;
 statement 3;
}
statement 4;

In this example, if $x=1, then statements 1-3 will be executed, otherwise it will skip that block and continue with statement 4.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...