HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
add value - rollover image link?
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Newbie101



Joined: 09 Oct 2008
Posts: 35

PostPosted: Wed Oct 15, 2008 10:14 am     add value - rollover image link? Reply with quote

I am using php sessions to score a photo quiz. I can add to my session value at the start of next pages,
but am now duplicating pages because I am changing the value at the beginning of the next link.

In my quiz clicking the link "IS THE ANSWER". I am fine at changing the values this way, however if they scored correct I am sending them to "correct.php" (Where I add 1 to correct session value) and if they are wrong I am sending them to "wrong.php" which simply asks the next question

The "correct.php" page has code such as
Code:
<?php
session_start();
$_SESSION['yes_value']=$_SESSION['yes_value']+1
?>


I could save duplicating the result pages if I could add the value inside the link.

such as (unworking code here)

Code:
<A HREF="yesorno.php" onClick="$_SESSION['yes_value']=$_SESSION['yes_value']+1" onMouseOver="ChangingImage.src='eggso.jpg'" onMouseOut="ChangingImage.src='eggs.jpg'"><IMG SRC="eggs.jpg" NAME="rolloverimagelink" BORDER="4"></A>  <P><BR>


The unworking onClick line is the trouble here

I have tried a variety of different placing of the php tags in this as well.

Am I asking too much in this code. Mouseout,mouseover,onclick,and 2 images plus changing value??

I'm guessing my problem might be the placement of tags, but..... I'm a newbie so maybe its just a bug.

Id also love to be able to transfer them to a random question with a random link code in the same.
rollover image value changing link.lol

with code such as (javascript example only because I've not been able to debug my first problem.

Code:
<script type="text/javascript">
<!––
   link = new Array; //creates array

   link[1]="random/end1.html";
   link[2]="random/end2.html";
   link[3]="random/end3.html";
––>
</script>


Anyways thanks again for all the great tips and advice I have recieved on this website. It is invaluable. Even if I cannot solve this, I can still continue my projects newbie style.

My newbie stlye idea might be to quickly send them to a blank page that alters the necessary values and redirects them randomly to next question
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial