PHP - Moved: Adding Background Color To A Include File?
This topic has been moved to HTML Help.
http://www.phpfreaks.com/forums/index.php?topic=352099.0 Similar TutorialsHi all I have a string in an include file for a javascript lightbox value. I need this value to increase by one every time it loops. Here's my code: $fetchproducts = mysql_query(" SELECT * FROM `products` "); while($returnedProduct = mysql_fetch_array($fetchproducts)) { include('product-cell.php'); } The string is called $lightboxcount in the product-cell.php file Can I fit a ++ into the code above? Many thanks for your help Pete This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=308660.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=317921.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=355225.0 SOLVED Hey Guys. I am trying to include a file. The file path gets returns from an objects method. When a run is_file() on the returned data it returns true, but does not include it!!! Can anyone please help me solve this!!
class StoreInitialization { public function loadConfigFile(){ $config_file="../store/demo/store_configuration.php"; return $config_file; }Client Code $store_config_file = $store_initialization->loadConfigFile(); require($store_config_file); I have a php file that generates a string that I need to use in a .js (javascript)file. Being that php developers sometimes using javascript with php, Im hoping someone can help me with this, cause i dont know any javascript. Code: [Select] //This is the varible inside the .js file var suggestionText = "I need to be able to include my string generated by the php file here..."; This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=346775.0 This topic has been moved to Editor Help (Dreamweaver, Zend, etc). http://www.phpfreaks.com/forums/index.php?topic=308819.0 Hello, Im trying to pass a variable to a newly created page using GET. Code: [Select] $query = mysql_query("SELECT DISTINCT subtype FROM business WHERE type ='Restaurant' ORDER BY name"); echo mysql_error(); while($ntx=mysql_fetch_row($query)) $nt[] = $ntx[0]; $i = -1; foreach($nt as $value) {$i++; echo "<a href='" . str_replace(' ','_',$nt[$i]) . ".php?title=$title'>" . $nt[$i] . "</a>" . "<br/>"; $FileName = str_replace(' ','_',$nt[$i]) . ".php"; $FileHandle = fopen($FileName, 'w') or die("cant open file"); $pageContents = file_get_contents("header.php"); fwrite($FileHandle,"$pageContents");} fclose($FileHandle); header.php Code: [Select] <head> <?php $title = $_GET['Title']; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <p>HEADER UPDATED!</p> <p>TESTING - the heading below should read (title goes here in capital letters)</p> <?php <h1>$title</h1> ?> //This is line 12 </body> </html> Im getting the error; Parse error: syntax error, unexpected '<' in D:\Hosting\3753557\html\1pw\mexican.php on line 12 I suspect that I have my syntax muddled in header.php? Is there a better way to pass variables to a newly created page? (fopen). Many thanks for any ideas. I want to include a php file after an succesfully login. Let's suposed that I have a login form on index.php. If the login was ok I want to include a php file with some content instead of the login form. Something like: Code: [Select] <? if($_POST['ok']){ require('content.php'); } else { //login form } ?> It's ok to include in the code the name of the file that you have on server ? From security point of view. Thanks Can I include a class file in the same page that I use an instance of the same class with my action attribute with my form. Here's the code Code: [Select] <?php include 'Resources/User.php';?> <html> <head> <title></title> <link href="stylesheets/styles.css" rel="stylesheet" type="text/css"/> </head> <body> <form action = "Resources/testClass.php" method="post" enctype="multipart/form-data"> <label>First Name: </label> <input type="text" name="fname" id="fname" size="25" maxlength="25"/> <label>Last Name: </label> <input type="text" name="lname" id="lname" size="25" maxlength="25"/> <label>Email: </label> <input type="text" name="email" id="email" size="25" maxlength="40"/> <label>Username: </label> <input type="text" name="username" id="username" size="25" maxlength="32"/> <label>Password: </label> <input type="password" name="password" id="password" size="25" maxlength="32"/> <label>Re-enter Password: </label> <input type="password" name="conf_pass" id="conf_pass" size="25" maxlength="32"/> <br /><br /> <input type="submit" name="submit" id="submit" value="Register"/> <input type="reset" name="reset" id="reset" value="Reset"/> </form> </body> </html> www.desmond-otoole.co.uk/secure/securefunctions.php /bank/admin/index.php what should I do in the index.php file to access securefunctions.php
require("../secure/SecureFunctions.php"); Nothing seems to work
I just get a stupid google chrome page saying This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=347705.0
I am using an inclue file on my layout.php page. How do I include a file that is located two directories above the file that I want to include the file into? My absolute hosting path is /home/content/52/8840652/html if this would be of any use. I'm not quite sure about the PHP include functions. Any help would be greatly appreciated, Thanks! Here is a section of php file A include_once(dirname(__FILE__) . '/PhpfileB.php') $VALID_RATING_IDS = $Ratethese Here is all of php file B $Ratethese = "array("1", "2",);" I need the var $VALID_RATING_IDS to = $Ratethese from file B I am trying to include an array from php file B in php file A. Is this possible? How can i accomplish this? Hi all, I'm at a dead-end here. I have a php file that I can query to return an array containing a bunch of data about a job listing. I include and query it by calling it like so within another file on my site. Quick Notes: The original file is in a different directory on my site than the page it's being included in. I have tried returning the array at the end of the script. I can print_r the array on the page I'm including the script on (so the URL path is correct). If I go to this URL directly and print_r on the array, I see the entire array as expected. Also, if I include the file on page 2 like I did above with print_r on the array in the original file, I see the array printed out on page 2. Code: [Select] include 'http://www.example.com/php/job-details.php?job=jobname&city=thecity'; However, if I do not print_r on the array in the original file and just include it on page 2, I cannot do anything with it and the array variable isn't found. Is this a case of variable scope? I'm so frustrated... Here is the code I have in my original file: Code: [Select] <? include('functions.php'); $jobtitlematch = $_GET["job"]; $jobcitymatch = $_GET["city"]; //echo $jobtitlematch; //echo $jobcitymatch; $url = 'http://somesite.com/something'; $xml = simplexml_load_file($url); foreach($xml->job as $job) { $jobtitle = makeURL((string)$job->title); $jobcity = makeURL((string)$job->region); if ($jobtitle == $jobtitlematch && $jobcity == $jobcitymatch) { $jobdata[] = array( Title => ((string)$job->title), URL_Title => makeURL((string)$job->title), Location => ((string)$job->region), URL_Location => makeURL((string)$job->region), Department => ((string)$job->department), URL_Department => makeURL((string)$job->department), Overview => ((string)$job->joboverview), Responsibilities => ((string)$job->responsibilities), Qualifications => ((string)$job->qualifications), Keywords => ((string)$job->metakeywords) ); } return $jobdata; //I have also tried return global $jobdata; } print_r($jobdata); ?> Thanks in advance for any help you can provide... My catalog uses a template file to list product details. One part of it is responsible for putting these details into nifty little tabs: <?php $template = '{magictabs style=black_rounded, tabwidth=110px}'; $template .= 'Technical Specifications'; $template .= '::'; $template .= '<table colspan="3"><tr><td>'; $template .= $details; $template .= '</td></tr></table>'; $template .= '||||'; ?> I don't want it to output $details, I want it to output a separate script instead. How do I include this separate file as a variable? I want this: <?php include('specs.php'); ?> to replace the $details variable. hi php freaks, Is there a way to parse an include file through the php engine and then place the contents into a variable? Code: [Select] $x = include ($myfile); |