| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm new to this and need help with 2 things.
You'll maybe not understand, hope you do though 1) I setup a website @ http://team-300.net/templates/1/index.php and for any php page I create it would show the contents of the first page from http://team-300.net/templates/1/index.php?site=news and for example, if I do create a link "awards.php" http://team-300.net/templates/2/index.php?site=awards would still point to index.php?page=news showing the contents of that page (No redirection) the page itself 2) Also have 5 designs of that website, trying to show the contents of news.php for each news.php for each design e.g. http://team-300.net/templates/1/index.php?page=site the same as http://team-300.net/templates/2/index.php?page=site I have no clue of doing this, seems a little complicated. I do not want to do this manually for each theme as this will take very long and as I know there's another way but I just don't know how I can't point http://team-300.net/templates/2/index.php?page=news to templates/1/index.php?page=news as it would show template 1 and can't do the same for templates/2/index.php?page=news to point to templates/1/news.php as this will just show the contents, not the design/index.php iteslf. Also, try not to comment on frames if you can BUT if that's the only way, then I got no choice. Yeah, problem 1 is the main thing so if you can help I'll appreciate it. Thanks! Karim Last edited by karimali831; 01-13-2008 at 09:25 PM. |
|
|||
|
Hi Karim,
I am afraid that I don't understand your post, not sure what you mean. Maybe if you could explain it again and maybe deal with one problem at a time, then someone here might be able to help?? Also explain where the page info is coming from. Database? I had a quick look at your site and the first thing that i noticed was the coding for the page shows head and body sections repeated a few times. Copied below: Code:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" x-undefined> <title>New Page 1</title> </head> <body> </body> </html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" x-undefined> <title>New Page 1</title> </head> <body> </body> </html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" x-undefined> <title>New Page 1</title> </head> <body> </body> </html> <html> <head>
__________________
West Dorset Community |
|
|||
|
I'll try explain 1 again with codes.
I am able to use this fine -> Code:
<td width="196" height="42" valign="top"><? include("sc_files.php"); ?></td>
BUT When using this code, it doesn't work. The index.php?site=gallery will just point to a different unspecified php page Code:
<a href="index.php?site=gallery" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','Bilder/gallery1_47.jpg',1)"><img src="Bilder/gallery_47.jpg" name="Image41" width="167" height="15" border="0"></a></td>
I tried Code:
<? include("sc_files.php"); ?><onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image41','','Bilder/gallery1_47.jpg',1)"><img src="Bilder/gallery_47.jpg" name="Image41" width="167" height="15" border="0"></a></td>
Thanks for your reply Last edited by karimali831; 01-16-2008 at 07:32 PM. |
|
|||
|
I think if you are going to be 'including' text in the form of ?site=gallery then somewhere (usually stored in a database) there is a field entitled 'gallery' which also contains a text field.
For instance; on my main index.php page i would first need to create a variable that gets the content of site, so......... $site=$_GET['site']; Then if i clicked on the link: <a href="index.php?site=gallery"> I would query the database: $query="SELECT * FROM db WHERE title = '$site'" this would then get the text that i need from the database. If the files are static pages then you could use the example above but instead of using a database you could use (from your example): <td width="196" height="42" valign="top"><? include($site.".php"); ?></td> A bit unconventional though, database is best option. Or do you mean something different?
__________________
West Dorset Community |
|
|||
|
Quote:
![]() But now you say it, I want a database! Have no clue what you just said though, must I create one at first? I sent you a PM |
|
|||
|
Ah if you have no clue of PHP jumping into a database is not the best thing.
First lets look at how you solve the problem. You need to make a plan of how you want it to work (in the old days it was called a flow chart This helps you set the process going. So if I understand it correctly you want to show index.php with contents of unknown pages (cos you create them at will). The easiest way to do this is to create text files rather than php. (the same as importing into macromedia flash) If you save them ALL in the same folder on the server, you can use php to look at what is in the folder and DO something with it, WITHOUT knowing the file name or contents. (you could for instance list all files and make them links to content if they are php or html) Databases are great and I use them alot, BUT you need to get some basic understanding here before treading much deeper technical stuff. I have learnt over the last 4 years php then mySql and I still do not know 100%. |
|
|||
|
I think if you are going to use text files and php include, you would be better off creating a standard static website. Too much hassle for little or no benefit imo.
As far as php/mysql and interacting with databases, it is fairly simple to learn as both include learning just the basics. There are plenty of tutorials about just search for google. But as someone mentioned a while back, why reinvent the wheel, there are plenty of free cms available also.
__________________
West Dorset Community |
|
|||
|
I'm afraid nothing makes sense to me if it's php related. I can't read aswell as write php; I've uploaded the index.php .. from what's there and what your all saying I'm totally confused = Total newbie =
Thanks for your help |
|
||||
|
What you have got is ok
PHP Code:
Quote:
Quote:
Quote:
Quote:
![]() Last edited by Foddski; 01-17-2008 at 03:47 PM. |
|
|||
|
I think I did it... it's this part which needs to be edited
Quote:
Last edited by karimali831; 01-17-2008 at 05:50 PM. |
|
|||
|
Ok got that theme sorted now for this one;
Is it this bit what needs editing? Now I want this to be the same as the other one, so all files are included. "news.php" "gallery.php" etc.. not sure how to add it on this part unless it's something different see the attatchment Code:
<?
if(!isset($site)) $site="news";
//Sichheitslücke beheben
$invalide = array('/','/\/',':','.');
$site = str_replace($invalide,' ',$site);
if(!file_exists($site.".php")) $site = "news";
include($site.".php");
?>
Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
|
|