Results 1 to 10 of 10

Thread: ASP within PHP ???

  1. #1
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default ASP within PHP ???

    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

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You can't do that (as per time being). You can't combine PHP codes inside ASP codes or vice-versa.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. The Following User Says Thank You to rangana For This Useful Post:

    jmh1988 (10-22-2008)

  4. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. The Following User Says Thank You to Twey For This Useful Post:

    jmh1988 (10-22-2008)

  6. #4
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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?

  7. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Why not use variables?
    Code:
    <%
    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.
    Last edited by Nile; 10-22-2008 at 02:51 AM.
    Jeremy | jfein.net

  8. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #7
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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!

  10. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <title><%=title%></title>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  11. #9
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    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????

  12. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Not in the PHP file, no. You would need to define it as PHP.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •