Jul 24, 2008

2 Pages Into One - how?

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming
Pages: 1, 2

free web hosting

2 Pages Into One - how?

demonlord
Hello,
now this may be a stupid question but i'm very new to php so i need some help. what i'm wanting to do is combine 2 pages in to one. like for example the install.php for invisionpower board it starts with one page and you click continue and it gives you a whole new page but if you look at the url you are still using the install.php file but it has somethinglike "?a=2" at the end. how can i do this.

Thanks

Reply

sonesay
You can control what gets processed in index.php by taking the tagged get variables at the end of the URL and using it in your code.


For example if you have a file called index.php
CODE

<?php

$do = $_GET['do'];


if($do == 'option1')
{
// do what ever you need to be done here
}
else if($do == 'option2')
{
// do what ever you need to be done here
}

?>



?>



so now you can make links that go to index.php and add controls to it by adding to the end of the URL

i.e index.php?do=dothis


Reply

demonlord
never mind i see you edited you post and what you put in had the answer to what i was going to ask.


Thanks for posting this

Reply

kobra500
Hmm im trying to learn php but its the one language I cant get my head round!

Reply

demonlord
yeah i know i've been trying to learn it for about a month now with no progress. it's hard

Reply

sonesay
I was in your shoes a few years ago, I ended up buying a book and went through the tutorials in them. It helped but then I was way to busy and never even did any PHP for a year or 2 and then I never progressed. The only advice I can give you is keep doing it. Thats how I improved, You know the old saying hard work really pays off and it does. You may not pick it up in a few days/weeks/months but you will pick it up eventually. And also if your stumped you can always post here.

Good luck.

Reply

demonlord
after i started this topic i actuly went out and got some books on php and i'm going to sit down and go through them and make a whole lot of notes so hopefuly that will help.

and thanks again for the help

Reply

jlhaslip
Here is a link to a Tutorial I wrote some time ago. Back when I was just starting out learning some php. I would do things a little differently now, but it might assist you with the task you face.
Any questions, just post them to that thread, please.

http://www.trap17.com/forums/templating-sy...des-t35271.html

Reply

demonlord
sonesay i have one more question about the script

where do i put the code that i want to show up if $do is Null for example if i name the script act.php where would i put the code that they would see if they went to act.php instead of act.php?z=whatever.

Thanks

Reply

sonesay
QUOTE(demonlord @ Feb 25 2008, 08:58 AM) *
sonesay i have one more question about the script

where do i put the code that i want to show up if $do is Null for example if i name the script act.php where would i put the code that they would see if they went to act.php instead of act.php?z=whatever.

Thanks



CODE
if($do == 'option1')
{
// do what ever you need to be done here
}
else if($do == 'option2')
{
// do what ever you need to be done here
}
else
{
// the previous 2 checks didn't match do this section of code
}


You can add more else if checks if needed but its too hard to cover all possibilities so if none match you can add a final statement of else at the bottom and it will execute if none of the above checks are true.

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Similar Topics

Keywords : 2, pages,

  1. Simple Javascript And Password System
    How to protect your pages with password (6)
  2. Pagination
    ? (3)
    People they create the databases in which like the news stories are placed. Then that news stories,
    they are placed on certain page to be displayed and readable by other users on the web-site. How
    people do that thing paging, like you can see bottom, whenever, you go to Any CMS engines. Need the
    concept how you can create, 1, 2 or 3 pages, then next and back buttons, last and beginning page.....
  3. Protect Pages
    HOW? (20)
    I create certain pages for my web-site, and I would like to protect them that no one can hack or see
    their source codes. So, if everybody knows how to do it, please post a reply over here. List of
    the best ways, I can do it. Thanks.....
  4. Php--> Content-only Pages
    Create easy to edit php pages. (9)
    Description Learn to create easy to edit content-only pages with php. By parsing your layout into
    your pages, you can reduce file sizes and files will become much neater. Try it out Ok, lets
    start by creating a file called template.php. CODE <?php
    //--------------------------------- //Layout top section //---------------------------------
    $top = <<< html <!-- include HTML header code here --> <body>
    INSERT CODE FOR [b]TOP[/b] OF LAYOUT HERE. html;
    //--------------------------------- //Layout bottom sec....
  5. Some Pages On My Site Won't Even Load..
    (6)
    Ever since today, my site has been working just fine. I'm maintaining the amount of points I
    need, and the server status has been and still is fine. However, a while ago I tried to access my
    site and it wasn't loading. When I loaded the root URL, it worked fine though. I went to the
    file manager and noticed that the file I was trying to previously access was .php, and the index
    file at my root URL was .html. I deleted the index.html file and made a index.php file, then tried
    loading it again. Safari gave me the following message: QUOTE Safari can’t ope....
  6. Site Error For Php Pages
    Needs to Be Fixed Immediately (6)
    My site has been using Qupis for over a month now, and a few of my pages are php files. My site has
    been operating properly until today. My html pages are working properly, but all of my php pages
    are giving me the following errors. QUOTE Warning: Unknown: open_basedir restriction in effect.
    File(/home/disneyre/public_html/info.php) is not within the allowed path(s): (1) in Unknown on line
    0 Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 Fatal
    error: Unknown: Failed opening required '/home/disneyre/public_html/info.php&....
  7. Php Pages Problem [resolved]
    Please help me im stuck ;-( (5)
    Hi, i have been working with a wap forum script, translating from russian and fixing errors etc..
    but now im stuck, the problem is with the pages while viewing a forum.. Let me explain.. the pages
    are set to show ten topics per page which all works fine as you can see in these screenshots: page
    1: page 2: The problem occurs when there are PINNED topics (with the redish folder), it will
    show ten topics but also the pinned ones on page one, and the "Next" link will appear before it
    should leading to a blank page where there should be topics but they are still on th....
  8. Pages Url Set Up Problem
    (5)
    ok so... im in cpanel making new pages for my website.. (ending the names in .html and saving them
    as an html document) but every now and then my pages, such as this one
    http://www.have-heart.trap17.com/staff.html will not work if you place the WWW. after the http://
    only if you type in http://have-heart.trap17.com/staff.html is there anyway to fix that?
    without going in to all my pages and changing the navigation for each page?? ps.it happens both
    ways,, somethings i wont be able to acess certain pages if it begins with \
    http://have-heart.trap17.com/....
  9. Php An Js Window.open Pages Trouble.
    I need a way to set hidden input values to the new window. (3)
    I have 2 main pages Page A(events_locked.php) and Page B(add_attendance.php). Both are php files.
    Page A takes a post var from another page(not Page B ) and then used to query for displaying records
    in a mysql datase. This variable has set as a session variable because there is 1 <script
    LANGUAGE="JavaScript"> window.name="main_index"; function openFormWindow() {
    OpenWindow=window.open("add_attendance.php", "newwin", "height=250,
    width=400,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=no"); var x =
    getElementByName("form1"); x.target="newwin"; x.s....
  10. What Is C++ Server Pages?
    (1)
    QUOTE C++ Server Pages (CSP) is a Web Engine for advanced Web Application Development, that uses
    blended Markup Language / C++ scripts ( such as HTML/C++, XML/C++, WML/C++ etc.) Similar to ASP and
    JSP, it provides a great easiness in creating web pages with dynamic content, as well as complex
    business applications. However, instead of Java, Javascript or VBscript, it uses C++. This
    brings some significant advantages: Incredibly high processing efficiency. Benchmarks have shown a
    range of 80 to 250 times higher processing speed than ASP. The use of pure C++ all....
  11. Problem With Firefox, Latest Version, Not Loading Pages
    any ideas? (4)
    Hi all Ive had this problem for a little while now, i cant say exactly when but it started with
    sites such as youtube and has spread out from there really, the biggest culprits are youtube and
    myspace. The issue is that if i was on youtube and wanted to watch a video i would obviously click
    the link, firefox would then show the loading bar and my page loading timer would start but it would
    never actually begin loading, the status bar would say "loading" or if i clicked the link again it
    would show "stopped" yet the loading bar would be there. Needless to say the loadin....
  12. Php Pages Permission On Apache Server
    PHP pages permission on Apache Server (1)
    Hello, I want to know what permissions for PHP pages should be given on Apache web server so that
    PHP pages can be executed. If PHP pages are in a folder, what permissions should be given for that
    folder? ....
  13. How To Get All Pages To Be Indexed
    Bot question (3)
    I use the .co.nr url shortening service from freedomain.co.nr But when I submit my site to google,
    only the homepage of my blog is shown in the search results. I can't get my individual posts to
    be indexed. Can I do something?....
  14. Making Custom Error Pages With Cpanel
    Not working properly (4)
    I set up the custom error pages using CPanel, but they aren't working properly. I get the
    standard error code. CODE The requested URL was not found on this server. Additionally, a 404
    Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Plust that little bit on the end. Am I doing something wrong or is it something that needs to be
    handled by an admin?....
  15. Still Getting Old Pages
    :( (6)
    I tried clearing my cache, i even did it manually but still I am getting all pages /sad.gif"
    style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> I made a new topic cuz i
    can't see the old one due to loading of an old page /sad.gif" style="vertical-align:middle"
    emoid=":(" border="0" alt="sad.gif" />. What i did, i pressed delete files in the internet options,
    i enterd the temperorary internet files manually and deleted everything but Iam still getting old
    pages /sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> What do....
  16. Pages Not Found?
    (2)
    Hi all, i'm having trouble finding my webpages, right now its just text and a login doodlie
    thing, but i access my files by visiting the page, so i can't see my changes as they happen Has
    this happen to anyone else, any thoughts, etc?....
  17. How Do I View My Site?
    What are the links to my pages?? (4)
    This may be sort of a Noob question but..... How on earth do I view my webpages?? I logged into my
    control panel and uploaded my webpages(html and php) but what are the links to the?? (I mean
    mysite.qupis.com/myfile.html or something like that) Pleez help me mates. /sad.gif"
    style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> /sad.gif"
    style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> /sad.gif"
    style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> My site is
    madmax.qupis.com Need help!!....
  18. Adding Accessibility Features To Your Pages
    Using the :active/:focus pseudo-class (0)
    Here is a tip for its use on your site. Using CSS to tell your visitors where they are on your site
    can be fairly complicated depending on the method you use. The CSS Specifications have defined a
    "pseudo-class" for the link which currently has 'focus' and another pseudo-class for the
    'active' state. They can be used to tell your visitors where their cursor is on the page
    and you do that be altering the CSS for the link which currently has the focus and those which are
    being activated. The ' active' state only occurs momentarily while the ....
  19. Do You Want To Use Php Code In Your Html Pages?
    Within two minutes you will! (9)
    Whilst searching around for help to setup cutenews blog I came across a way to use php in html pages
    - lo and behold it works! so I thought I'd share it with you all (Unfortunately I can't
    remember the site so I wrote this up a couple of minutes after I did it:) ). This method requires a
    web server with apache installed. So, luckily for us all this covers the whole of Trap17... even
    Qupis /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" /> Just
    to make the point, this is in no way a difficult task and it doesn't requir....
  20. Putting Data Of 2 Pages In Mysql At Once
    (1)
    suppose i have a page, page.php?part=1 there i have some text fields. user will give input, but
    after taking input, it will not put the data in mysql .. but it will take to the next step..
    page.php?part=2 (if any field is left blank, it will not go to next page.. ) . and there also some
    fields.. after the user has filled that form also, then it will insert all data (from part1 and
    part 2) in mysql. i want to ask, how i can collect data from 2 pages and put in mysql at once.....
  21. Data Access Pages ?
    Help or Assistance with creating a data access page to collect data fr (1)
    QUOTE Hello All. I'm looking for some advise or assistance with getting a web page/access
    page running so that i can have the page online and collect the data live into my database for
    Project Management... Currently I'm developing a database using M$ Access, and need to
    have staff data enter sales information directly into a web form that can be linked to a database?
    I've looked at using a M$ Front page web form with data collected into a .CSV text file and
    extracting the data but i need to be able to let the staff review and update the data....
  22. Dynamic Php Pages
    Nice tutorial (5)
    This is a really good tutorial on making php pages that normally appear as
    www.domainname.com/links.php appear as www.domainname.com/index.php?page=links
    http://nuwen.com/tutorials/php-dynamic-pages ....
  23. Advantages Of Using Tableless Designs For Web Pages
    (17)
    since tables are deprecated and not intended to be used for website layouts and future browsers may
    not support tables i thought of listing a few advantages of using tableless designs for web pages
    the first and obviously the most important reason is faster loading time ofcourse yo all will i
    think know the fundamental truth - tables load slowly one way to counter this problem itself becomes
    a bigger problem, that is to set the width and height of all your table elements , now think how
    many td open tags you'll be having in a average table based layout ? tons , so....
  24. Document Type Declarations
    And why we use them in html pages (0)
    This code: CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>
      <title>HTML 4.0 Strict document</title>     <meta
    http-equiv="content-type"  content="text/html;charset=utf-8" >     <meta
    http-equiv="Content-Style-Type"  content="text/css" > </head>
    <body>      <p>... Your HTML content here ...</p>      <p>... More
    HTML content here ...</p>   </b....
  25. Naming Your Pages For Search Engines Accessnig
    how to be on top of serch engines with your pages (1)
    dear fellow forum posters this is a lateast development HOW TO NAME YOUR PAGES to start with never
    name your pages just as if things dont matter like if your site is georgen.trap17.net and in it
    you have some products like flowers and other things like weding gowns etc to name it fot serch
    engines optimazation just say you will have and index.html and the sencond one that contains
    flowres is mypropduct.index.html finally the last is stuff.html to get a best name just use
    hyphens like weddin-gown.html and the other flora-product-html if you do it so search engines ....
  26. Asp On Trap17 To Make Password Protect Pages
    (4)
    I was wondering if I could use .asp pages on trap17, because I am currently looking for a login
    script and all from my video pages. I've seen a script using .asp, but when I uploaded it and
    pointed my browser to it, it showed a download box. Would anyone happen to know of a place I can
    find a free login script? I've tried puma , and its great, but when iIview a protected page, I
    have to go to the main login page first, then i'm allowed to view the protected page. I
    don't want to have to login every single page I protect, and I want two access levels, of ....
  27. Making A Dynamic Page On Blogspot
    Using an external server to make your pages hosted on blogspot dynamic (5)
    Good morning everyone. Have you ever wondered how to allow your visitors to edit content on your
    blog? Like adding a post straight off the page, adding a link, editing your profile etc. This will
    be extremely useful if you want your visitors to contribute to your blog besides writing comments or
    tagging. 1. Adding a post straight off the page. Go to blogger.com, login, select your blog. Go to
    settings -> email. By enabling blog email, you can now add a post by simply sending an email to the
    address you specified. The address should look something like: yourusername....
  28. How To: Make A Simple Php Site
    Making one file show up on all pages using php (21)
    I have looked all over the site and could not find anything that was like this simple, or just like
    this at all.. For some people i know that you are using a basic HTML site...and having a big menu
    if you want to add somthing you have to go into every one of the pages and add or remove or edit
    what you want to do, but with somthing verry simple all you would have to do is edit one file, and
    all of the pages that have the PHP script on them would suddenly change to what that one file is.
    So to start off if you are planning on using this little tirck, the page that you a....
  29. Custom 404 Error Pages
    A Tutorial On How To Make Custom 404 Error Pages (17)
    I've seen a tutorial on here and no offense but it was horrific, this is the real way you do a
    404 Error Page. Make a file called: htaccess.txt Open it up and put this: CODE ErrorDocument
    404 /myerrorpage.html You will need to change myerrorpage.html to whatever your page is called.
    Also when you upload this file to your server you need to rename it to: .htaccess Yes, the dot is
    before the words. You need to do this on the server because on Windows you cannot do that!....
  30. Test Your Php Pages W/o Upload/internet
    complete *working* guide on how to test your php pages (57)
    In this tutorial, I'm going to show you how to test your PHP pages without the Internet or
    uploading the files to your trap17 server. This tutorial is similar to doom's, but the links he
    provided does not work, so I decided to make my own tutorial with working links. The program that I
    will be using for this tutorial is called XAMPP . XAMPP is a modification of the popular Apache
    server, and I'm using XAMPP because of its simplicity to install as well as maintain. The
    current version of XAMPP is 1.4.13 and it has the following bundled in the download: QUOT....

    1. Looking for 2, pages,

Searching Video's for 2, pages,
Similar
Simple
Javascript
And Password
System - How
to protect
your pages
with
password
Pagination -
?
Protect
Pages - HOW?
Php-->
Content-only
Pages -
Create easy
to edit php
pages.
Some Pages
On My Site
Won't
Even Load..
Site Error
For Php
Pages -
Needs to Be
Fixed
Immediately
Php Pages
Problem
[resolved] -
Please help
me im stuck
;-(
Pages Url
Set Up
Problem
Php An Js
Window.open
Pages
Trouble. - I
need a way
to set
hidden input
values to
the new
window.
What Is C++
Server
Pages?
Problem With
Firefox,
Latest
Version, Not
Loading
Pages - any
ideas?
Php Pages
Permission
On Apache
Server - PHP
pages
permission
on Apache
Server
How To Get
All Pages To
Be Indexed -
Bot question
Making
Custom Error
Pages With
Cpanel - Not
working
properly
Still
Getting Old
Pages - :(
Pages Not
Found?
How Do I
View My
Site? - What
are the
links to my
pages??
Adding
Accessibilit
y Features
To Your
Pages -
Using the
:active/:foc
us
pseudo-class
Do You Want
To Use Php
Code In Your
Html Pages?
- Within two
minutes you
will!
Putting Data
Of 2 Pages
In Mysql At
Once
Data Access
Pages ? -
Help or
Assistance
with
creating a
data access
page to
collect data
fr
Dynamic Php
Pages - Nice
tutorial
Advantages
Of Using
Tableless
Designs For
Web Pages
Document
Type
Declarations
- And why we
use them in
html pages
Naming Your
Pages For
Search
Engines
Accessnig -
how to be on
top of serch
engines with
your pages
Asp On
Trap17 To
Make
Password
Protect
Pages
Making A
Dynamic Page
On Blogspot
- Using an
external
server to
make your
pages hosted
on blogspot
dynamic
How To: Make
A Simple Php
Site -
Making one
file show up
on all pages
using php
Custom 404
Error Pages
- A Tutorial
On How To
Make Custom
404 Error
Pages
Test Your
Php Pages
W/o
Upload/inter
net -
complete
*working*
guide on how
to test your
php pages
advertisement



2 Pages Into One - how?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE