cleaning up first php page was Re: can't get includes to load [message #180935 is a reply to message #180932] |
Wed, 27 March 2013 07:00 |
Cal Dershowitz
Messages: 36 Registered: February 2013
Karma:
|
Member |
|
|
On 03/26/2013 07:14 PM, Jim Higgins wrote:
> On Tue, 26 Mar 2013 14:50:20 -0700, in
> <3bednVqnL5qAhc_MnZ2dnUVZ_q6dnZ2d(at)supernews(dot)com>, Cal Dershowitz
> <cal(at)example(dot)invalid> wrote:
>
>> Thx JO, that simple thing was it. I now have my first php webpage out
>> on my domain space as opposed to just the localhost.
>> http://merrillpjensen.com/index.php#
>> Why did the server add a hash on the end of it?
>
>
> It didn't, unless you clicked one of the links in the menu on that
> page. Those dummy links consist of nothing but "#".
ok
>
>
>> Why does the sidebar not end up on the side like it does for the local
>> host and the same browser?
>
>
> Did you also upload the CSS file that controls the layout for this
> page?
I thought I did, but I didn't. Again I used filezilla, but this time
correctly. Unfortunately, I'm my own weak link in this new endeavor.
Looks better now:
http://merrillpjensen.com/index.php
>
>
>> I uploaded these files using Filezilla. I can see that if this is the
>> way I'm going to do this, then whatever ends up on my server will be
>> riddled with mistakes and differing versions of things.
>
>
> Why? If you have a page on your server and the same page on your
> local machine, just copy/backup that page on the local machine, make
> your updates to the original, view them, then upload the new page to
> the server. When you're satisfied all is well, delete the backup.
Well, for example, my question about why the nav bar was bottoming out
makes no sense now. It's great that you can hide your mistakes like
that, but I doubt that my path to php perfection is going to be so
linear that I won't ever want to double back in significant ways.
>
> And if you maintain the same directory structure on your local machine
> as on your server, the pages should work just fine in both places.
>
> What you can't do is (for example) have your CSS files in some
> directory on your local machine that has a different name than on your
> server. If you do that the reference to the CSS file that works on
> the local machine won't find the CSS file on the server.
Ok, and thanks for your reply, jim, I think I can make the local
directory structure that I want to have mimicked for right now. I think
it's a reasonable goal for this thread to just clean up and personalize
what I have so far.
>
>
>>> From the file layout, it looks correct, we do recommend you use
>>> $_SERVER['DOCUMENT_ROOT'] for includes eg:
>>>
>>> include $_SERVER['DOCUMENT_ROOT'].'includes/sidebar.php';
>>>
>>> this will make it easier the day when you put things in sub folders,
>>> like /home/sites/migrate/articles and you still want to include those
>>> from /home/sites/migrate/include.
>>
>> And again thx,but I made this change and got a parse error from it.
>
>
> If you have a parse error you probably have a typo. See that little
> dot after ['DOCUMENT_ROOT']? Did you leave it out? Inspect the above
> and what you have character by character.
I would bet long odds that I missed a character.
>
>
>> I have simple questions at this point: how do you try something new on
>> your server without stomping all over the last thing that worked?
>
>
> Let's say the page you want to work on is named ORIGINAL.PHP. You
> make a copy of that file and you call it something like
> ORIGINAL.PHP.BAK. Then you work on ORIGINAL.PHP. If you need more
> copies og that original, you can append a date or a letter or whatever
> after BAK to differentiate them.
>
What is a person supposed to do about the fact that if you just type in
www.merrillpjensen.com , you get the old index.html? Should I just
re-direct that to a php version?
Also taking any and all suggestions* on how to make this start looking
like a webpage that you would show a client.
--
Cal
*except from jerry struekle, who is not invited on my threads, because I
need signal, not noise.
|
|
|