The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to insert some php code ?

Discussion in 'User Experience' started by Radio_Head, Oct 17, 2002.

  1. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    Hello I need to insert some line of php code to show the date on my Cpanel skin html pages ....

    I tried in several way inserting this code on my html pages ..

    &cpanel include=&date.php&&

    or

    &!--#include virtual=&date.php& --&

    I tried to insert following php code in the html page

    &?php
    echo date(&F j, Y, g:i a&);
    ?&

    but it doesn't work too :( .

    What I have to do to execute some php code inside my Cpanel skin html pages ?
     
  2. cass

    cass Well-Known Member

    Joined:
    Jul 17, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Argentina/USA/Mexico
    Do you rename the file to .php ?
    if not... do it, or php code will not work ;)

    Regards
     
  3. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    [quote:12bcca96e6][i:12bcca96e6]Originally posted by cass[/i:12bcca96e6]

    Do you rename the file to .php ?
    if not... do it, or php code will not work ;)

    Regards[/quote:12bcca96e6]

    Yes absolutely , and I chmoded it 755 . I have problem also using cpanel tags inside php files . Do you have these problems ?
     
  4. qualitum

    qualitum Member

    Joined:
    Feb 17, 2002
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    There is a bug in the way CPanel sets up PHP. The PHP include path does not contain &.:&, so it is impossible to do:

    include ('file.php');

    You must use the absolute path to the included file :(

    I have submitted this as a bug in Bugzilla. Bug# 927.
     
  5. qualitum

    qualitum Member

    Joined:
    Feb 17, 2002
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Ooops, a bit off topic :)
    Browsed the original post too quickly, while thinking of your PM, Radio_Head :)
    Anyway, this is still useful info ;)
     
  6. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    [quote:86251cb6b5][i:86251cb6b5]Originally posted by qualitum[/i:86251cb6b5]

    Ooops, a bit off topic :)
    Browsed the original post too quickly, while thinking of your PM, Radio_Head :)
    Anyway, this is still useful info ;) [/quote:86251cb6b5]

    Hello

    thank you , I was going mad .

    I tried

    header
    include
    fopen

    i receive always error :(

    For now I solved my problem using this

    echo &&meta http-equiv=\&REFRESH\& content=1;URL=http://www.$domain:2082/frontend/test/contact/saveemail.html?email=$email&&;

    (after passing domain hidden value on web form using the domain cpanel tag) .

    However I don't like a lot this solution because with javascript disabled it doesn't work . However thank you to have find the bug .

    Thanks !
     
Loading...
Similar Threads - insert php code
  1. NicBoy
    Replies:
    2
    Views:
    643
  2. Krydos
    Replies:
    4
    Views:
    174

Share This Page