473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to link two webpages by using php

How do I link two webpages together?

My first page
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if( ($user != null) and ($colour != null) )
  4. {
  5.     setcookie( "firstname", $user, time()+2592000 );
  6.     setcookie( "fontcolour", $colour, time()+2592000 );
  7.     header( "Location:getcookie.php" );
  8.     exit();
  9. }
  10.  
  11. ?>  
  12.  
  13. <html><head><title>Set Cookie Data </title></head>
  14. <body>
  15. <form action ="<?php echo ($PHP_SELF); ?>" method = "post">
  16.  
  17. Please enter your first name:
  18. <input type="text" name="user"> <br> <br>
  19.  
  20. Please choose your favourite font colour: <br>
  21. <input type="radio" name="colour" value="#FF0000">Red
  22. <input type="radio" name="colour" value="#00FF00">Green
  23. <input type="radio" name="colour" value="#0000FF">Blue
  24.  
  25. <br><br> <input type="submit" value="submit">
  26.  
  27. </form>
  28. </body></html>


My second page

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <title>Get Cookie Data</title>
  4.             <style type="text/css">
  5.                body { color: <?php echo ($fontcolour); ?> }
  6.  
  7.             </style>
  8.     </head>
  9.     <body>
  10.         <h1>Hello <?php echo ($firstname); ?>! </h1>
  11.     </body>
  12.  
  13. </html>
Aug 3 '12 #1
1 1787
Dormilich
8,658 Expert Mod 8TB
what do you mean by "link two webpages together"? can you elaborate on that?

PS. register_globals is deprecated for security reasons, use $_GET or $_POST to access your form data.
Aug 6 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Brice Breeden | last post by:
I'm porting C++ code to Solaris 9, using gcc 3.3. I had some link errors, but was able to figure out which libraries were needed for all but one of the functions. Here's the linker error I can't...
3
by: Song Zhang | last post by:
I have two webpage, one is http://appA.mycompany.com/first.html and the other is http://appB.mycompany.com/second.html When a user visits first.html, he may click a button A, which launches...
1
by: [H]omer | last post by:
Have a look at this page using Mozilla or Opera (or any other non-IE browser): http://www.genesis-x.nildram.co.uk/test.html Down at the bottom right, there's a ads box "id=rentbox" with the...
1
by: Brett | last post by:
I am writing a program that will allow a user to enter a webpage address into a form. Then it will download and display the webpage below the current one. example...
2
by: programmer2004 | last post by:
Hi I have used WebBrowser control and i want to save the entire webpage including pictures etc. i have called ExecWB method of WebBrowser control with OLECMDEXECOPT_DONTPROMPTUSER flag, but it...
6
by: ivan.leben | last post by:
I want to write a Mesh class using half-edges. This class uses three other classes: Vertex, HalfEdge and Face. These classes should be linked properly in the process of building up the mesh by...
4
by: lasithwaruna | last post by:
hi , im new to php.I want to know how to click a link automatically. i want to go to a url without clicking a link.. plese submit your post thank you....
17
by: aquablade | last post by:
I have an Oracle 10g R2 database where my ERP transactions reside. I'm using MS Access to grant access to my power users where I use MS Access' Link Tables to provide direct access. I noticed that...
1
by: letmetry | last post by:
Hi all, Is there any way to click a link or button present on the desktop using C#.
7
by: Melissa De Luca | last post by:
Hello, I want to override my css for a page on my site. I am looking to change all of the link attributes to a style i have in place. The code I have under the style is : .style14...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.