PHP Web Host - Quality Web Hosting For All PHP Applications $35/month $250/year (Unlimited) - $25/month - 200,000 impressions - Your Ad Could be Here - Click For Details
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Sun Sep 20, 2009 7:45 am Reply with quote Back to top

Does anyone know if there is a way to change many file extensions in one go.

ie file.htm to file.php.

I have a software program which generates many htm files for our fixtures etc. I can easily add the include("header.php"); and include("footer.php") parts but would still need to change the type.

Not a problem with a few files but when there are 240 plus, it becomes a nightmare.

Currently use nukewrap but was looking for an alternative.

Any ideas?
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sun Sep 20, 2009 9:22 am Reply with quote Back to top

This thread might help you Smile
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Sun Sep 20, 2009 12:01 pm Reply with quote Back to top

Thank you.
View user's profile Send private message Visit poster's website
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Sun Sep 20, 2009 5:55 pm Reply with quote Back to top

I know that
Code:
<?php
if (!isset($mainfile)) { include("mainfile.php"); }
include("header.php");
?>
works if the file is in the root, but if a file is in root/folder/file.php, does it need to be
Code:
<?php
if (!isset($mainfile)) { include("siteurl/mainfile.php"); }
include("siteurl/header.php");
?>

Sorry but I've been searching for an hour Crying or Very sad
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sun Sep 20, 2009 7:38 pm Reply with quote Back to top

The include is relative to mainfile.php . So you shouldn't need to change anything.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Mon Sep 21, 2009 1:32 am Reply with quote Back to top

But if I put the file in the root it appears as it should
Only registered users can see links on this board!
Get registered or login to the forums!


But if I put the file in a folder, it gives me a blank page. or errors
Only registered users can see links on this board!
Get registered or login to the forums!


Only registered users can see links on this board!
Get registered or login to the forums!


Last edited by rebelt on Sun Sep 27, 2009 1:13 am; edited 1 time in total
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Sep 21, 2009 2:10 am Reply with quote Back to top

Then prefix the include with ../ for every sub folder depth.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Mon Sep 21, 2009 2:43 am Reply with quote Back to top

I did that first but got blank pages. Shocked
Code:
<?php
if (!isset($mainfile)) { include("../mainfile.php"); }
include("../header.php");
?>

That's why I wondered if it need to be a url

(pages at above links updated with the ../)

Here is the whole file in case there is something else causing this.

Code:
<?php
if (!isset($mainfile)) { include("../mainfile.php"); }
include("../header.php");
?>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator"      CONTENT="Universal League Manager at
Only registered users can see links on this board!
Get registered or login to the forums!

<META NAME="DESCRIPTION"    CONTENT="RedsealSW">
<META NAME="KEYWORDS"       CONTENT="Redseal, Universal League Manager, Sports League, tournament, sports scheduling, league Fixtures, league organizer, league organiser, League scheduling software, League Management, League Management Software, League Registration Software, Schedule maker, Scheduler, Scheduling, pool, pool league, poolleague, pool-league, poollg, pool league software, billards, league manager, league operator, league software, 8 ball, 9 ball, 10 ball, Black ball,8ball ,9ball, 10Ball, BlackBall, 8-ball, 9-ball, 10-ball, Black-ball, billiards, snooker, 8 Ball Pool League">
<META NAME="RESOURCE-TYPE"  CONTENT="Homepage">
<META NAME="REVISIT-AFTER"  CONTENT="7 days">
<META NAME="ROBOTS"         CONTENT="INDEX,FOLLOW">
<META NAME="COPYRIGHT"      CONTENT="2009 RedsealSW.com">
<!-- Stylesheets -->
<link rel="stylesheet" type="text/css" href="WS 2009.CSS">
<!-- Standard meta tags -->
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta name="Robots" content="all" />
<TITLE>Winter Season 2009</TITLE>
</HEAD>

<BODY>
<P class=hc1><A href="ws_2009_main.php">Winter Season 2009</A></P>
<P> </P>
<P class=hc2>Divisions</P>
<P> </P>
<P><TABLE BORDER=3 CELLSPACING=1 CELLPADDING=3 WIDTH="80%" ALIGN=CENTER BORDERCOLOR=B1CFED BGCOLOR=B1CFED>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="26%" VALIGN="TOP">
<P ALIGN=CENTER><B><span style="font-family:Arial;font-size:14pt;color:000000;">Division 1</SPAN></B></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_fixtures.php">Fixtures</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_lom_division_1.php">Matches</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_tables_division_1.php">Table</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="26%" VALIGN="TOP">
<P ALIGN=CENTER><B><span style="font-family:Arial;font-size:14pt;color:000000;">Division 2</SPAN></B></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_fixtures.php">Fixtures</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_lom_division_2.php">Matches</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_tables_division_2.php">Table</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="26%" VALIGN="TOP">
<P ALIGN=CENTER><B><span style="font-family:Arial;font-size:14pt;color:000000;">Division 3</SPAN></B></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_fixtures.php">Fixtures</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_lom_division_3.php">Matches</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_tables_division_3.php">Table</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="26%" VALIGN="TOP">
<P ALIGN=CENTER><B><span style="font-family:Arial;font-size:14pt;color:000000;">Division 4</SPAN></B></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_fixtures.php">Fixtures</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_lom_division_4.php">Matches</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_tables_division_4.php">Table</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="26%" VALIGN="TOP">
<P ALIGN=CENTER><B><span style="font-family:Arial;font-size:14pt;color:000000;">Division 5</SPAN></B></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_fixtures.php">Fixtures</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_lom_division_5.php">Matches</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_tables_division_5.php">Table</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="26%" VALIGN="TOP">
<P ALIGN=CENTER><B><span style="font-family:Arial;font-size:14pt;color:000000;">Division 6</SPAN></B></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_fixtures.php">Fixtures</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_lom_division_6.php">Matches</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_tables_division_6.php">Table</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="26%" VALIGN="TOP">
<P ALIGN=CENTER><B><span style="font-family:Arial;font-size:14pt;color:000000;">Division 7</SPAN></B></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_fixtures.php">Fixtures</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_lom_division_7.php">Matches</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=LEFT><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_tables_division_7.php">Table</A></SPAN></P>
</TD>
</TR>
</TABLE>
<P> </P>
<P class=hc2>Matches and Results</P>
<P> </P>
<P><TABLE BORDER=3 CELLSPACING=1 CELLPADDING=3 WIDTH="80%" ALIGN=CENTER BORDERCOLOR=B1CFED BGCOLOR=B1CFED>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">06/10/2009<br><A href="ws_2009_results_w01.php">League week 1</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">13/10/2009<br><A href="ws_2009_results_w02.php">League week 2</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">20/10/2009<br><A href="ws_2009_results_w03.php">League week 3</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">27/10/2009<br><A href="ws_2009_results_w04.php">League week 4</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">10/11/2009<br><A href="ws_2009_results_w05.php">League week 5</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">17/11/2009<br><A href="ws_2009_results_w06.php">League week 6</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">24/11/2009<br><A href="ws_2009_results_w07.php">League week 7</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">01/12/2009<br><A href="ws_2009_results_w08.php">League week 8</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">08/12/2009<br><A href="ws_2009_results_w09.php">League week 9</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">15/12/2009<br><A href="ws_2009_results_w10.php">League week 10</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">05/01/2010<br><A href="ws_2009_results_w11.php">League week 11</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">12/01/2010<br><A href="ws_2009_results_w12.php">League week 12</A></SPAN></P>
</TD>
</TR>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">19/01/2010<br><A href="ws_2009_results_w13.php">League week 13</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">26/01/2010<br><A href="ws_2009_results_w14.php">League week 14</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">02/02/2010<br><A href="ws_2009_results_w15.php">League week 15</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">09/02/2010<br><A href="ws_2009_results_w16.php">League week 16</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">16/02/2010<br><A href="ws_2009_results_w17.php">League week 17</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="13%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;">23/02/2010<br><A href="ws_2009_results_w18.php">League week 18</A></SPAN></P>
</TD>
</TR>
</TABLE>
<P class=hc2>General</P>
<P> </P>
<P><TABLE BORDER=3 CELLSPACING=1 CELLPADDING=3 WIDTH="40%" ALIGN=CENTER BORDERCOLOR=B1CFED BGCOLOR=B1CFED>
<TR>
<TD BGCOLOR=EEF2F7 WIDTH="20%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_venues.php">Venues</A></SPAN></P>
</TD>
<TD BGCOLOR=EEF2F7 WIDTH="20%" VALIGN="TOP">
<P ALIGN=CENTER><span style="font-family:Arial;font-size:12pt;color:000000;"><A href="ws_2009_outstanding.php">Outstanding</A></SPAN></P>
</TD>
</TR>
</TABLE>
<P> </P>
<P> </P>
<P class=hc6>Generated by <A href="http://www.redsealsw.com/"_target="_blank">RedsealSW</A> version 3.64.0.FR on 20/9/2009 at 23:46</P>

</HTML>

<?php
include("../footer.php");
?>
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Sep 21, 2009 9:10 am Reply with quote Back to top

Without looking at your file structure it's hard to answer for sure. There are different ways to do this. A sure way is to use an absolute path rather than a relative path. See if
Only registered users can see links on this board!
Get registered or login to the forums!
helps.

You can use a url but it really isn't necessary. Look at index.php in RavenNuke(tm). On line 23 you see require_once 'mainfile.php';. Since both index.php and mainfile.php are in the same folder, PHP by default will look for mainfile.php in the same folder where it found index.php, regardless of whether or not index.php is in root or in several folders down. However you called index.php sets the "root" path, in essence.

I have created a series of scripts, for you, that [hopefully] will demonstrate this more clearly. Download them from
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Mon Sep 21, 2009 10:10 am Reply with quote Back to top

This is the file struture.
Image
site_files2 is the root.
Image

ws.2009_main.php is effectively the index file.

When I put an absolute path "http://westonpoolleague.org.uk/mainfile.php" I get
Only registered users can see links on this board!
Get registered or login to the forums!


If I understand it correctly, the fixtures folder is the sub folder 1 level deep.

Sorry if I haven't understood. Bang Head
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Sep 21, 2009 10:29 am Reply with quote Back to top

Your host does not allow include access by url, which as I said, you shouldn't need anyway Smile. Are you sure $mainfile is being set?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Mon Sep 21, 2009 11:01 am Reply with quote Back to top

Image

Sorry, but I'm totally confused.

With an address of
Only registered users can see links on this board!
Get registered or login to the forums!


Quote:
I didn't have to prefix mainfile.php because it is in the same sub-folder


Does that mean I need to have mainfile.php in the sub-folder (fixtures) as well?

I feel a bit like a clueless idiot atm.
View user's profile Send private message Visit poster's website
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Mon Sep 21, 2009 4:31 pm Reply with quote Back to top

Quote:
Since both index.php and mainfile.php are in the same folder, PHP by default will look for mainfile.php in the same folder where it found index.php, regardless of whether or not index.php is in root or in several folders down. However you called index.php sets the "root" path, in essence.

So reading that again as well as looking at
Only registered users can see links on this board!
Get registered or login to the forums!

level-1/index.php becomes the root path.

If so, then mainfile.php needs to be in the same folder. Doesn't it?

or would it need an include path
Quote:
Failed opening 'mainfile.php' for inclusion (include_path='.:/usr/lib/php5')
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Mon Sep 21, 2009 4:47 pm Reply with quote Back to top

Yes. Or just do an include '../mainfile.php';

You would add ../ for each level that mainfile.php is above your current folder.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Mon Sep 21, 2009 5:29 pm Reply with quote Back to top

That's what's confusing me. I have

<?php
if (!isset($mainfile)) { include("../mainfile.php"); }
include("../header.php");
?>

But don't understand why I have a blank page Shocked

It should work. Question

without the ../ or with ../../ I get the errors as I expected (now I expect them anyway Very Happy )

Can't see what is missing. ' instead of " ?
View user's profile Send private message Visit poster's website
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Tue Sep 22, 2009 10:25 am Reply with quote Back to top

OK.

tried this out on my local setup and get error messages instead of the blank page.

Warning: require_once(./config.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\weston\mainfile.php on line 147

Fatal error: require_once() [function.require]: Failed opening required './config.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\weston\mainfile.php on line 147
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Sep 22, 2009 10:57 am Reply with quote Back to top

You are going to need to change all links in all scripts that are not in the root path.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Tue Sep 22, 2009 12:03 pm Reply with quote Back to top

Change?
from
A href="ws_2009_main.php"
to
A href="fixtures/ws_2009_main.php"?
A href="http://localhost/weston/fixtures/ws_2009_main.php"?

236 files 701 links. Good job my old Dreamweaver MX has a find and replace.
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Tue Sep 22, 2009 12:55 pm Reply with quote Back to top

Not necessarily in mass. I shouldn't have said "links". What I mean is, if you had to change the call to mainfile.php to ../mainfile.php then each script will have to be examined to see what scripts they call to see how it relates to where ../mainfile.php is located.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Tue Sep 22, 2009 4:36 pm Reply with quote Back to top

ws_2009_main.php is in effect index.php. All the other files are in the same folder and all have ../mainfile.php.

They all have
Code:
<?php
if (!isset($mainfile)) { include("../mainfile.php"); }
include("../header.php");
?>
<HTML>
Whatever
</HTML>
<?php
include("../footer.php");
?>


All links are to other files in the same folder
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Tue Sep 22, 2009 7:09 pm Reply with quote Back to top

I think what would be easier is to create a PHP wrapper. Use mod_rewrite to point all the .html requests to the PHP script, which will look up and grab the actual .html content
View user's profile Send private message Visit poster's website
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Sat Sep 26, 2009 2:21 am Reply with quote Back to top

Not knowing what mod_rewrite was, I googled it. From what I can understand mod_rewrite is not easy to understand and use for the beginner.

I thought putting the ../mainfile ../header ../footer bits did wrap the html content.

I've learned (thanks to earlier replies) that the ../ tells a file in a folder where to look for the information needed to display the page.

So having told it where to find the top bit (header) bottom bit (footer) and everything in between (maiinfile), it should also now know everything else it needs to display the page. Confused

From what I can see (with my limited knowledge Very Happy ) it's finding ../mainfile.php but thinks ./config.php is somewhere else.

I don't want to keep taking up peoples time, so perhaps it's best just to leave it.

Many thanks for your time and patience.
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Sep 26, 2009 2:50 am Reply with quote Back to top

rebelt wrote:
I've learned (thanks to earlier replies) that the ../ tells a file in a folder where to look for the information needed to display the page.

The ../ does not tell the system where to look. The ../ tells the system to look 1 level/folder up. If the file was 3 levels up then you would code it ../../../file.php .

Remember, everything is relative. So, mainfile.php and config.php are in the same folder. So, since you called mainfile.php by pointing it 1 folder up ( ../mainfile.php ) you are now in that folder, 1 level up. So, config.php, relative to mainfile.php, is not another folder up; it's in the same place. So call it by config.php or ./config.php (note only one dot - ./ ).
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 147

PostPosted: Sat Sep 26, 2009 4:10 am Reply with quote Back to top

Sorry. I understood telling the system to look 1 level/folder up, as telling the system where to look.

So, calling mainfile.php by pointing it 1 folder up ( ../mainfile.php ) and as you are now in that folder. This should also now realise that config.php, is in the same place/folder.

Or am I just not getting it?

Shocked Shocked
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sat Sep 26, 2009 9:19 am Reply with quote Back to top

Correct Wink
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum