Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    343
    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 ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cass

    cass Well-Known Member

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

    Regards
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    343
    [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 ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. qualitum

    qualitum Member

    Joined:
    Feb 17, 2002
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    301
    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:
    301
    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:
    343
    [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 !
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice