Jump to content

neverbegosu

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Everything posted by neverbegosu

  1. does anyone know what "page" is referencing. After doing some more research I think it is referincing something in the url index.php?page=xxxx does that seem right?
  2. Ok so Mahngiel, hope I spelt that right. I did some rethinking after reading what you have said, and did some research on functions and peramiters. I am currently reviewing a small tutorial, and although some if it is making sense, I was hoping you can disect it fore me. Or anyone for that matter, once I understand it, I will be able to use it. I have linked the tutorial incase you need to see the structure of things. http://www.zeronese.net/knowledge-base/articles/article-1029.html <?php if(isset($_REQUEST['page'])) { if($_REQUEST['page'] !="") if(file_exists("pages/".$_REQUEST['page'].".html")) $page_content = file_get_contents("pages/".$_REQUEST['page'].".html"); else if (file_exists($_REQUEST['page'].".html")) $page_content=file_get_contents($_REQUEST['page'].".html"); else echo "<center>Page: ".$_REQUEST['page']." does not exist! Please check the url and try again!</center>"; } else $page_content=file_get_contents("design/pages/main.html"); $page_content=str_replace("!!HEADER!!",file_get_contents("design/header.html"), $page_content); $page_content=str_replace("!!LEFT_COLUMN!!", file_get_contents("design/left_column.html"),$page_content); $page_content=str_replace("!!RIGHT_COLUMN!!",file_get_contents("design/right_column.html"),$page_content); $page_content=str_replace("!!FOOTER!!",file_get_contents("design/footer.html"),$page_content); echo $page_content; ?> on the first line of code if(isset($_REQUEST['page'])) if(file_exists("pages/.$_REQUEST['page'].".html")) I think it checks weather the "page" is not null. But where is it checking this at? I mean where would 'page' come from its the same for the second line as well. I know its going to check for the existence of a file in the pages subfolder, so right now the only one it can be is "main" but again, the 'page' where is that declared, or defined? Once I figure out where the 'page' is comeing from I think I will be able to understand how I can use this.
  3. do you know any good tutorials on how to better learn functions, and peramiteres, expecially when It comes to building a website. I am very new to this php, and am self learning through tutorials and what not online. I designed what I did, in order to create webpages without having to rebuild the entire page everytime, just change the content in the center div. I used to re write the entire script. So I created a function/templet that I call from each webpage.php so it puts all the content up without having to retype it. From there I was doing html content and storing it on a database, and linked that database to the sitebuild.php. I guess I will install php on my computer and use xxamp to see how there doing it, and try to figure some stuff out that way. Thanks for the help mate, and again sorry for the signature thing.
  4. LMAO IC sorry for the misunderstanding. But horrible signiture man, nubs like me dont realize that stuff.
  5. kk first off, I don't know why you posted that quote from someone in this thread, I am not wanting anyone to write the code for me. I don't want the code at all. I want the understanding, so if your going to post shit like that, then do so in your own thread. As for your answer for me, it does make sense. That leaves me with the problem of achieving what I want to achieve so not I have to look at other venues of doing so. Is it possible to call a function that has a varible in the name, so you can pull diffrent functions based of the variable. I have webpages main.php profile.php that have a variable of $title=main/profile exc... In my sitebuild.php I built a function that builds the website without the center content. I declared the variables global in this function in order to call them from the page php scripts. centercontent(); is used to call the function building the center. Can I do somehting like this in order to make it page selectable. centercontent.$title(); ??? that way the name of called function changes with each page I run?
  6. what about variables in a query, then I can make a function to call to create the varibles, is there a way to do what I am trying to other the php code in the database and pulling it as a query? I was assuming. when you pull information out of a database echo $queryrow['user']; would echo whatever is in the that datacell so TESTUSER1 would show on the screen. So is it not right to access the datacell can be used as a variable?
  7. have an issue I am trying to work out. php document example (I pull information from my db to build forms and what not. But I am wanting to add php code into but it always just post the code, and not executing it.): echo 'test'; echo 'test'; echo $getresultsquery; DATABASE EXAMPLE db test1 table test1 field1 label field2 header field3 post $_SESSION['user']; ---------------------------------- I have succesuffully been able to run the the queries and pull content, and execute html code. Even within an echo statement on the php with the html in the query. But I cant figure out how to do php code in the query. Almost like using the database as a function, in some sense. If anyone knows why this is can you please get back to me.
×
×
  • 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.