PHP - Include Home Page Text
I am trying to force home landing page text onto this wordpress themes (weblizar Enigma) standard page (which doesnt seem to allow for this even with settings/reading/static/home page option selected wordpress settings)
The landing page just seems to be wigitised.
In a nutshell, I want to have a "page" of text on home page below banner slider and instead of "BLOG" and blog text. Hope this makes sense.
Not getting help from theme author and I have been pointed towards .phpfreaks
This is the website below....
http://www.cloudchasing.co.uk
Thankyou in advance guys
Similar TutorialsHi, I have a lovely wordpress theme on my website. Unfortunately I can not get text or the home page itself into the landing page, is there any way to do this at all? I want to the home page text to sit under the
I have contacted the theme author with no help. I want the text to sit underneath the four image buttons (below banner slider)
This is the website http://www.cloudchasing.co.uk/
Hope this makes sense, many thanks for help in advance.
Karl
Hi. I have problem and I would like to know if anyone here has any ideas on how to fix it. My home page is where my log in form resides. If I leave the home page to browse other pages of my site I want to stay logged in. However, when I return to the home page I see the log in form. The log in form should not be there if I already logged in. Instead I should see the welcome message. Which does appear after loggin in but does not stay on the home page when I leave the page and come back. Code: [Select] <?php //Starts the PHP Sesssion session_start(); //Includes the MYSLQ Connection Info from another PHP Page include ('spartacus_mysql.php'); //Submits Log In Info to Database and encrypts Password if (isset ($_POST['loginsubmit'])) { $username = mysql_escape_string($_POST['username']); $userpassword = mysql_escape_string(md5($_POST['userpassword'])); if (!empty ($username) && !empty ($userpassword)) { //Runs Query to Selects the Username and Password from the Database $sql = mysql_query ("SELECT * FROM users WHERE username='".$username."' AND userpassword='".$userpassword."' LIMIT 1"); //Finds and Matches the Log In Info from the Database to the one submitted if(mysql_num_rows ($sql) > 0) { $_SESSION['loggedin'] = true; $_SESSION['username'] = $username; //Runs This Message if the right Username/Password is entered echo '<div id="welcome_member"> Welcome, '.$_SESSION['username'].'.<br /> You are now logged in!<br/> The Combat Tips and Downloads is now accessible!<br /> Enjoy!<br /> </div>'; } else { //Runs This Error if the Username/Password do not match the Database echo '<div id="welcome_member"> Your username and/or password is incorrect! <a href="spartacus_home.php">Try Again</a> </div>'; } } else { //Runs This Code if the Log In Form is Left Blank echo '<div id="welcome_member"> You must enter a username and a password! <a href="spartacus_home.php">Try Again</a> or <a href="spartacus_joinsite.php">Register</a> </div>'; } } else { //This is the code for the Log in Form echo'<div id="join"> <a href="spartacus_joinsite.php">{ JOIN! }</a><br /> </div> <div class="signin"> <div id="titles"> { SIGN IN } </div><br /> <form method="post" action="spartacus_home.php"> <table> <tr><td> Username: <input type="text" name="username" /> </td></tr> <tr><td> Password: <input type="password" name="userpassword"/> </td></tr> <tr><td> <input class="submit" name="loginsubmit" type="submit" /> </tr></td> </table> </form> </div>'; } ?> <!--end sign in PHP--> Here is my code This may sound funny, but I'm not sure what I was trying to get this code to do... Code: [Select] <!-- Find Current Page Name --> <?php $page = basename($_SERVER['REQUEST_URI']); echo '<p>$page = ' . $page . '</p>'; // if ($page == '') { if (($page == '/')||($page == '')||($page == 'index.php')){ $page = "index.php"; echo '<p>You are on the Home Page.</p>'; }else{ echo '<p>You are on Some Other Page.</p>'; } What I mean by that is I'm not understanding why I chose... Code: [Select] if ($page == '') { and then... Code: [Select] if (($page == '/')||($page == '')){ and then... Code: [Select] if (($page == '/')||($page == '')||($page == 'index.php')){ Why would I get those different results from basename($_SERVER['REQUEST_URI'])?? And what should I expect locally on my Laptop with a Virtual Host set up (e.g. "http://local.debbie/index.php") versus using a Test Site (e.g. "http://www.doubledee.byethost2.com/") versus a real site (e.g. "www.debbie.com")?! Hope I'm making some sense here... Debbie I have an issue I am not sure how to solve. What I want to do is to make sure authentication has already occurred . Or that my $currentMember is set and it if is set for an IF statement to do nothing.. However it it is not set for a redirect to the home page with no echo statements or anything to that nature just a redirect. Am I even close? Code: [Select] <?php include( ABSOLUTE_PATH . 'class/database.class.php' ); include( ABSOLUTE_PATH . 'class/person.class.php' ); //Start Session session_start(); $currentMember = unserialize($_SESSION['currentMember']); $db = new Database; $person = new Person($currentMember->memberid); if ( $auth_satus == 0 ) { header('Location:' . APP_ROOT . 'index.php'); } exit(); ?> I'm assuming this has something to do with cookies, which I am not to familiar with as I am pretty new to this PHP world and have mostly worked with wordpress... but this question was brought up to me, and I don't know where to start. If a user is signed up for the mailing list on a site, we would like the home page the user lands on to be different than the page a new visitor who isn't signed up for the mailing list would see. I have tried to google this, but maybe I am using the wrong choices of words? Any advice, links, etc would be so so soooo appreciated. Thanks V Hi! I have a text area on my webpage which takes in user php scripts and produces an output in an adjacent window. I am trying to find out how I can auto include some php tags into the input text area so that the user doesn't have to keep typing them in every time. Code: [Select] <form name="form1" method="post" ACTION="editor.php"> <textarea rows="10" cols="60" id="code" name="code"></textarea> <span class="submitbutton">Test code</span> </form> Thanks in advance, Jay Hi all not been playing with php over the past year and still a noob lol i did have some code to include files based on the URL link E.G: Code: [Select] http://www.yoursite.com/index.php?page=about then i had some form of string that would access the URL so it would have checked if the url was just index.php or had ?page=somepage after it I can not seem to find any referance on the www or shift the headach i have got trying to remember the code so thought some of you wondaful people would no what i am on about and point me in the rught direction of a tutorial for the information or have the code tohand so i can referance from it thanx all I want to include a variable (for example an object $user) in each PHP page. Previously I declared $var in an include file then included that file in every page, however it generates an error in Zend Studio and it's also not very good programming style. I want to know how I can do it any other way. I was thinking of using constants but I don't know if constants should be used for this purpose and also I do not think constants can be defined as objects. Thank you very much for your help. Is there some way of a php include which is visible on every page (footer), itself having two php includes, but only one of which would be visible, then on the user refreshing the page or on visiting another page on the site, that include would be replaced with another php include? Preferably done without any js. Any help appreciated. Chris Hi all, I am a bit of a noob when it comes to website building and php etc so please have patients with me I am learnig as I go. I have come across this problem before and cannot remember what I did to fix it but any way it is presenting its self to me again. I have this page: http://minecraftcons...a.com/index.php with an include file loading random images, however the same code on these pages: http://minecraftconsolecrafting.comxa.com/sections/build-navi.php http://minecraftconsolecrafting.comxa.com/sections/springhill-kingdom-01.php are not working. I have other websites that this method of coding is working fine on for example here is another of my websites: http://divinegardensandlandscapes.com/index.php here the include code for random image loader is working fine on all pages it appears on so what is happening when this fail takes place? Any help and or advice would be hugely appreciated, Thanks in advance. Please remeber I am a noob when answering. Thanks Edited by eGate-Network, 12 July 2014 - 10:55 PM. Hi, Please bear with me, I have no real experience with PHP but am using it for the first time in a page for maintenance purposes. One of the things I am trying to do is include a random page from within a certain folder (folder: 'modules/did-you-know'). Inside this folder there are currently three files named in this format 'did-you-know-###.php' - where ### is the page number. I have no problems including the named page individually, but it is when randomising it where it causes errors. The code I am using is the following: Code: [Select] <?php $i=0; $myDirectory = dir("modules/did-you-know"); while($file=$myDirectory->read()) { $array[$i]=$file; $i++; } $myDirectory->close(); $num = count($array); $random = rand(0, $num); include "$array[$random]"; ?> When I load the page, I get numerous errors, as follows: Warning: include(..) [function.include]: failed to open stream: Operation not permitted in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include(..) [function.include]: failed to open stream: Operation not permitted in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include() [function.include]: Failed opening '..' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include(did-you-know-002.php) [function.include]: failed to open stream: No such file or directory in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include(did-you-know-002.php) [function.include]: failed to open stream: No such file or directory in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include() [function.include]: Failed opening 'did-you-know-002.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/{USERNAME}/public_html/test2/index.php on line 103 Now, it's clear from the above that it is (at least sometimes) reading the files from within the 'did-you-know' directory, so not sure why I am getting these errors. (Especially the last one, as that would suggest an error to do with permissions, would it not?) Line 103 is the "include" line. Any help would be appreciated. Thanks I have 2 websites, a companies main website written in PHP and a web application they have purchased written in aspx (main site) www.example.com (web app) www.webapp.com/login.aspx?CompanyName=example The client wants people to be able to login from their main website which then redirect to the webapp (which will be styled like their branding) without the customer realising they have left the main site. I thought i may be able to achieve this with a simple include from a page within the main site such as; Code: [Select] <?php // www.example.com/software include"http://www.webapp.com/login.aspx?CompanyName=example"; ?> This pulls in the login page fine, however when you try to login it does not redirect, it gives a 404 error as it trys to open this URL http://www.example.com/software/login.aspx?CompanyName=example Is there a way of pulling in the necessary html from the aspx site to provide a login box in my clients main site but then have it redirect to the correct aspx page (on the aspx site)? I have thought about using an iframe, but that wont redirect to the webapp upon login, but just keep everything withing the iframe thanks for any advice... 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
Attached Files
test.txt 4.81KB
7 downloads Hi all, I have a strange issue going on. It may be server related, but I don't know what to look for. I have a .php page with a few Virtual Includes: Code: [Select] <?php virtual ("nav.shtml"); ?> ...throughout it. I have also a parser that is displaying XML data in a table form. The parser works with the standard: Code: [Select] <?php include ('parser.php'); ?> ...however, if I have the Virtual above the include, the parser doesn't work. Or at least it will not "find the file" however, the file is there and it works ABOVE the virtual, displaying it fine... For example, this works: Code: [Select] <?php include ('parser.php'); ?> <?php virtual ('file.shtml'); ?> This doesn't: Code: [Select] <?php virtual ('file.shtml'); ?> <?php include ('parser.php'); ?> Any thoughts? Hello everyone. I'm having a problem with what should be a fairly simple login system that is included on the index page of my site. Basically, it is set up to display a short form so that the user can enter his/her email address and password to log in. If there is a mistake with the email/password, it displays the same form with a notification that there was an incorrect email or password. The problem that I'm having is that when the wrong email/password is entered, the page goes to the next step of notifying the user of the incorrect information but it does not display the rest of the page that it is included on. What is happening is when the user arrives at the site it displays the index.php page, which is currently a blank page with some simple text, and the included page mentioned above. When an incorrect email/password is entered, instead of staying on the index page and displaying the included page with the login form, the user is redirected away from the index page to the included page only. Here's my code for "head.inc.php": Code: [Select] <?php include("conf.inc.php"); // Includes the db and form info. session_start(); // Starts the session. if ($_SESSION['logged'] == 1) { // User is already logged in. $_SESSION['email'] = $email; header("Location: main.php"); // Goes to main page. exit(); // Stops the rest of the script. } else { if (!isset($_POST['submit'])) { // If the form HAS NOT been submitted. echo "<form name=\"form\" action=\"head1.inc.php\" method=\"POST\" style=\"margin-bottom:0;\">"; echo "<a href=\"signup.php\" class=\"bluelink\">Sign Me Up!</a> "; echo "<a href=\"pwordhelp.php\" class=\"bluelink\" onClick=\"return popup(this, 'notes')\">Forgot Password</a> <br>"; echo "<input type=\"text\" name=\"email\" size=\"17\" value=\"Email...\" style=\"color: #999999\" onfocus=\"if (this.value == 'Email...') {this.value=''; this.style.color='#000000'}\"> "; echo "<input type=\"text\" name=\"pword\" size=\"17\" value=\"Password...\" style=\"color: #999999\" onfocus=\"if (this.value == 'Password...') {this.value=''; this.style.color='#000000'; this.type='password'}\"> "; echo "<input type=\"submit\" name=\"submit\" value=\"Submit\"> "; echo "</form>"; } else { // If the form HAS been submitted $email = form($_POST['email']); $pword = md5($_POST['pword']); // Lightly encrypts the password. $q = mysql_query("SELECT * FROM `signin` WHERE email = '$email' AND pword = '$pword'") or die (mysql_error()); // mySQL query $r = mysql_num_rows($q); // Checks to see if anything is in the db. if (!$r) { // There is something in the db. The username/password match up. echo "<form name=\"form\" action=\"head1.inc.php\" method=\"POST\" style=\"margin-bottom:0;\">"; echo "<a href=\"signup.php\" class=\"bluelink\">Sign Me Up!</a> "; echo "<a href=\"pwordhelp.php\" class=\"bluelink\" onClick=\"return popup(this, 'notes')\">Forgot Password</a> <br>"; echo "<font color=\"#FF0000\"><strong>Incorrect Email or Password.</strong></font> "; echo "<input type=\"text\" name=\"email\" size=\"17\" value=\"Email...\" style=\"color: #999999\" onfocus=\"if (this.value == 'Email...') {this.value=''; this.style.color='#000000'}\"> "; echo "<input type=\"text\" name=\"pword\" size=\"17\" value=\"Password...\" style=\"color: #999999\" onfocus=\"if (this.value == 'Password...') {this.value=''; this.style.color='#000000'; this.type='password'}\"> "; echo "<input type=\"submit\" name=\"submit\" value=\"Submit\"> "; echo "</form>"; } else { // If the username/password is invalid $_SESSION['logged'] = 1; // Sets the session. $_SESSION['email'] = $email; header("Location: main.php"); // Goes to main page. exit(); // Stops the rest of the script. } } } ?> Here's the code for "index.php": Code: [Select] <?php include("head.inc.php"); echo "This is the index page"; ?> Any ideas on how to stop the redirection from the index page when the incorrect info is entered? Hi people, I really hope you guys can help me out today. I'm just a newbe at php and i'm having real trouble. Bassically all I want to do is have a user type in a company name in a html form. If what the user types in the form matches the company name in my php script i want the user to be sent to another page on my site. If what the user types in the form doesnt match the company name in my php script i want the user to be sent to a differnt page like an error page for example. this is my html form: Code: [Select] <form id="form1" name="form1" method="post" action="form_test.php"> <p>company name: <input type="text" name="company_name" id="company_name" /> </p> <p> <input type="submit" name="button" id="button" value="Submit" /> </p> </form> And this is the php code I'm trying to process the information on: Code: [Select] <?php $comp_name = abc; if(isset ($_POST["company_name"])){ if($_POST["company_name"] == $comp_name){ header("Location: http://www.hotmail.com"); exit(); } else{ header("Location: http://www.yahoo.com"); exit(); } } ?> The thing is i'm getting this error when i test it: Warning: Cannot modify header information - headers already sent by (output started at D:\Sites\killerphp.com\form_test.php:10) in D:\Sites\killerphp.com\form_test.php on line 17 Please can some one help me out, i'm sure this is just basic stuff but i just cant get it to work Cheers. I've been learning programming with the hope of being able to get work at home with decent pay and semi-reliable job offers.
However, I'm disabled and it would be difficult to work on-site.
Is it a waste of time, am I going to have great difficulty finding work?
Edited by icor1031, 18 September 2014 - 10:35 PM. This include does not work. I presume due to the ? in it. <?php include("signin-redirect.php?page=my-account.php");?> It works as just signin-redirect.php but I want to include the ?page=my-account.php on the end of it. Thanks This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314251.0 |