...

View Full Version : How to view/edit a php "instance"



sydd
04-30-2009, 02:34 AM
Good Morning,

I'm currently managing a website which a company has developed years ago (and is now out of business, so naturally I'm unable to contact anyone there. And I'm only an Intern so, yeah.).

I'm faily decent with HTML coding but I've never so much as touched PHP.
What I need to do is edit and view the source of a couple of PHP tags, i.e.:

{:newsList:}

I have full access to the FTP and the Administrator page, but I can't seem to find the particular coding which I have to edit in order to add news and whatnot.

Any help? If you need more details or if I'm being incomprehensible, I'll try to provide them and be a little clearer if wanted.

Best Regards

sydd
04-30-2009, 03:47 AM
Okay, follow-up, since I didn't really make myself clear:

I know where the items are located for this specific {:newsList:} (they're on the /admin page.), but on the website itself only the 3 most recent news are shown in the news/events-box, where the php tag {:newsList:} is located. so in order to add more than 3 news, I figure I have to edit SOMETHING _SOMEWHERE_, but I have no idea where to look. there's nothing in the templates and I have no idea whatsoever if and where I can edit the php tags (I know I'm probably using the incorrect terminology, forgive me.).

Best Regards

_Aerospace_Eng_
04-30-2009, 04:58 AM
Its likely a mysql query that is returning only 3 rows from a database. Can you post the code for your admin page? Also this doesn't belong in the HTML/CSS forum.

sydd
04-30-2009, 05:17 AM
Sorry about the wrong forum, I kind of stumbled in here via google.

Anyway, which code do you mean specifically? From the selected news?

The three news are in the database along with all the other news that are in the /news column. Okay, let me rephrase this somehow: The /index.php?page=news has all the different news which are in the database, those I can edit (content/topic) and add new ones myself via simple "Add/Edit". Then on the main page there's a nifty little column on the right hand side of the page which shows current News and Events, and beneath that there's 3 news listed - the newest three - with date/topic/little snippet from the content and a "more" button. Those three news on the main page I want to edit and add MORE than 3. Yet I have no clue as to how I can edit that {:newsList:}.

_Aerospace_Eng_
04-30-2009, 06:36 AM
I know what you are trying to do but without you posting any code we can't help you much. Look for LIMIT 3 in your files. It will help narrow it down as to what you need to edit.

sydd
04-30-2009, 06:50 AM
At the risk of sounding overly ignorant: Where should I be looking exactly? I'm fairly certain there's no LIMIT 3 line anywhere in the templates, with which I've been working with for most of the time. /public_html/phpmyadmin? I've skimmed through a couple of php files like main, index, etc but nothing so far.

_Aerospace_Eng_
04-30-2009, 07:00 AM
At the risk of sounding overly ignorant: Where should I be looking exactly? I'm fairly certain there's no LIMIT 3 line anywhere in the templates, with which I've been working with for most of the time. /public_html/phpmyadmin? I've skimmed through a couple of php files like main, index, etc but nothing so far.
You'll need to do a mass find through all of your files. The only way your news. Again we NEED to see some code. Help us help you. Post the php to your index file. LIMIT 3 won't be in a template. It will be in a mysql query somewhere. If you do a search for mysql you'll likely find all of the queries on the site which is likely a lot but you'll probably find the one I'm talking about.

You may want to consider hiring someone to do the work for you before you mess things up.

Samhain13
04-30-2009, 07:10 AM
This is a tough one, as Aerospace says, without any code solving this problem involves a lot of guess work. Anyway...

The "LIMIT 3" probably won't be a line on its own. It will be a part of an SQL string/command, something like:


$sql = "SELECT * FROM `thedatabase` ORDER BY `id` LIMIT 3;" ;

This code might appear in one of the files that you mentioned: main.php, index.php, etc. (Perhaps, if there is a file called "news.php", it probably is the best place to start looking for that SQL string/command.) But I don't think you should edit any of the files in phpmyadmin (unless you really know what you're doing).

PHPMyAdmin is the set of scripts that give you the administrative interface to your MYSQL databases. In most cases, it will have nothing to do with your website's frontend presentation. So, I would suggest you leave the scripts in that directory untouched.

novawatson
04-30-2009, 07:35 AM
The above thought is smart and doesn’t require any further addition. It’s perfect thought from my side.
..............
nova
Auto Quotes (http://www.autoquotes247.net)

sydd
04-30-2009, 08:20 AM
Thank you VERY much for the replies, I can't say I've made any progress, but at least now I know what I'm looking for.
I figured out where the {::} strings eventually lead in PHPMyAdmin, but like I said I need that source code (the LIMIT 3 part). Because once I figure out where the guys that designed the website for the company put that, I'll be able to change a couple of other things as well that need doing.

First thing I'm going to do now is sift through all the .php files on the server and try to look for that snippet of code (Maybe google knows where to get a this-program-can-search-all-your-documents-on-your-webserver-for-a-specific-code.exe). If I find it, I'll post whatever you guys need in order to help me.

Of course there's no news.php in that folder, would be too easy now, wouldn't it? :p No wonder the design-company that did our website went out of business.

Best Regards

sydd
04-30-2009, 09:26 AM
Fun!

I'm looking through all the .php files on the server, and now I downloaded one called locu.php which was in a file-archive somewhere, and WHAM:

Detected
Trojan program:
Backdoor.PHP.C99Shell.m

Is this normal? I know I'm not in the proper forum for this, but I figured you guys will probably know. Google doesn't give me anything about this specific trojan.

sydd
04-30-2009, 10:14 AM
Forget the above.

After hours of looking, I found alot of files in the /public_html/_engine folder with the term "newsList" in them.

As follows:

Files with the specific code: AGFunctionsLib.class.php, AGFunctionsLibEstore.class.php, 1AGFunctionsLib.class.php, 2AGFunctionsLib.class.php, etc... Problem is that most of these files are about 300kb large, meaning a ****load of code.

The code itself is this:


/*--content--*/

$layout->AddComponent('topNavigation',$f->getTopNavigation());

$conf['fg2'] = "98;98;98";
$conf['bg2'] = "214;214;214";
$strTitleNews = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitlePractical').",150,26,LEFT,TREBUC.TTF,14,$strDisp,".$conf['fg2'].",".$conf['bg2'])."' vspace=0 hspace=0>";

$conf['fg3'] = "74;75;76";
$conf['bg3'] = "255;255;255";
$strTitleEvents = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitleEvents').",200,20,LEFT,TREBUC.TTF,11,$strDisp,".$conf['fg3'].",".$conf['bg3'])."' vspace=0 hspace=0>";


$layout->AddComponent('txtEventsList', $strTitleEvents);
$layout->AddComponent('txtNewsList', $strTitleNews);
$layout->AddComponent('newsList', $f->getNewsList(3));
//$layout->AddComponent('eventsList', $f->getEventList(3));

Problem is that there's ALOT of newsList(3) stuff around. It gets repeated over and over again.

Like so:


$conf['fg2'] = "74;75;76";
$conf['bg2'] = "255;255;255";
$strTitleNews = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitleNews').",200,20,LEFT,TREBUC.TTF,11,$strDisp,".$conf['fg2'].",".$conf['bg2'])."' vspace=0 hspace=0>";

$conf['fg3'] = "74;75;76";
$conf['bg3'] = "255;255;255";
$strTitleEvents = "<img src='_engine/title.gif.php?args=".base64_encode($f->getInterfaceContent('TitleEvents').",200,20,LEFT,TREBUC.TTF,11,$strDisp,".$conf['fg3'].",".$conf['bg3'])."' vspace=0 hspace=0>";


$layout->AddComponent('txtEventsList', $strTitleEvents);
$layout->AddComponent('txtNewsList', $strTitleNews);
$layout->AddComponent('newsList', $f->getNewsList(3));
//$layout->AddComponent('eventsList', $f->getEventList(3));

Any of this useful in some way? Sorry for bothering you with this, by the way.

_Aerospace_Eng_
04-30-2009, 03:18 PM
Its likely these lines.

$layout->AddComponent('newsList', $f->getNewsList(3));

If you can post the function for getNewsList we can tell you for sure but try changing that 3 to something else bigger or smaller.

sydd
05-01-2009, 02:24 AM
Did it.

Figured that the AGFunctionsLib was the original file and just sifted through until I found a part which started with Home Page and defaultPage, so I thought it had to be the one I was looking for.

Changed the 3 to a 4 and voilà.

Thanks again for the help.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum