Log in

View Full Version : ASP within PHP ???



jmh1988
10-21-2008, 09:13 PM
Hi,

I've got the following php code:

<?PHP
define ('TITLE', 'Page Title Goes Here');
?>

I want to know what I need to do to have this:

<% $picture[title] %>

inserted where 'Page Title Goes Here'


Currently i get this error:
Parse error: syntax error, unexpected T_STRING in /home/guns/public_html/base/3rd-part/class.template/class.template.php(364) : eval()'d code on line 2

I appricated your responses!
Marvin

rangana
10-22-2008, 01:06 AM
You can't do that (as per time being). You can't combine PHP codes inside ASP codes or vice-versa.

Twey
10-22-2008, 01:32 AM
It is theoretically possible, if a bit complicated. The fact that you want to, though, says a few fairly worrying things about the design of your app.

jmh1988
10-22-2008, 02:11 AM
OK thanks guys...I'm trying to edit a script that im using in my photogallery...

is there away i can replace:

<?PHP
define ('TITLE', 'Page Title Goes Here');
?>

with something else in asp that does the same function?

Nile
10-22-2008, 02:43 AM
Why not use variables?


<%
Dim title
title = "Page Title Goes Here" 'Here goes the value of the title variable
Response.write("The value of title is " & title & " <br />"); 'Here you write it
%>

That should work.

Twey
10-22-2008, 12:52 PM
is there away i can replace:

<?PHP
define ('TITLE', 'Page Title Goes Here');
?>

with something else in asp that does the same function? Not in ASP, no. Like I said, one or the other of your scripts needs to be rewritten.

jmh1988
10-28-2008, 11:00 PM
So if this:

<%
Dim title
title = "Page Title Goes Here" 'Here goes the value of the title variable
Response.write("The value of title is " & title & " <br />"); 'Here you write it
%>

defines the variable how could i print that same variable in <title>HERE?</title>

I apologize for sounding so stupid....I really don't know much about this..just trying to edit code thats already there...

Thanks!

Twey
10-29-2008, 03:45 AM
<title><%=title%></title>

jmh1988
10-29-2008, 07:33 PM
I apologize, maybe i should be more clear about what I have here..

I have a file called header.inc in which the <title> tages are located.
I have index.php (which includes header.inc)

Finally I have a file called display.tpl which is where my asp code is....

From what I understand..
If I define the page title in display.tpl by using:

<%
Dim title
title = "Page Title Goes Here";
%>

then use <%=title%> in between my title tages in header.inc it should work????

Twey
10-30-2008, 03:02 AM
Not in the PHP file, no. You would need to define it as PHP.