What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » /?id=home

Pages: (3): « First « 1 [ 2 ] 3 » Last »
/?id=home
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: /?id=home
quote:
Originally posted by Chris Boulton
quote:
Originally posted by CookieRevised
What happens if the creator hasn't access to a PHP enabled host?
Well, obviously if the user is creating it then he'd know he has PHP. You can't just say "bah, everyone without JS don't matter" :P You can't make predications on your visitors like that :P
Not all hosts include the ability to write php though. And some people who read this thread/question might wanna do the same on their (crappy) hosts.

quote:
Originally posted by Chris Boulton
quote:
Originally posted by CookieRevised
If it is only for redirecting, then yes (but isn't PHP doing this also in way?). But, just as in PHP, it can be used for far more things than only that.
In PHP, I wouldn't make it redirect, i'd make it seem totally transparent to the user and use an include() function.
yep, true, agreed, but I actually meant it as in:
in js:
1) the js script is loaded.... client side
2) depending on the switch the page is loaded.... client side
php:
1) the php script is loaded.... server side
2) depending on the switch the page is included, aka needs to be loaded also.... server side (if that is the only thing it is used for, because, again, I was not only talking about that specific use)

hence:
quote:
Originally posted by CookieRevised
(but isn't PHP doing this also in a way?)
If you only look at it as what is done server/client side, yep, only 1 thing gets loaded in php. But thus that was not what I meant with it though, sorry for being a bit vague there.

-----------------------------------


quote:
Originally posted by ShawnZ
But come on? Using the location.hash for that kind of thing is laughable coding. In fact, I highly suggest Methos2 avoids the suggestion.
1) using js for redirecting is perfectly sane (and frankly, quite often done all over the place, yes, even on these forums). Nothing laughable at all...
2) Using anchors for only redirecting is less sane though, but can sometimes be the only possible way. again, nothing laughable at all in those cases...

quote:
Originally posted by ShawnZ
quote:
Originally posted by CookieRevised
What happens if the creator hasn't access to a PHP enabled host?
Well, at least there isn't a RISK involved in that.
Who's talking about risk? In fact, if you only talk about this specific use, then there is less risk for the user if some creator did it in javascript than if the creator did it in php. As the user can see the source of the (javascript) page and thus can see and have a clue of what it does. If it was in php, the user can only guess what it will do and hope for the best...

-----------------------------------

But all this is going towards what's best to use. I never ever said anywhere that javascript is the best thing to use over php. I only gave an alternative, nothing more, nothing less.

So no this wasn't off topic as both methods are extremely closely related and are alternatives for eachother in some specific uses. And thus I posted what I posted to make the picture complete.

eg/analogy: If someone asks to create a plugin so he can attach text to a custom sound, and you make a post about quicktexts than that isn't off topic either. Though quick texts have got nothing to do with custom sounds (even less than what anchors have to do with php) and plugins, it provides an alternative way to what the user, and people who might come across the thread, wants. Although the original poster asked his question in relation to plugins, he don't nessecairly meant he wants a plugin to do it; as long as the job gets done. He might simply don't know another method....

edit: @rav0: that can be the exactly what people might want in some cases. Don't dismiss it simply because of that. Remember that these anchors, and the equivalent in php, can also be used for other stuff than a simple redirection (eg: to parse info to a page and set some form elements or whatever).

This post was edited on 12-21-2005 at 11:08 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-21-2005 12:55 AM
Profile PM Find Quote Report
rav0
Veteran Member
*****

Avatar
i have an avatar

Posts: 1419
Reputation: 29
35 / Male / Flag
Joined: Aug 2003
RE: /?id=home
Check out my thread about this. The method that -dt- posted is my choice, but there are more there as well.

CookieRevised, this is why not to use JavaScript to redirect.

This post was edited on 12-21-2005 at 10:52 AM by rav0.
| [Image: dorsh] |

(\ /)
(O.o)
(> <)

This is Bunny. Copy Bunny into your signature to help him on his way to world domination
12-21-2005 08:35 AM
Profile E-Mail PM Web Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
21 / Other / Flag
Joined: Jul 2003
RE: /?id=home
http://shoutbox.menthix.net/showthread.php?tid=45...d=473328#pid473328
12-21-2005 09:50 AM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: /?id=home
I use ?id=home on my websites for the homepage it is a script that allowed a series of includes on a page, thus you dont have to update each page when you alter a design. The page extension must be in php.

Here is what I use on my websites:

<?PHP
error_reporting (E_ALL ^ E_NOTICE);
if(!$id){ $id = $HTTP_GET_VARS['id']; }

if($id=="" or $id=="home"){
    include("home.php");
}elseif($id=="asmiles"){
    include("animatedsmiles/index.php");
}elseif($id=="backgrounds"){
    include("backgrounds/index.php");
}elseif($id=="downloads"){
    include("downloads/pafiledb.php");
}elseif($id=="dp"){
    include("dp/index.php");
}elseif($id=="names"){
    include("names/index.php");
}elseif($id=="smiles"){
    include("smiles/index.php");
}elseif($id=="web"){
    include("web.php");
}
?>

(that's part of msgstuff)


you add this where your page content begins and in the includes you add the other pages, but just the basic code and not all the html and head tags.
12-21-2005 02:12 PM
Profile PM Find Quote Report
hmaster
Senior Member
****

Avatar

Posts: 716
Reputation: 24
33 / Male / Flag
Joined: Nov 2004
RE: /?id=home
I use to have something similar to the if/else..
code:
//Page system

if(!isset($_GET['page']))
    {include('index.htm');}

elseif($_GET['page'] == "home"){include('index.htm');}
elseif($_GET['page'] == "news"){include('news.htm');}

//msn pages
elseif($_GET['page'] == "msn"){
    if(!isset($_GET['ver']))
    {include('msn.htm');}
      elseif($_GET['ver'] == "8")
    {include('msn/wlm.htm'); }
    elseif($_GET['ver'] == "7.5")
    {include('msn/7.5.htm'); }
    else{include "error.php";}
    }
       
elseif($_GET['page'] == "desktop"){include('desktop.htm');}
elseif($_GET['page'] == "downloads"){include('downloads.htm');}
elseif($_GET['page'] == "info"){include('info.php');}

elseif($_GET['page'] == "contact"){include('contact.htm');}
elseif($_GET['page'] == "contacted"){include('contact.php');}
elseif($_GET['page'] == "projects"){include('projects.htm');}

//w2m sec
elseif($_GET['page'] == "w2m"){
    if(!isset($_GET['sec']))
    {include('w2m/index.php');}
    elseif($_GET['sec'] == "start")
    {include('w2m/start.php'); }
    elseif($_GET['sec'] == "tut")
    {include('w2m/tut.php');}
   
    else{include "error.php";}
    }
   
//wdp sec
elseif($_GET['page'] == "wdp"){
    if(!isset($_GET['sec']))
    {include('wdp/dynamic.php');}
    elseif($_GET['sec'] == "dynamic")
    else{include "error.php";}
    }

else{include "error.php";}

But then I got too many pages so i changed it to switch/case:

code:
if(!isset($_GET['page'])) {include "index.htm";}
elseif($_GET['page'] == "msn" && !isset($_GET['ver'])) {include "msn.htm";}
elseif($_GET['page'] == "w2m" && !isset($_GET['sec'])) {include "w2m/index.php";}
elseif($_GET['page'] == "wdp" && !isset($_GET['sec'])) {include "wdp/dynamic.php";}
elseif($_GET['page'] == "projects" && !isset($_GET['id'])) {include "projects.htm";}
else {
switch ($_GET['page']) {
               
    case "home":
        include "index.htm"; break;
    case "news":
        include "news.htm"; break;
    case "desktop":
        include "desktop.htm"; break;
    case "comics":
        include "comics.htm"; break;
    case "downloads":
        include "downloads.htm"; break;
    case "contact":
        include "contact.htm"; break;
    case "info":
        include "info.php"; break;
    case "wdp":
        switch($_GET['page'] == "wdp" && @$_GET['sec']) {
        case "dyimg":
            include "wdp/dyimg.php"; break;
        case "dynamic":
            include "wdp/dynamic.php"; break; }
}
}

These are not all the pages, itll take too much space

This post was edited on 12-21-2005 at 02:39 PM by hmaster.
[Image: sig.png]
12-21-2005 02:39 PM
Profile PM Web Find Quote Report
stoshrocket
Senior Member
****

Avatar
formerly methos

Posts: 748
Reputation: 31
34 / Male / Flag
Joined: Aug 2005
O.P. RE: /?id=home
quote:
Originally posted by Absorbation
I use ?id=home on my websites for the homepage it is a script that allowed a series of includes on a page, thus you dont have to update each page when you alter a design. The page extension must be in php.

Here is what I use on my websites:

<?PHP
error_reporting (E_ALL ^ E_NOTICE);
if(!$id){ $id = $HTTP_GET_VARS['id']; }

if($id=="" or $id=="home"){
    include("home.php");
}elseif($id=="asmiles"){
    include("animatedsmiles/index.php");
}elseif($id=="backgrounds"){
    include("backgrounds/index.php");
}elseif($id=="downloads"){
    include("downloads/pafiledb.php");
}elseif($id=="dp"){
    include("dp/index.php");
}elseif($id=="names"){
    include("names/index.php");
}elseif($id=="smiles"){
    include("smiles/index.php");
}elseif($id=="web"){
    include("web.php");
}
?>

(that's part of msgstuff)


you add this where your page content begins and in the includes you add the other pages, but just the basic code and not all the html and head tags.

let me see if i understand this:: i create a template with this code in,  so that the content is not in and it will be the actual style then save it as a .php file, then create the very basic coding of different pages ie it would just be::

code:
<div class="body">
content filler
content filler
content filler
</div>


saving this as content.php (and using the id as "content")

then for the link would i put <a href="?id=content">... yes?
formerly methos
12-21-2005 03:32 PM
Profile PM Web Find Quote Report
absorbation
Elite Member
*****

Avatar

Posts: 3636
Reputation: 81
– / Male / Flag
Joined: Feb 2005
RE: /?id=home
quote:
Originally posted by Methos2
then for the link would i put <a href="?id=content">... yes?

Infact i'll show you the source code i use for http://www.absorbation.com

As you can see i start the php where the content starts, feel free to view the includes source to, to see how it works :)

(See Attachment)

.php File Attachment: index.php (3.18 KB)
This file has been downloaded 206 time(s).

This post was edited on 12-21-2005 at 03:37 PM by absorbation.
12-21-2005 03:36 PM
Profile PM Find Quote Report
stoshrocket
Senior Member
****

Avatar
formerly methos

Posts: 748
Reputation: 31
34 / Male / Flag
Joined: Aug 2005
O.P. RE: /?id=home
quote:
Originally posted by Absorbation
quote:
Originally posted by Methos2
then for the link would i put <a href="?id=content">... yes?

Infact i'll show you the source code i use for http://www.absorbation.com

As you can see i start the php where the content starts, feel free to view the includes source to, to see how it works :)

(See Attachment)


thankyou!! thanks to everyone, i understand it now, cheers!
formerly methos
12-21-2005 03:40 PM
Profile PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: /?id=home
quote:
Originally posted by Absorbation

<?PHP
error_reporting (E_ALL ^ E_NOTICE);
if(!$id){ $id = $HTTP_GET_VARS['id']; }

if($id=="" or $id=="home"){
include("home.php");
}elseif($id=="asmiles"){
include("animatedsmiles/index.php");
}elseif($id=="backgrounds"){
include("backgrounds/index.php");
}elseif($id=="downloads"){
include("downloads/pafiledb.php");
}elseif($id=="dp"){
include("dp/index.php");
}elseif($id=="names"){
include("names/index.php");
}elseif($id=="smiles"){
include("smiles/index.php");
}elseif($id=="web"){
include("web.php");
}
?>
why not do
if(!$id){ $id = $HTTP_GET_VARS['id']; }
to
if(isset($_GET['id'])){ $id = $_GET['id']; }else { $id=''}


insted of changing error_reporting and removing notices , just fix your code.
A NOTICE == BAD CODE.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
12-21-2005 03:54 PM
Profile PM Web Find Quote Report
stoshrocket
Senior Member
****

Avatar
formerly methos

Posts: 748
Reputation: 31
34 / Male / Flag
Joined: Aug 2005
O.P. RE: /?id=home
am i understanding this right, for the template i have created the file needed and its working fine, although i still must not be doing something right, its not working::
for the include aea i have the following code under the <body> tag
code:
<body>

<div class="banner">
</div>

<div class="nav">
<a href="/?id=home">home</a>
<a href="/?id=graphics">graphics</a>
<a href="/?id=webdesign">web design</a>
<a href="/?id=projects">projects</a>
<a href="/?id=msn">msn</a>
</div>

<?PHP
error_reporting (E_ALL ^ E_NOTICE);
if(!$id){ $id = $HTTP_GET_VARS['id']; }

if($id=="" or $id=="home"){
    include("home.php");
}elseif($id=="graphics"){
    include("graphics.php");
}elseif($id=="webdesign"){
    include("design.php");
}elseif($id=="projects"){
    include("projects.php");
}elseif($id=="msn"){
    include("msn.php");
}elseif($id=="about"){
    include("about.php");
}elseif($id=="contact"){
    include("contact.php");

}
?>

</body>

and the file home.php consistis of only
code:
<div class="content">
<div class="dt">
<span class="dt"><script type="text/javascript">document.write(getdt())</script></span>
</div>

this is a test of the new site design, it isnt working

</div>


am i doing something wrong here? i cant see why it wouldnt work unless im doing the home.php file wrong, as i have compared my coding to absorbations..... :S
formerly methos
12-21-2005 09:15 PM
Profile PM Web Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On