Very basic question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
biatchy001
Forum Newbie
Posts: 4
Joined: Wed May 19, 2010 6:32 am

Very basic question

Post by biatchy001 »

Hi Guys,

I currently have an online store and want to edit some text.
I have some basic understanding of html but am completely lost with php. I'm sure this will be annoying for most of you out there :)

if you visit my page at http://www.cuppingandacupuncture.com.au ... ?info_id=5
you will notice the spelling error "Rrturn".

All i want to know is how I can change this text. I have looked through the file information.php but the text is not contained within this file. I believe that the text is stored as a string variable in info_id ???

How would i change this text?

Many thanks in advance!
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Very basic question

Post by Benjamin »

This could be in the database or in the source code. I would search the code for that string, and if found simply fix it. If it's in the database you will need to determine what table it is in and find the record, then update it.
biatchy001
Forum Newbie
Posts: 4
Joined: Wed May 19, 2010 6:32 am

Re: Very basic question

Post by biatchy001 »

Hi Benjamin,

I believe that the string will be on the database as I cannot find it within the source code.
How would I access the database and find this table?
I have included some of the text from the php file below:

Code: Select all

require('includes/application_top.php');

  // Added for information pages
 // if(!$_GET['info_id']) die("No page found.");
  $info_id = $_GET['info_id'];


  $sql=tep_db_query("SELECT * FROM ".TABLE_INFORMATION." WHERE visible='1' AND information_id='".(int)$info_id. "' and languages_id = '" . (int)$languages_id  . "'" );
  $row=tep_db_fetch_array($sql);
  $INFO_TITLE = stripslashes($row['info_title']);
  $INFO_DESCRIPTION = stripslashes($row['description']);

  // Only replace cariage return by <BR> if NO HTML found in text
  // Added as noticed by infopages module
  if (!preg_match("/([\<])([^\>]{1,})*([\>])/i", $INFO_DESCRIPTION)) {
    $INFO_DESCRIPTION = str_replace("\r\n", "<br>\r\n", $INFO_DESCRIPTION );
  }

  $breadcrumb->add($INFO_TITLE, tep_href_link(FILENAME_INFORMATION, 'info_id=' . $row['information_id'], 'NONSSL'));

  $content = CONTENT_INFORMATION;

  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>


Thanks.
Last edited by Benjamin on Wed May 19, 2010 6:59 am, edited 1 time in total.
Reason: Added [syntax=php] tags.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Very basic question

Post by Benjamin »

Well, you can use a tool such as phpMyAdmin, but you will need to be careful what you do. It's akin to the system registry of your website.
biatchy001
Forum Newbie
Posts: 4
Joined: Wed May 19, 2010 6:32 am

Re: Very basic question

Post by biatchy001 »

Thanks!
but....

Hmmm.....would anyone be able to provide a basic run down of the steps required to access my mySQL and, find the appropriate table and make changes based on the code i have supplied?

bear in mind I am a complete newb :banghead:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Very basic question

Post by Benjamin »

I don't see the spelling error on that page. You might want to check the admin panel to see if it's in one of the language versions of that page. If not, it could be in the actual language files which you could find by searching the code base.
biatchy001
Forum Newbie
Posts: 4
Joined: Wed May 19, 2010 6:32 am

Re: Very basic question

Post by biatchy001 »

The spelling error is located in the heading mid way down the page.

You will see that return is spelled incorrectly. "Rrturn"
Post Reply