We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Code showing on web page???

Development and Programming

Collette Curry's avatar
Collette Curry
6 posts
14 years ago
Collette Curry's avatar Collette Curry
<?

global $IN;
global $DB;


$this->EE =& get_instance();
$seg1 = $this->EE->uri->segment(1);

$member_id="0";
$title="";
$feed="";

if ($seg1 == "") $seg1="onzinnnnn";

$query = $DB->query("SELECT m.screen_name as screen_name, m.member_id as member_id, d.m_field_id_23 as strapline, d.m_field_id_41 as feed   FROM exp_members m LEFT JOIN exp_member_data d ON m.member_id = d.member_id
WHERE d.m_field_id_27 ='" . $seg1 ."'");

if ($query->num_rows == 1)
{
    $member_id = $query->row['member_id'];
    $feed = $query->row['feed'];
    $title = $screen_name = $query->row['screen_name'].", ".$query->row['strapline'] .

Any idea why this text is displaying on a newly upgraded version of EE????

We upgraded from 1.6.8 to the latest version and got this problem occurring on the home page. Any help much appreciated.

Collette Curry 😊

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
14 years ago
Sue Crocker's avatar Sue Crocker

Hi, Collette.

First tings first. What are you attempting to do with this bit of PHP code? There may be other ways of doing things.

       
Collette Curry's avatar
Collette Curry
6 posts
14 years ago
Collette Curry's avatar Collette Curry

Hi, I’m not entirely sure as it’s not working and I can’t test it on the old site. I think it sets up the user parameters then leads into some MySql commands later on.

Hope this helps 😊

Collette

       
Kevin Smith's avatar
Kevin Smith
4,784 posts
14 years ago
Kevin Smith's avatar Kevin Smith

Hi Collette,

Is this publicly accessible? If so, could I get a link?

Have you checked to make sure the settings for this template in 1.x are the same as they are now in 2.x? Is the template allowing PHP? What is PHP Parsing Stage set to?

Could you post the part of the template where this code is located (along with code before and after) so that we can have a better look at it?

Thanks!

       
Collette Curry's avatar
Collette Curry
6 posts
14 years ago
Collette Curry's avatar Collette Curry

Test site

Hi,

The page won’t load with ‘PHP’ allowed on either ‘input’ or ‘output’. The code worked in 1.6.* but not in 2.2.* Any clues would be much appreciated since it’s holding up the sites live launch.

Thanks 😊

       
Collette Curry's avatar
Collette Curry
6 posts
14 years ago
Collette Curry's avatar Collette Curry

<pre><code><?

global $IN; global $DB;

$this->EE =& get_instance(); $seg1 = $IN->fetch_uri_segment(‘1’);

       
Collette Curry's avatar
Collette Curry
6 posts
14 years ago
Collette Curry's avatar Collette Curry

Okay, so I now know that the syntax has changed for EE2.x

Will just work through the template and all should be fine.

Thanks 😊

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
14 years ago
Lisa Wess's avatar Lisa Wess

Hi, Collette -

Yes, EE 2 does change how PHP works to be inline with CodeIgniter. Are you all set now to work through this? I can move this down to Dev & Programming if you need some help.

Let us know.

       
Collette Curry's avatar
Collette Curry
6 posts
14 years ago
Collette Curry's avatar Collette Curry

Hi Lisa, that would be good in case I hit any snags. I appreciate your help 😊

Collette

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.