GetDotted Domains

Viewing Thread:
"PHP Stupidity"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 03/06/05 at 14:43
Regular
"Bicycle"
Posts: 4,899
Grr.

I'm sure I'm being ridiculously stupid, but say I define varaible $name to Alex, then want to link to root.com/$name.

Now, what I think I should be doing is simple: LINK

What's wrong? Why doesn't it work?

I keep getting unexpected T_string etc... I know I'm missing something, but what?
Mon 06/06/05 at 12:27
Regular
"Eff, you see, kay?"
Posts: 14,156
Short syntax:

http://root.com/
Sun 05/06/05 at 09:08
Regular
"Bicycle"
Posts: 4,899
Oh right. Makes a lot of sense now...

Cheers :D.
Sat 04/06/05 at 17:29
Regular
"NULL"
Posts: 1,384
It's the concatenation operator in PHP.

You use it to join two strings together, or to add one string to another, e.g:

$var = "foo";
$var .= "bar";
echo $var; // Would print: foobar

The + sign is used to add two numbers together, e.g.:

$var = 2+3;
echo $var; // Would print: 5

or similarly as above:

$var = 2;
$var += 3;
echo $var; // Would print: 5
Sat 04/06/05 at 17:18
Regular
"Bicycle"
Posts: 4,899
What does the "." do?
Sat 04/06/05 at 11:21
Regular
"NULL"
Posts: 1,384
Fri 03/06/05 at 23:32
Regular
"Bicycle"
Posts: 4,899
Damarus wrote:
> LINK
>
> Not that it really matters, but wouldn't it be better practice to
> do...
>
> echo(' > href="http://root.com/'.$name.'">LINK');

Well, actually, it would be better practice to define $rootname and have echo($rootname).

Nyah. :D

But actually, if I were to want to echo or print two variables would I write echo('$var1''$var2')? Or 'var1'+'var2' ?
Fri 03/06/05 at 15:37
Regular
Posts: 10,364
Damarus wrote:
> Not that it really matters, but wouldn't it be better practice to
> do...

No.

It's actually better to make less use of the echo statement, keeping HTML outside of php sections.
Fri 03/06/05 at 15:02
Regular
Posts: 4,279
LINK

Not that it really matters, but wouldn't it be better practice to do...

echo('LINK');
Fri 03/06/05 at 14:54
Regular
"NULL"
Posts: 1,384
There's nothing wrong with that and it works fine when I just tested your exact code.

Usually that error means that you haven't put a semicolon or closing bracket on the line before, therefore it doesn't expect an echo statement.
Fri 03/06/05 at 14:43
Regular
"Bicycle"
Posts: 4,899
Grr.

I'm sure I'm being ridiculously stupid, but say I define varaible $name to Alex, then want to link to root.com/$name.

Now, what I think I should be doing is simple: LINK

What's wrong? Why doesn't it work?

I keep getting unexpected T_string etc... I know I'm missing something, but what?

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Simple, yet effective...
This is perfect, so simple yet effective, couldnt believe that I could build a web site, have alrealdy recommended you to friends. Brilliant.
Con
My website looks tremendous!
Fantastic site, easy to follow, simple guides... impressed with whole package. My website looks tremendous. You don't need to be a rocket scientist to set this up, Freeola helps you step-by-step.
Susan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.