Jump to content

Ryanz

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Ryanz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the reply .. how can I get errors to display?
  2. Hey ... This is a forgotten password page php script ... I didn't write it ... and I have no clue what the problem could be. There is an error in the php, the page just doesn't load. I've checked the includes with other pages, and they work fine. It's a pretty big script, I've looked through it 100 times and cannot see how it shouldn't work. I'm not a php pro though ... I'm hoping you guys can help! <?php session_start(); ob_start(); include("include/db.inc.php"); if($_SESSION['lang']=='') { $_SESSION['lang'] = "en"; } include 'languages/lang.'.$_SESSION['lang'].'.php'; $db1 = new db; $db1->open(); if(isset($_POST['submit'])) { $email=$_POST['email']; $sql = "select * from user where email='$email'"; $x=mysql_query($sql) or die(mysql_error()); $res=mysql_fetch_array($x); if($res) { $to=$_POST['email']; $body= _UR_US_NM_.$res['uname']. _AND_UR_PWD_ .$res['password'].""; $sub= _UR_LST_PWD_." www.Zimph.com"; $header=""._FROM_.":[email protected]"; $mx=mail($to,$sub,$body,$header); ?> <script language="javascript"> alert("<?=_UR_VRF_CODE_SENT_UR_MAIL_."<br>"._THNK_U_?>"); window.location.href="index.php"; </script> <? }else{ ?> <script language="javascript"> alert("your email mail address is incorrect please enter correct email address"); window.location.href="lost_pass.php"; </script> <? } } ?> <? @include("include/vars.inc.php"); ?> <script src="include/validation.js"></script> <script type="text/javascript" language="JavaScript"> function regvalid() { var Name=trim(document.form1.Name.value); if(is_empty(Name)) { alert(" <?=_ENTER_UR_EMAILID_?>"); document.form1.Name.focus(); return false; } var Password=trim(document.form1.Password.value); if(is_empty1(Password)) { alert(" <?=_ENTER_UR_PWD_?>"); document.form1.Password.focus(); return false; } return true; } </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="friends networking sharing photos finding friends blogs journals blogging journaling bands, zimph, music rate pics join groups forums classifieds online social networking" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Description" content="Zimph is a site like facebook, its an exact clone of facebook for those who want to run their own social networking site, photos, friends, groups, events, bulletin, networks, messages, pokes and much more. find and make your friends here" /> <meta name="Keywords" content="facebook clone, facebook script, exact facebook clone, social networking site like facebook, site for friends, networks, photos, groups, events, bulletin, myspace clone, myspace script, personal chatrooms" /> <meta name="rating" content="General"/> <meta name="classification" content="Web Development, social networking site, facebook clone, facebook script"/> <meta name="coverage" content="Worldwide"/> <meta name="title" content="LittleCroatia | an exact facebook clone developed by influxive technologies"/> <meta name="page-topic" content="products, services, technology, business, Internet, Web, friends, photos, networks, connections, events, groups, relations"/> <meta name="audience" content="all, experts, advanced, professionals, business, youth, children, ladies, females, males"/> <meta name="author" content="Influxive Technologies website development"/> <title><? echo _TITLE_ ?></title> <link href="<?=_BASEURL_?>/css/style.css" rel="stylesheet" type="text/css" /> <link href="<?=_BASEURL_?>/css/base.css" rel="stylesheet" type="text/css" /> <link rel="shortcut icon" href="<?=_BASEURL_?>/favicon.ico" /></head> <body> <table width="800" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="133" height="100%"> <table width="800" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="100%" colspan="2"><? include("newheader2.php"); ?></td> </tr> <tr> <tr> <td width="133" valign="top"><form name="loginform" method="post" action="" onSubmit="return regvalid();"> <table width="133" border="0" cellspacing="0" cellpadding="0" class="lineimg" bgcolor="#efefef" > <? if($_REQUEST['msg']=="loginfail"){echo "<tr><td colspan=3 align=center><font color='red'><br>"._ID_NOT_MATCH_."</font></td></tr>";}?> <? if($_REQUEST['msg']=="blocked"){echo "<tr><td colspan='2'><font color='red'>"._ACCOUNT_BLOCK_PL_CONTACT_ADMIN_."</font></td></tr>";}?> <? if($_REQUEST['msg']=="deactive"){echo "<tr><td colspan='2'><font color='red'>"._ACCOUNT_DEACTIVATED_."</font></td></tr>";}?> <? if($_REQUEST['msg']=="deactiveblock"){echo "<tr><td colspan='2'><font color='red'>"._ACCOUNT_DEACTIVATED_BLOCKED_."</font></td></tr>";}?> <tr> <td class="normaltextblack" colspan="2"><br /><?=_EMAIL_?></td> </tr> <tr> <td colspan="2" valign="top"><input type="text" name="email" class="whiteselect" size="30" onFocus="if(this.value=='USERNAME'){this.value='';}" onBlur="if(this.value==''){this.value='USERNAME';}" style="width:110px; height:20px"/></td> </tr> <tr height="20px"> <td colspan="2" class="normaltextblack" valign="bottom"><?= _PASSWORD_?></td> </tr> <tr> <td colspan="2"><input type="password" name="Password" class="whiteselect" size="30" onFocus="if(this.value=='PASSWORD'){this.value='';}" onBlur="if(this.value==''){this.value='PASSWORD';}" style="width:110px; height:20px" /></td> </tr> <tr><td width="131"> </td></tr> <tr> <td colspan="2"><input type="submit" class="inputsubmit" value="<?=_LOGIN_?>" name="submit" size="30" /> <input type="button" value="<?=_REGISTER_?>" name="register" class="inputsubmit" onClick="window.location.href='register.php'" /></td> </tr> <tr><td> </td></tr> </table> </form> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"> <div style="margin-top:3px"><a href="setlanguage.php?lang=en"><img src="img/ukflag.jpg" alt="uk flag" border="0" /></a> <a href="setlanguage.php?lang=cn"> <img src="img/taiwanflag.jpg" alt="taiwan flag" border="0"/></a></div> <br> <? /*include("flyer_show.php")*/?> </td> </tr> </table> </td> <td valign="top" width="667px"><table width="100%" border="0" background="img/tdbackbar620p.png" style="border-collapse:collapse" > <tr> <td valign="top"><br /> <table width="70%" align="center" border="1" style="border-collapse:collapse" bordercolor="#3B5998" bgcolor="#FFFFFF"> <tr><td> <form name="frm1" action="" method="post"> <table width="100%" align="center" border="0" style="border-collapse:collapse; border-color:#3B5998" bgcolor="#FFFFFF"> <tr> <td colspan="3"><br /><div align="center"><strong class="home-title"><?=_LOST_PWD_?> </strong></div><br /> </td> </tr> <tr><td colspan="3" class="normaltextblack"><p align="center"><?=_IF_U_HV_LST_UR_PWD_CLK_RST_?></p> </td> </tr> <tr><td width="29%"><div align="right"><b class="normaltext"><?=_UR_MAIL_ADR_?><br /> <br /> </b></div></td> <td colspan="2"> <input type="text" name="email" size="30" class="whiteselect" style="height:20px"/> <br /></td> </tr> <tr><td> </td> <td width="27%"><div align="right"><br /> <input type="submit" value="<?=_RESET_?>" name="submit" class="inputsubmit"/> </div></td> <td width="44%"><div align="left"><br /> <input type="button" value="<?=_CANCEL_?>" name="cancel" class="inputsubmit" onClick="javascript:window.location='index.php'" /> </div></td></tr> </table> </form> </td></tr></table><br /> <br /> </td> </tr> </table> </td> </tr> <tr><td></td><td valign="top"> <? include("nf.php");?><br> <? include("banner_inc.php");?> <div align="center"><?=bannerBottom(6)?></div><br> </td></tr> </table> </td> </table> </body> </html> Thanks loads! MOD EDIT: use ... [/CODE] tags
  3. Hey I have it working now! ... but there is one more thing I want to add, and for some reason I'm unable to :S For the first question I want to create the array using your script, but then when all the questions have finished I wanted the script to say complete. I changed the else statment when checking for the session variable, so that if there is no array present, "Complete" would be echoed <?php session_start(); if (isset($_SESSION['q']) and count($_SESSION['q']) > 0) $q = $_SESSION['q']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Quiz</title> </head> <body> <?php else echo "Complete"; $answer = $_POST['answer']; $correct = $_POST['correct']; $question = $_POST['question']; $questions = 5; //number of questions $nq = array_rand($q,1); $nextq = $q[$nq]; //rand(1,$questions); unset($q[$nq]); $_SESSION['q'] = $q; $nextqn = $question + 1; //$newarray = array_splice($arr, array_search($nextq, $arr), 1); if($answer == $correct) echo "<font color=green>CORRECT</font><br><form action=bq" . $nextq . ".php method=post> <input type=hidden name=question value=" . $nextqn . "> <input type=submit name=Next value='Next Question'></form>"; else echo "INCORRECT<br><a href=index.php>Try again ...</a>"; ?> </body> </html> Could you tell me where I'm going wrong? I create the $q variable in an answer1.php which comes after the first question. The answer1.php script is identical to yours ... and the answer.php script that comes after each question other than the first has the same code as the above ... It would be awesome if you could help!
  4. Basiaclly the questions appeared randomly as usual ... but they still repeated themselves without running through all the questions ... The php all seemed to run ... just not in the right way ... I can't see why it shouldn't work ...?
  5. Thanks for the reply, it seems to be just what I need, although I can't get it to work! It's currently on the site: zimph.com/edu ... I used the exact script you gave me, and I can't see what is wrong with it, although it still doesn't seem to work ...
  6. Hi, I need some help with a script to do multiple choice questions I started with a script for a simple series of questions which worked that if you got the question wrong then you had to go back to the beginning and start again I then wanted to choose the questions at random from the selection using arrays so that the questions then come up in a different order each time. This is the script here. I have removed the array for the minute so that the script works Here is the question page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Quiz</title> </head> <body> <h1>Q<?php $question = $_POST['question']; echo $question; ?> </h1><br><b>What is the name of the gland below the adrenal glands?</b><br><br> <form method="post" action="answer.php"> <input type="radio" name="answer" value="1" />Thyroid<br> <input type="radio" name="answer" value="2" />pituitary<br> <input type="radio" name="answer" value="3" />pancreas<br> <input type="radio" name="answer" value="4" />ovary<br> <input type="radio" name="answer" value="5" />testis<br> <input type="hidden" name="correct" value="3" /> <input type="hidden" name="question" value=" <?php echo $question; ?>" /> <input type="Submit" name="submit" value="Submit" /> </form> </body> </html> Here is the page which processes the values sent from the question page ... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Quiz</title> </head> <body> <?php $answer = $_POST['answer']; $correct = $_POST['correct']; $question = $_POST['question']; $questions = 28; //number of questions $nextq = rand(1,$questions); $nextqn = $question + 1; $newarray = array_splice($arr, array_search($nextq, $arr), 1); if($answer == $correct) echo "<font color=green>CORRECT</font><br><form action=bq" . $nextq . ".php method=post> <input type=hidden name=question value=" . $nextqn . "> <input type=submit name=Next value='Next Question'></form>"; else echo "INCORRECT<br><a href=index.php>Try again ...</a>"; ?> </body> </html> see it posted at my site http://www.zimph.com/edu The next stage is where I am stuck. I want to not repeat the same question ie to take it the question out of the array so that it only comes up once in any sequence of questions. The idea is that it becomes a game to see how many questions you get right before you get the question wrong a bit like the impossible quiz if you know that. Someone from another forum gave me this script which takes the question out of the array but this is all on one page whereas I use mutiple pages. I am not clear how to integrate the two scripts to get what I want. Can you give me any direction on what to do next. Thanks for all the help I have already recieved, I have still not found an answer though!
  7. Can you tell me how I can interigate more than one question? I'm using this script to help me to revise for my GCSEs you see ... I'm 15 and I thought it would be a good idea as I have exams coming up ... Your script is almost what I need ... I just need some help understanding how to create more questions and also maybe mixing up the answers each time ... The last script you gave me was great ... but it doesn't do exactyl what I want it to do ... could you have one more go at it. Visit www.zimph.com/edu to check out the script I wrote already which uses multiple pages. The script I wrote is what I want, but I want to questiosn to only appear once and the answer order to be mixed up ... It would be great if you could once again help Cheers Ryan
  8. Thanks a huge amount for that! I'm almost there ... There's still one thing though ... How can I put more than one question in? It's multiple choice questiong that I want to integegate ... If I edit the forum and change the correct answer value I think it will work. But when the user gets A question wrong, I don't want them to have the chance to go back and correct their mistake
  9. All I need is a way to display the random number, so that I can redirect the person to the question. For example <?php $i = "random number which only shows once picked from array"; echo "<a href=http://www.zimph.com/edu/q". $i .".php>Next question</a>" ?>
  10. I still don't understand how you take the last page number out of the array ...?
  11. The problem is I need an individual page telling the user if they got the question right or wrong, if they get it wrong they should click try again and be redirected to the home page. I'll try and edit your script to see if I can get it to work like this! Thanks alot Ryan
  12. Hey, It's me again ... If you saw my other thread. I was going to send an array through a hidden input in a form as I wanted to have a load of questions randomly come after each other, but I didn't want one question to appear 2 times. People told me I should use sessions ... so this is what I did ... I still can't get it to work. I'm pretty inexperienced in PHP and I litterally learned about sessions then wrote this. There are errors I know, I just can;t fix them :S Here is the first answer page: answer1.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Quiz</title> </head> <body> <?php $answer = $_POST['answer']; $correct = $_POST['correct']; $question = $_POST['question']; $arr = array("1","2","3","4","5","6","7","8"); session_start(); $_SESSION['array'] = $arr; $random = array_rand($arr); $nextq = $arr[$random]; $nextqn = $question + 1; $newarray = array_splice($arr, array_search($nextq, $arr), 1); if($answer == $correct) echo "<font color=green>CORRECT</font><br><form action=q" . $nextq . ".php method=post> <input type=hidden name=question value=" . $nextqn . "> <input type=submit name=Next value='Next Question'></form>"; else echo "INCORRECT<br><a href=index.php>Try again ...</a>"; ?> </body> </html> That comes after the first question basiaclly. It creates the array. Here is answer.php which comes after all 10 or so of the next questions ... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Quiz</title> </head> <body> <?php $answer = $_POST['answer']; $correct = $_POST['correct']; $question = $_POST['question']; if(isset($_SESSION['array'])) $_SESSION['array'] = $arr; $random = array_rand($arr); $nextq = $arr[$random]; $nextqn = $question + 1; $newarray = array_splice($arr, array_search($nextq, $arr), 1); if($answer == $correct) echo "<font color=green>CORRECT</font><br><form action=q" . $nextq . ".php method=post> <input type=hidden name=question value=" . $nextqn . "> <input type=submit name=Next value='Next Question'></form>"; else echo "INCORRECT<br><a href=index.php>Try again ...</a>"; ?> </body> </html> The first thing I need help with is updating the session variable with "$newarray" and the second thing I need help with is debugging it. I would be very greatful if you could help me with this! Thanks Ryan
  13. Guys ... I've read up a bit on the session() function. could I litterally get my array by saying $_SESSION['array'] = $array?
  14. How can you carry arrays in sessions though? and I will need to edit the array being carried as people reach new pages ...
  15. I don't knwo how basiaclly ... that's the problem with that :S
×
×
  • 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.