Advertisement

05.16.2008 at 01:48AM PDT, ID: 23407658
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Simple 3 PHP page (NO DATABASE) that user unchecks from 3 checkboxes and last page displays rest

Tags: PHP
I want 3 page source code for PHP that looks kinda simple.
No database required, just simple variables

PAGE1
A user has a username : george and password : 112233
So in this page 2 login input text fields is displayed requiring
this things. If entered correctly, will go to PAGE2, or else
message with error that "WRONG USERNAME or PASSWORD"

PAGE2
Imagine that we entered from page1, so this is a library.
We have lets say ALREADY selected and own 3 book. So
simple display with the books,
they are displayed like that with checkboxes
[_] booktitle1
[_] booktitle2
[_] booktitle3
<RETURN BOOKS button>

The user has the option to select which of the below
wants to return to library and presses a submit button below
that says "RETURN BOOKS"

PAGE3
A simple page is displayed showing the REST of the book
that we have, so if we checked for example book1 before,
this page will display :
You now have
Booktitle2
Booktitle3

or if we selected all 3 above, nothing will be displayed

Thanks for your time and help in advance
I am looking forward because some
weeks ago you solved me another one like that.

These are my last 235 points I can provide (no more left, but wiling to buy some if any new come up)
Start your free trial to view this solution
Question Stats
Zone: Web Development
Question Asked By: brakos
Solution Provided By: fosiul01
Participating Experts: 2
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
05.16.2008 at 07:17AM PDT, ID: 21582891

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.16.2008 at 08:29AM PDT, ID: 21583618

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.16.2008 at 09:02AM PDT, ID: 21583949

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.16.2008 at 10:44AM PDT, ID: 21584856

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.16.2008 at 10:59AM PDT, ID: 21584992

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.16.2008 at 11:10AM PDT, ID: 21585079

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.16.2008 at 01:44PM PDT, ID: 21586309

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.16.2008 at 05:47PM PDT, ID: 21587536

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.17.2008 at 04:37AM PDT, ID: 21588798

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.17.2008 at 04:42AM PDT, ID: 21588807

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.17.2008 at 06:15AM PDT, ID: 21589219

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.16.2008 at 07:17AM PDT, ID: 21582891
ok, got some points and added 400 in total. hope to hear anything. bye
 
05.16.2008 at 08:29AM PDT, ID: 21583618
HI, if you dont use database then whats the point of this code ??Because problem is page2, without holding your data in database or some kind of text.txt file how you want me to do ??

 
05.16.2008 at 09:02AM PDT, ID: 21583949
the bellow code is the implementation of your page1.

let me know how do you want your page2 ( library).

"""We have lets say ALREADY selected and own 3 book. So
simple display with the books, """

if you want 3 books to be selected from before , you need to store these 3 book some where,

where you want to store these 3 book ??

let me know then i will sent you rest of the code
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
***************
index.php
***************
<?php
 
  $username = $_POST['username'] ;
  $password = $_POST['password'] ;
  
include('function.php');
 
 if($_POST['submit'])
  {
  	if ($username == 'george' AND  $password =='112233')
	  {
	         header('Location: library.php');
	   }
	   
	  else 
	  {
	   echo "wrongpassword";
       }
  }
 
?>
 
<form action="<?php echo pf_script_with_get($SCRIPT_NAME); ?>" method="post">
 
<table>
<tr>
        <td>Username</td>
        <td><input type="text" name="username"></td>
</tr>
<tr>
        <td>Password</td>
        <td><input type="password" name="password"></td>
</tr>
<tr>
        <td></td>
        <td><input type="submit" name="submit" value="Login!"></td>
</tr>
</table>
</form>
*****************
function.php
**************
 
<?php
function pf_script_with_get($script) {
	$page = $script;
	$page = $page . "?";
	
	foreach($_GET as $key => $val) {
		$page = $page . $key . "=" . $val . "&";  
	}
	
	//return substr($page, 0, strlen($page)-1);
}
?>
Open in New Window
 
05.16.2008 at 10:44AM PDT, ID: 21584856
Sounds like homework :O

Anyway are you supposed to be hard coding in just those 3 books? Or are you going to be adding more users and books?

If you are planning on adding more you cannot do that without either a flat file system or a database backend
 
05.16.2008 at 10:59AM PDT, ID: 21584992
fosiul01: i wont store to no-database. just simple php that displays some variables. nothing more!

some days ago i wanted a book selection, the solution is below already accepted by me
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23338019.html

just what to write in page1.php, page2.php, page3.php :-)

sakuya_su: no its not a homework :-) I am 33 years old :-) hehehe no, i dont want more books, just SUPPOSE that i have selected 3 booktitles and then subtract them from the selection (page2) and display the rest (page3) :-)

page1 : login feature with simple user/pass
page2 : display 3 stuf and select what to remove
page3 : display the rest from the 3 that remain (or none if already selected previously all 3)
 
05.16.2008 at 11:10AM PDT, ID: 21585079
Ah in that case i shall not steal fosiul01's glory and let him go ahead and give you the solution(half of it is there already)

I will check back in a few days
 
05.16.2008 at 01:44PM PDT, ID: 21586309
fosiul01: please continue and finish the rest and I gonna check them
soon in my web server. thanks for the effort and I am waiting for the solution. bye
 
05.16.2008 at 05:47PM PDT, ID: 21587536
hi i wil send u the ful code tomorrow .as it is night.
 
05.17.2008 at 04:37AM PDT, ID: 21588798
HI yah Good morning

What i will do is, to maintain a sequences from your last question, i will keep till page 3

and i will keep a options if any one want to Deselect any books

so it will go back  and will allow  user to deselect some books then it will come back again to page3 with calculation

is this ok ??
 
05.17.2008 at 04:42AM PDT, ID: 21588807
Or shall i do what you said in your question.
ok i already started what you said in your qestion
if need i will modify
 
05.17.2008 at 06:15AM PDT, ID: 21589219
Ok here we go your full code ,

unless you dont uncomment variable in logout.php - it will hold 3 books title in sesson so that you can always see which title you have been selected by going to page2.php.

but its every static code which i dont like. anyway, let me know if you need any further modification.


NOte : sorry i accidently posted this solution to another question you sent here!!!

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
******************************
page1.php( which is your login page)
**********************************
<?php
session_start();
 
  $username = $_POST['username'] ;
  $password = $_POST['password'] ;
  
include('function.php');
 
 if($_POST['submit'])
  {
  	if ($username == 'george' AND  $password =='112233')
	  {
	   session_register("username"); 
        $_SESSION['username'] = $_POST['username'] ; 
       
			
	         header('Location: page2.php');
	   }
	   
	  else 
	  {
	   echo "wrongpassword";
       }
  }
 
?>
 
<form action="<?php echo pf_script_with_get($SCRIPT_NAME); ?>" method="post">
 
<table>
<tr>
        <td>Username</td>
        <td><input type="text" name="username"></td>
</tr>
<tr>
        <td>Password</td>
        <td><input type="password" name="password"></td>
</tr>
<tr>
        <td></td>
        <td><input type="submit" name="submit" value="Login!"></td>
</tr>
</table>
</form>
 
*******************
page2.php - Your selection page
***************
<?php
session_start();
 
if(isset($_SESSION['username']) == FALSE) {        // Checking if username session is false, it will redirect to login page
	header('Location:  page1.php');
}
else { 
 
 
if($_POST['Spage2']){
$_SESSION['s1b1'] = $_POST['s1b1'];
$_SESSION['s1b2'] = $_POST['s1b2'];
$_SESSION['s1b3'] = $_POST['s1b3'];
 
header('location: page3.php');
exit;
}
?>
 
<form name="form1" method="post" action="<? $_SERVER['PHP_SELF']; ?>">
<?php
if(!empty($_SESSION['s1b1'])){
 ?>
<input type="checkbox" name="s1b1" id="checkbox" value="Book title 1" checked>
 
Book title 1 <br>
<?php
}
else
{
?>
 
<input type="checkbox" name="s1b1" id="checkbox" value="Book title 1" >
 
Book title 1 <br>
<?php
}
?>
 
 
<?php
if(!empty($_SESSION['s1b2'])){
 ?>
 
<input type="checkbox" name="s1b2" id="checkbox" value="Book title 2" checked >
 
Book title 2 <br>
<?php
}
else
{ 
?>
<input type="checkbox" name="s1b2" id="checkbox" value="Book title 2"  >
 
Book title 2 <br>
<?php
 
}
?>
 
 
<?php
if(!empty($_SESSION['s1b3'])){
 ?>
 
<input type="checkbox" name="s1b3" id="checkbox" value="Book title 3" checked >
 
Book title 3 <br>
<?php
}
else
{ 
?>
<input type="checkbox" name="s1b3" id="checkbox" value="Book title 3"  >
 
Book title 3 <br>
<?php
 
}
?>
 
 
<input name="Spage2" type="submit" value="Return Books">
 
</form>
<?php
}
?>
 
*****************
page3.php - Result
*****************
<?
session_start();
if(isset($_SESSION['username']) == FALSE) {        // Checking if username session is false, it will redirect to login page
	header('Location:  page1.php');
}
else { 
 
echo "Hi " ; echo  $_SESSION['username'] ;
echo "<br >";
echo"You have selected following books:";
echo "<br />"; 
if(!empty($_SESSION['s1b1'])){
 
echo $_SESSION['s1b1']."<br>";
$Vs1b1 = 1 ;
}
if(!empty($_SESSION['s1b2'])){
 
echo $_SESSION['s1b2']."<br>" ;
$Vs1b2 = 1;
}
if(!empty($_SESSION['s1b3'])){
 
echo $_SESSION['s1b3']."<br>" ;
$Vs1b3 = 1;
 
}
$vs = $Vs1b1+$Vs1b2+$Vs1b3;
 
echo "Total Books:" ;echo $vs ;echo" Books";
echo '<br />';
 
if(empty($_SESSION['s1b1'])){
 
echo" You still have this books to return:"; echo "Book Title1"; echo"<br>";
 
}
if(empty($_SESSION['s1b2'])){
 
echo" You still have this books to return:"; echo "Book Title2"; echo"<br>";
 
}
 
if(empty($_SESSION['s1b3'])){
 
echo" You still have this books to return:"; echo "Book Title3"; echo"<br>";
 
}
 
echo "<a href='page2.php'> goto Book Selecton page</a>";
echo"<br />";
echo "<a href='logout.php'> logout</a>";
}
?>
 
*****************
logout.php ' user logout and Reset checkbox
******************
<?php
session_start();
session_unregister("username");
// After logout if you want to start from beginning then uncomment these 3 lines it will reset all the session for checkbox
//session_unregister("s1b1");
//session_unregister("s1b2");
 
//session_unregister("s1b3");
 
 
header('Location:  page1.php');
?>
*************
function.php- userdefined
**************
<?php
function pf_script_with_get($script) {
	$page = $script;
	$page = $page . "?";
	
	foreach($_GET as $key => $val) {
		$page = $page . $key . "=" . $val . "&";  
	}
	
	//return substr($page, 0, strlen($page)-1);
}
?>
 
Open in New Window
Accepted Solution
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628