Jump to content

Search the Community

Showing results for tags 'include'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 13 results

  1. Hello, I have the following code (which opens a database connection and then links to a table.) include("config.inc.php"); at the beginning of a script, but the file (which exists in the same directory as the script) is not being called. I have verified that the file is there and that the spelling is correct (there is no complaint for PHP not being able to read the file) Since it is not being read, the mysql search is not working. If I copy the lines from the config.inc.php file to this file, everything works. I have tried using the full directory structure to no avail. Any ideas? Thanks Steve
  2. I have the following three links in same page. http://localhost/folder/file.php?x=link1 http://localhost/folder/file.php?x=link2 http://localhost/folder/file.php?x=link3 i want to show URLs as they are... link1 is to include a file named "x.php" link2 is to include a file named "y.php" link3 is to include a file named "z.php" Can it be done in php only? PS: its not about creating hash ids. and i want to do it without any sql db connection.
  3. Hi, I have a cron job that executes this script every 2 minutes: <?php // LOAD WP-LOAD.PHP require('/opt/bitnami/apps/wordpress/htdocs/wp-load.php'); // INCLUDE AND EXECUTE SCHEDULER.PHP include('/opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/scheduler.php'); ?> When I try to include; /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/scheduler.php: <?php // EXPLODE AND PARSE WP-CONTENT; FUNCTIONS.PHP $parse_uri = explode( '/opt/bitnami/apps/wordpress/htdocs/wp-content', $_SERVER['SCRIPT_FILENAME'] ); // LOAD WP-LOAD.PHP require_once( $parse_uri[0] . '/opt/bitnami/apps/wordpress/htdocs/wp-load.php' ); // LOAD TEMPLATE FUNCTION CheckFunction(); ?> I get the output: ): failed to open stream: No such file or directory in /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/cron.php on line 5 PHP Warning: include(): Failed opening '<?php //PLEASE do NOT move me around. I get cranky when I get moved around //get the wp-load in for the wordpress functions $parse_uri = explode( '/opt/bitnami/apps/wordpress/htdocs/wp-content', $_SERVER['SCRIPT_FILENAME'] ); require_once( $parse_uri[0] . '/opt/bitnami/apps/wordpress/htdocs/wp-load.php' ); //now try calling template function CheckFunction(); ?>' for inclusion (include_path='.:/opt/bitnami/php/lib/php:/opt/bitnami/frameworks/smarty/libs') in /opt/bitnami/apps/wordpress/htdocs/wp-content/themes/yeelloe/cron.php Any ideas on how to execute this file. Any help would be appreciated.
  4. Hello All, I have been going crazy trying to figure this out, I hope someone can help me out I have header and footer.php files that on all my pages I get them to load with include, but for some strange reason, this certain page it will not load I did some research and apparently theres problems with div and php, does anyone know how to make this work? Thank you in advance, Elaine test.txt
  5. I need some help with this. I created an index.php page and I inserted an include statement that referred to a header.html page. It works when working it in MS Webmatrix but when I put it on my server I only get my index.php page. My include statement will not get the header.html page. What am I doing wrong? I also tried changing all of my files to .php extensions also and still the same. Here is my index.php file: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Braswell Electric</title> <link rel="stylesheet" href="braswellelectric.css"> </head> <body> <div> <?php include('/includes/header.html');?> <?php include('/includes/aside.html');?> <article class="About"> <header class="AboutHeader"> <h2>About Us</h2> </header> <p><b>Braswell Electric</b> is a family business owned and operated by Jim and Joyce Braswell located in Sylacauga, Alabama. Braswell Electris has been in business in Sylacauga for 25 years and covers the greater Talladega County area. We do new homes, remodels, or any small electrical issues you may have. We are licensed and insured and we are here for your residential needs.</p> <img src="pics/Coach Light.jpg" alt="Coach Light" > <img src="pics/Outside Plug.jpg" alt="Outside Plug"> <img src="pics/Service.jpg" alt="Service"> </article> </div> </body> </html> Here is my header.html file <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <header class="Header"> <h1 style="display: none">Braswell Electric</h1> <img src="pics/lightning1.jpg" alt="Header Pic"> </header> </body> </html>
  6. There is a function (that cannot be changed) which has an include: <?php function a() { include 'file.php'; echo 'work'; } ?> ==file.php== <?php echo 'play'; ## Need to leave a() now! ?> The included file can be changed. I would like a way for file.php to cause PHP to return out of the function a(). A return; statement in file.php has PHP pick up execution with the statement following include. What is there in PHP that will allow returning out of a() at some point in file.php?
  7. I'm having trouble including my navigation bar in my web pages using PHP. This is the script i have included in my web page, but it's not working. <?php include("navbar.php"); navBar(); ?> This is the script in navbar.php enclosing my navigation bar. <? function navBar() { ?> NAVIGATION BAR <? } ?> Help is appreciated.
  8. ok i have an index.php as so: <?php require 'php/stdlib.php'; $site->page->render(); foreach($page as $var => $value) { echo $var ." is ". $value." <br/>"; } ?> the obj creation for site and page is in the stdlib file and is obviously working cuz the -for each- loop prints out: name is welcome headers is inc/index_h.php footers is inc/index_f.php contents is inc/welcome.php It show that the object is created. I also did a var dump with proper results here is site---page---render: public function render_page(){ $this->page->render(); } here is page---render: public function render(){ include $this->headers; include $this->contents; include $this->footers; } however the result of the script is the following: Undefined variable: and also Trying to get property of non-object: both errors point to my $page object that i used in the include file for the page header: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title><?php echo $page->name; ?></title> <script src="/scripts/jquery.js"></script> </head> <body> The errors actually print out in the html title tag not on the screen meaning i have to use View Source on my browser to see it How do i get the $page object to be visible when using an include Im usually pretty good about finding answers myself but this thing has me stumped for two days now.(I have learned alot about many other things while searching for answer tho so I guess not all is lost) If anyone could help me I would greatly appreciate it. Probably should have added that the page and site object are instantiated in stdlib.php with the following $site = new csite(); site_ini($site); $page = new cpage("welcome"); $site->setPage($page);
  9. Hello there, I am trying to recreate a HTML website on a WordPress website. On the current website we pull a php file from the directory that lists brands for different catrogies. http://www.nongmoshoppingguide.com/brands/feed-and-seed.html We use the following script <!--?php <br ?--> <?php include('../lib/IphoneDataRenderer.php');?> <?php echo $IphoneDataRenderer->getAdsForBrandId();?> <!--?php } ?--> <?php $IphoneDataRenderer listBrandsForCategory(); ?> and it works fine for the website above. However, when I add this code within our WP website we don't get any information (I did add the /lib/iphoneDataRenderer.php files and folders). Could you help me understand what I am doing wrong? Many thanks!
  10. Hi - we're trying to attach a .pdf to an email and mail it to a client - not working -- here's the code - l'll highlight what I think I understand... =) I've inherited this php project and I'm in no way a PHP person though I can usually do minor fixes -- this is beyond me however. The owner of the site said that up until a year ago, this code was working. ps - I've tried incorporating swiftmailer and phpmailer but don't know how to configure those using this password verifying code and an "include" that's not a .pdf question - is this code fixable and if so, how? <?php orange = goes to database, verifies passwords, that the report was paid for, etc - oks access and sets the "to" email address as $i_email $i_get_sid = isset($_GET["sid"]) ? (int)$_GET["sid"] : $i_sid; $i_get_pass = isset($_GET["a"]) ? $_GET["a"] : $_SESSION['r_pass']; $i_get_pass = addslashes($i_get_pass); $i_qry1 = db_qry("SELECT * FROM reports WHERE sid={$i_get_sid} AND ispurchased=1 AND isenabled=1 AND passhash='$i_get_pass'") or die("Error: report-4, SQL request error #1 ".mysql_error()); if($i_qry1) { if($i_rec1=mysql_fetch_array($i_qry1)) { $i_fname = $i_rec1["fname"]; $i_lname = $i_rec1["lname"]; $i_email = $i_rec1["email"]; } db_free_result($i_qry1); } blue - imports the file where the pdf is generated using FPDF, gives it the variable $data and attaches(or embeds? - not sure) to the email if(!empty($i_email)) { ob_start(); include('inc/pages/report-3.inc.php'); $data = ob_get_contents(); ob_end_clean(); $data = wordwrap(base64_encode($data), 72, "\n", true); $i_boundary = '----------'.bin2hex(mhash(MHASH_MD5, time())); $i_headers = "From: oursite.com <[email protected]> green - sets the content of the email message X-Mailer: oursite.com PHP Mail (v1.0) Reply-To: oursite.com <[email protected]> X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=\"$i_boundary\""; $i_message = "--$i_boundary Content-Type: text/plain; charset=\"iso-8859-1\" Content-Transfer-Encoding: 7bit Dear ".$i_fname." ".$i_lname.", Here is the report you asked for, attached as an Adobe Acrobat document. If you do not already have one, an Adobe Acrobat reader can be downloaded for free at http://www.adobe.com/. ---- Best regards, Sports Team mailto:[email protected] --$i_boundary Content-Type: APPLICATION/PDF; name=\"report.pdf\" Content-transfer-encoding: base64 Content-Disposition: attachment; filename=\"report.pdf\" $data {$i_boundary}-- "; shows a new message in the browser to the user saying the emails been sent @mail($i_email, ' Sports - Your Report', $i_message, $i_headers); @mail('[email protected]', 'Sports - Your Report', "ID - $i_get_sid", $i_headers); } header('Content-type: text/html'); $m_header = '<link href="shared/report.css" rel=stylesheet type="text/css">'; require_once($DOCUMENT_ROOT."inc/top-2.inc.php"); $i_get_sid = isset($_GET["sid"]) ? (int)$_GET["sid"] : $i_sid; $i_get_pass = isset($_GET["a"]) ? $_GET["a"] : $_SESSION['r_pass']; $i_get_pass = addslashes($i_get_pass); echo '<table cellpadding=0 cellspacing=0 border=0 width="100%">'; echo '<tr vAlign=top><td height=7><img src="images/1x1.gif" width=1 height=7></td></tr>'; echo '<tr height=28 style="background: url(images/bookm-bg.gif) repeat-x"><td width="100%"><nobr>'; echo '<img src="images/1x1.gif" width=5 height=1><a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'"><img src="images/bookm-42.gif" width=67 height=28 border=0></a><a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=pdf"><img src="images/bookm-s3.gif" width=10 height=28 border=0><img src="images/bookm-52.gif" width=65 height=28 border=0></a> <a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=/report.pdf"><img src="images/button-downloadpdf.gif" width=80 height=28 border=0></a> <a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=email"><img src="images/button-emailpdf.gif" width=80 height=28 border=0></a>'; echo '</nobr></td><td><nobr><font style="font-size: 10px;"><a href="javascript:window.close();">Close Window</a> </font></nobr></td></tr></table>'; echo "<p> Thank you."; echo "<p> Your report has been successfully sent."; require_once($DOCUMENT_ROOT."inc/btm-2.inc.php"); // header("location: report.php?sid=$i_get_sid&a=".urlencode($i_get_pass)); ?> >>>>>The output is this instead of an email with attachment: ------------fd755da9fdf74bb9c832b8a95272fd4b Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Dear "client", Here is the report you asked for, attached as an Adobe Acrobat document. If you do not already have one, an Adobe Acrobat reader can be downloaded for free at http://www.adobe.com/. ---- Best regards, Sports Team mailto:[email protected] ------------fd755da9fdf74bb9c832b8a95272fd4b Content-Type: APPLICATION/PDF; name="report.pdf" Content-transfer-encoding: base64 Content-Disposition: attachment; filename="report.pdf" JVBERi0xLjMKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL1Jlc291cmNl cyAyIDAgUgovQ29udGVudHMgNCAwIFI+PgplbmRvYmoKNCAwIG9iago8PC9GaWx0ZXIgL0Zs YXRlRGVjb2RlIC9MZW5ndGggMzE1Pj4Kc3RyZWFtCnicdVLLTsMwELznK+YIUnHtXTuxb0BL JbghIu6hpKgoaUqSgvr3rBNCAQlbstfemdnxg3CXaOUyfCTXOeYrA2OU1sg3uMmTN1jn4jL2 .....(goes on forever)
  11. I know what my problem is, but I'm not sure how to go about it. I am trying to include a php file with many includes (js, css, php) in another php file in a higher directory. I am using apache and run off localhost (this is an internal website). I have my main index /htdocs/index.php and the file I want to include. /htdocs/tables/php/projects.php When I include /php/projects.php in my index.php, as expected, all my links are broken to my js and css files, and even further nested php files (within js files). I believe I am supposed to DEFINE some kind of ROOT or DIR or something, but I am not having success Googling these things. Here is my code to look at: Index.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>BLST</title> </head> <body> <?php $projectsPage = "/tables/php/projects.php"?> <li><a href="index.php?page=<?php echo $projectsPage;?>">Projects</a></li> <?php if(is_null($_GET["page"])) { $page = ""; }else{ $page = $_GET["page"]; } include($page); ?> </body> </html> projects.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Projects</title> <style type="text/css"> @import "css/test.css"; @import "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.23/themes/smoothness/jquery-ui.css"; </style> <script type="text/javascript" language="javascript" charset="utf-8" src="js/jquery.min.js"></script> </head> The error being that any css, js or php file in projects.php is not found, as the browser reports it is looking for these files from the main root. I want to be able to alter this without trying to add something to projects.php.
  12. Hi I want to include a php file (basically my personal header) above the phpbb forum header. The file where I am inserting the code is "page_header.php" which is located in the includes folder. (file attached in this post). If I insert the following code: $root = realpath($_SERVER["DOCUMENT_ROOT"]); include "$root/top.php"; I get what I want but the font color of all the topics posted in the forum change from black to white (making it unreadable). How can I rectify this conflict and how is it happening? Thanks (I am new to php) page_header.php
  13. <html> <head> <!--title>Hello</title--> <link rel="stylesheet" href="uvcs.css" type="text/css" /> </head> <body> <div id=everything> <div id=header> This is the header </div> <div id=clear></div> <div id=navmenu> <div id=navmenu> <ul> <li> <a href="index.php?cmd=home">HOME</a> </li> <li> <!--submenu--> <a>VIEW</a> <ul> <li> <a href="index.php?cmd=student">STUDENT PROFILE</a> </li> <li> <a href="index.php?cmd=employee">EMPLOYEE</a> <!--subsubmenu--> <!--ul> <li> <a href=#>subsubmenu1</a> <a href=#>subsubmenu2</a> </li> </ul--> </li> </ul> </li> <li> <a href="index.php?cmd=courses">COURSES</a> </li> <li> <a href="index.php?cmd=aboutus">ABOUT UVCS</a> </li> <li> <a href="index.php?cmd=itsupport">IT SUPPORT</a> </li> <li> <a href="index.php?cmd=login">LOGIN</a> </li> </ul> </div> </div> <div id=clear></div> <div id=maincontent> <?php include("selector.php"); ?> </div> <div id=sidebar> side bar </div> <div id=clear></div> <div id=footer> Footer </div> </div> </body> </html> <?php $cmd =$_GET['cmd']; switch($cmd) { case 'home': include_once "home.php"; break; case 'student': include_once "student.php"; break; case 'employee': include_once "employee.php"; break; case 'courses': include_once "courses.php"; break; case 'aboutus': include_once "aboutus.php"; break; case 'itsupport': include_once "itsupport.php"; break; case 'login': include_once "login.php"; break; default: include_once "home.php"; break; } ?> These are my codes that supposedly would show home.php (which contains only the text "you are viewing home.php"), when you open the index.php. But for some reason I would get the line Notice: Undefined index: cmd in C:\xampp\htdocs\UVCSPortal\selector.php on line 2 you are viewing home.php I thought with these codes with would go directly to default case. But instead it reads the <?php include("selector.php"); ?> in index.php twice, I think. I tried using isset, but couldn't understand it.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.