kajoiner Posted June 7, 2004 Posted June 7, 2004 I want to alter a PHP file so that I can have it look like the rest of the site. I want to combine <html> <head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Boy Scouts Troop 98</title> <style> <!-- .page { background-color: #FFFFFF; color: #000000; } .tborder { background-color: #D1D1E1; color: #000000; border: 1px solid #0B198C; } td { font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; } .alt1 { background-color: #F5F5FF; color: #000000; } --> </style> </head> <body bgcolor="#728E40"> <div align="center"> <center> <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="#F3EEDF" bordercolor="#F3EEDF"> <tr> <td width="15%"> <img border="0" src="images/st_george.gif" width="190" height="144"></td> <td width="33%"> <p align="center"><font face="Algerian" size="6">Troop 98 - Dragon Slayers</font></p> <p align="center"><i><b>Do not meddle in the affairs of dragon slayers, <br> for you are crunchy and taste good with ketchup.</b></i></p> <p align="center"><b><i>Troop 98, Columbus GA</i></b></td> <td width="15%"> <img border="0" src="images/st_george.gif" width="190" height="144" align="right"></td> </tr> </table> <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F3EEDF" width="100%" bgcolor="#52662D" height="24"> <tr> <td width="100" align="center"> <p> <a href="index.htm" style="text-decoration: none; font-weight: 700"> <font color="#FFFFFF"> <a style="text-decoration: none; font-weight: 700" href="http://www.bsatroop98.org"> <font color="#FFFFFF">Home</font></a></font></a></p> </td> <td width="100" align="center"> <p><b> <a href="calendar/plans.cgi" style="text-decoration: none"> <font color="#FFFFFF">Calendar</font></a></b></p> </td> <td width="100" align="center"> <p> <a href="http://www.scoutboard.com/" style="text-decoration: none; font-weight: 700"> <font color="#FFFFFF">Forum</font></a></p> </td> <td width="100" align="center"> <p><b> <a href="games_and_links.htm" style="text-decoration: none"> <font color="#FFFFFF">Games </font> </a></b> </p> </td> <td width="100" align="center"> <p><b> <a href="library.htm" style="text-decoration: none"><font color="#FFFFFF">Links</font></a></b></p> </td> <td width="100" align="center"> <p><b> <a href="http://www.bsatroop98.org/guestbook" style="text-decoration: none"> <font color="#FFFFFF">Guest Book</font></a></b></p> </td> <td width="100" align="center"> <p> <a href="amember/index.php" style="text-decoration: none; font-weight: 700"> <font color="#FFFFFF">Members</font></a></p> </td> <td width="100" align="center"> <p> <a href="email_form.htm" style="text-decoration: none; font-weight: 700"> <font color="#FFFFFF">E-Mail</font></a></p> </td> </tr> </table> </center> </div> <div align="center"> <center> <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#F3EEDF" width="100%" bgcolor="#F3EEDF"> <tr> <td width="95%" valign="top" bordercolor="#FFFFFF"> </td> </tr> </table> </center> </div> <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" bgcolor="#F3EEDF" height="10" bordercolor="#F3EEDF"> <tr> <td width="100%" height="10"> <p align="center" style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="1">©2004 Troop 98 Columbus, GA</font></p> <p align="center" style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="1"><a href="http://www.bsatroop98.org">Home</a> </font> <FONT face="Verdana" style="font-size: 8pt">| <a href="email_form.htm">E-Mail</a> | <a href="disclaimer.htm">Disclaimer</a></FONT></td> </tr> </table> </body> </html> with the PHP file <? /* * Members page, used to login. If user have only * one active subscription, redirect them to url * elsewhere, redirect to member.php page * * * Author: Alex Scott * Email: alex@cgi-central.net * Web: http://www.cgi-central.net * Details: Member display page * FileName $RCSfile: login.php,v $ * Release: 1.8 ($Revision: 1.3 $) * * Please direct bug reports,suggestions or feedback to the cgi-central forums. * http://www.cgi-central.net/forum/ * * aMember is free for both commercial and non-commercial use providing that the * copyright headers remain intact and the links remain on the html pages. * Re-distribution of this script without prior consent is strictly prohibited. * */ include('./config.inc.php'); $t = & new_smarty(); $_product_id = array('ONLY_LOGIN'); include($config['plugins_dir']['protect'] . '/php_include/check.inc.php'); $payments = & $db->get_user_payments(intval($HTTP_SESSION_VARS['_amember_id']), 1); usort($payments, 'rcmp_begin_date'); $now = date('Y-m-d'); $urls = array(); foreach ($payments as $k=>$v){ if (($v['expire_date'] >= $now) && ($v['begin_date'] <= $now)) { $p = get_product($v['product_id']); $url = $p->config['url']; if (strlen($url)){ $urls[] = $url; } } } if (count($urls) == 1){ $redirect = sprintf("http://%s:%s@%s%s", $_amember_user['login'], $_amember_user['pass'], $HTTP_SERVER_VARS['HTTP_HOST'], $urls[0]); } else { $redirect = $config['root_url'] . "/member.php"; } #print_r($urls); html_redirect("$redirect", 0, 'Redirect', "You'll be redirected into the protected area"); ?> Any help? Quote
TCH-Don Posted June 7, 2004 Posted June 7, 2004 Have you tried including the php file, by inserting >include $_SERVER['DOCUMENT_ROOT']."/path/to/file.php"; ?> in the html code in the place where you want the log in script to be, and then save the html file as xxx.php Quote
kajoiner Posted June 8, 2004 Author Posted June 8, 2004 Can you check this and see what I am doing wrong. http://www.bsatroop98.org/amember/logint.php Quote
TCH-Bruce Posted June 8, 2004 Posted June 8, 2004 (edited) I'm not sure what it's supposed to do but your PHP code is in the middle of a table and not inside a . include $_server['Document Root']."/amember/login2.php"; ?> You have opened a row, opened a cell, printed a blank space, closed the cell, insert you php here and then the closing row. Unless your login2.php contains more tags I'm confused. Also, I don't know if $_SERVER and DOCUMENT ROOT should be uppercase. Edited June 8, 2004 by TCH-Bruce Quote
kajoiner Posted June 8, 2004 Author Posted June 8, 2004 <tr> <td width="95%" valign="top" bordercolor="#FFFFFF"> <php include $_SERVER['DOCUMENT ROOT']."/amember/login2.php"; ?> </td> </tr> I changed it to look like this, but no help. I am trying to get all of the pages on the website to look like the home page. What I am trying to do is make the login pages for the members section and some other pages look like the home page. I do not know much outside of FrontPage and do not know how to combine the HTML and PHP so that the PHP will show inside the middle table of the template sheet. Quote
TCH-Bruce Posted June 8, 2004 Posted June 8, 2004 Well color me dumb. You are creating the PHP like this: Quote
TCH-Don Posted June 8, 2004 Posted June 8, 2004 And yes <?php // end main content // add footer file include $_SERVER['DOCUMENT_ROOT']."/footer.php"; ?> works fine but, <?php // end main content // add footer file include $_server['document_root']."/footer.php"; ?> causes Warning: main(): Failed opening '/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') So it must be uppercase. Quote
kajoiner Posted June 8, 2004 Author Posted June 8, 2004 Warning: main(/amember/login2.php): failed to open stream: No such file or directory in /home/ndycnua/public_html/amember/logint.php on line 107 Warning: main(): Failed opening '/amember/login2.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ndycnua/public_html/amember/logint.php on line 107 Here is the error that I get know. Any suggestions? Quote
kajoiner Posted June 8, 2004 Author Posted June 8, 2004 <tr> <td width="95%" valign="top" bordercolor="#FFFFFF"> <?php include $_SERVER['DOCUMENT ROOT']."/amember/login2.php"; ?> </td> </tr> Here is what I have now, with upercase. Quote
kajoiner Posted June 8, 2004 Author Posted June 8, 2004 <tr> <td width="95%" valign="top" bordercolor="#FFFFFF"> <?php include $_SERVER['DOCUMENT ROOT']."login2.php"; ?> </td> </tr> Ok, that shows what I am looking for, but now I have this error at the top of the page. Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/ndycnua/public_html/amember/logint.php:8) in /home/ndycnua/public_html/amember/plugins/protect/php_include/check.inc.php on line 124 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ndycnua/public_html/amember/logint.php:8) in /home/ndycnua/public_html/amember/plugins/protect/php_include/check.inc.php on line 124 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.