Welcome Guest, Not a member yet? Register   Sign In
when I load a model within a controller the link and script tags in the view get embedded within the body tag
#11

[eluser]jedd[/eluser]
[quote author="jedd" date="1254879513"]
JS gets snipped. So let's focus on the link tag for your stylesheet - you can remove the js references from your code, while we do this testing.[/quote]

Quote:What's the page-source for your viewed web page look like - specifically everything between HTML and /HEAD ?
emphasis added
#12

[eluser]jedd[/eluser]
[quote author="midooh" date="1254879682"]
Code:
$this->load->view("Login.php");
$this->load->view("Header.php");
[/quote]

Please confirm that neither of those two view partials do anything with css and js link tags?
#13

[eluser]midooh[/eluser]
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;link href=&lt;?php echo $main_css_template; ?&gt; rel="stylesheet" rev="stylesheet" /&gt;
&lt;title&gt;&lt;?php echo $page_title; ?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<div id="wrapper">
&lt;?php
$this->load->view("Login.php");
$this->load->view("Header.php");
?&gt;
<div id="content">
</div>
</div>
&lt;/body&gt;
&lt;/html&gt;

I ve removed js from the view but i still get the same result

Code:

&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;title&gt;أهلا و سهلا بكم&lt;/title&gt;&lt;/head>&lt;body&gt;

&lt;link href="http://localhost/tahli/system/frontend/CSS/template.css" rel="stylesheet" rev="stylesheet"&gt;


<div id="wrapper">
<div dir="rtl" id="logInLogOut">
&lt;form method="get"&gt;
<label>أسم المستخدم&lt;input name="username" type="text"&gt;&lt;/label>
<label>كلمة المرور&lt;input name="password" type="password"&gt;&lt;/label>
&lt;input value="تسجيل دخول" type="submit"&gt;
&lt;/form&gt;
</div>
<div dir="rtl" id="site_header">
<div id="main_navigation">
<ul id="main_navi_list">
<li><a href="#">عام</a></li>
<li><a href="#">الأدلة و الإجرائات</a></li>
<li><a href="#">الأنشطة</a></li>
<li><a href="#">الزيارات</a></li>
<li><a href="#">النماذج</a></li>
<li><a href="#">أتصل بنا</a></li>
</ul>
<p id="break_line">&nbsp;</p>
</div>
</div>
<div id="content">
</div>
</div>
&lt;/body&gt;

this a snapshot from firebug after the page is rendered
#14

[eluser]jedd[/eluser]
Okay .. well, this source:
Code:
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;link href=&lt;?php echo $main_css_template; ?&gt; rel="stylesheet" rev="stylesheet" /&gt;
&lt;title&gt;&lt;?php echo $page_title; ?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

... can not produce this html:

Code:

&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;title&gt;أهلا و سهلا بكم&lt;/title&gt;&lt;/head>&lt;body&gt;

&lt;link href="http://localhost/tahli/system/frontend/CSS/template.css" rel="stylesheet" rev="stylesheet"&gt;


How sure are you that you're viewing the file that you think you are?

Try changing the title to something hard-coded and reload the page so that you are very sure.
#15

[eluser]midooh[/eluser]
I"m very sure it is because at first i had the same problem before i tried to loload or autoload any model then i fixed after i found out that it was from the encoding of the file everytime i used the utf8 encoding it got embedded within the body but when i used ansi it got fixed now its come back again

The title get embedded properly but the script and the link tags dont
#16

[eluser]jedd[/eluser]
Well, the problem you have looks very weird.

As I say, you can't get to the page-source output from the view page input that you're using.

Apart from anything else, where are the / > disappearing to on the content-type and link href lines?

It really looks like you've got two files here - one that's actually getting processed by CI, and one that you think is getting processed by CI.
#17

[eluser]midooh[/eluser]
your right sorry I downloaded CI again replaced the old files with the new downloaded ones then it worked!
thank u so much it's such a brilliant framework!
#18

[eluser]richfearless[/eluser]
*rubs eyes* i hope i never get this problem, cos i wouldn't know how to explain it.

Midooh where you from?
#19

[eluser]jedd[/eluser]
The trick is to never need to explain it.

When you see output that doesn't match what you believe to be the input, the source of the problem is very easy to identify.

(Hint - you modify the source code to see if the change reflects in the page-source as rendered by your browser - if it does not, you've proven it out.)

This is pretty basic programming theory - it's not even PHP, let alone CI, specific.

These forums are littered with threads containing the emphatic words 'I'm very sure ...'

They are usually followed, some messages later, with the phrase 'Oh, yeah, I forgot that I'd ...'
#20

[eluser]midooh[/eluser]
I still get the same result every time i try to load or autoload a model The style and script tags get embbeded within the body tag

Code:
$autoload['model'] = array("Simple");

i autoloaded this model

&lt;head&gt;&lt;title>Welcome to CodeIgniter&lt;/title&gt;&lt;/head>&lt;body&gt;



&lt;style type="text/css"&gt;

body {
background-color: #fff;
margin: 40px;
font-family: Lucida Grande, Verdana, Sans-serif;
font-size: 14px;
color: #4F5155;
}

a {
color: #003399;
background-color: transparent;
font-weight: normal;
}

h1 {
color: #444;
background-color: transparent;
border-bottom: 1px solid #D0D0D0;
font-size: 16px;
font-weight: bold;
margin: 24px 0 2px 0;
padding: 5px 0 6px 0;
}

code {
font-family: Monaco, Verdana, Sans-serif;
font-size: 12px;
background-color: #f9f9f9;
border: 1px solid #D0D0D0;
color: #002166;
display: block;
margin: 14px 0 14px 0;
padding: 12px 10px 12px 10px;
}

&lt;/style&gt;


<h1>Welcome to CodeIgniter!</h1>

<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>

<p>If you would like to edit this page you'll find it located at:</p>
<code>system/application/views/welcome_message.php</code>

<p>The corresponding controller for this page is found at:</p>
<code>system/application/controllers/welcome.php</code>

<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>


<p><br>Page rendered in 0.0287 seconds</p>

&lt;/body&gt;


the snapshot of welcome example page from firebug I downloaded the framework again and i get the same result I didnt change anycode in the welcome controller example




Theme © iAndrew 2016 - Forum software by © MyBB