How does javascript handle numbers transmitted via POST?

Reply Sun 2 Aug, 2009 10:14 am
OK, this is for a puzzle/riddle site. You're supposed to figure out a string of numbers that solves an equation. The developer posted this hint:

You need to know that javascript don't handles numbers the same if they got transmittet via post.

  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 6,288 • Replies: 4
No top replies

Robert Gentel
Reply Thu 6 Aug, 2009 12:38 pm
Not sure what they mean by that, JavaScript doesn't have access to posted data without working around it. A POST goes to the server, which typically will then load a page. Unless the server-side code passes the number to the client the JavaScript shouldn't know anything at all about the post.
Reply Thu 6 Aug, 2009 01:03 pm
@Robert Gentel,
It's a webpage generated by php.

You enter numbers in text boxes, then click a submit button. It calls a javascript function, and runs a calculation

There isn't a way to solve it with integers 1-9, each integer entered once.

Here's the hint they gave:

You need to know that javascript don't handles numbers the same if they got transmittet via post.

Here's the page source:
Code:<!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">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>LOST-Chall / Left Behind</title>
<script type="text/javascript">
function EnterCode() {
var number1=document.challenge.number1.value;
var number2=document.challenge.number2.value;
var number3=document.challenge.number3.value;
var number4=document.challenge.number4.value;
var number5=document.challenge.number5.value;
var number6=document.challenge.number6.value;
var number7=document.challenge.number7.value;
var number8=document.challenge.number8.value;
var number9=document.challenge.number9.value;

var redcable=Math.sin(number1)+(number2*2);
if (redcable==15.243197504692072){
var bluecable=redcable+Math.pow(number3,number4);
var greencable=bluecable+redcable-number5+number6;
var blackcable=greencable+number7+number8-number9;
alert("Nice job!");

<link href="mm_travel2.css" rel="stylesheet" type="text/css" />
<table width="521" height="231" border="0" align="center">
<tr bgcolor="#000000">
<form name="challenge" method="post" action="left-behind.php">

<td width="539" height="227" valign="top" bgcolor="#000000"><h1 class="Stil1">Challenge S3E15</h1>
<h1 class="Stil1">Left Behind </h1>
<p class="Stil1">Enter the code. It's coming... </p>
<p class="Stil1">Put in the numbers in order you need to push them. Use the number 1-9.</p>
<p class="Stil1"><img src="pics/CodeJuliet.jpg" width="338" height="212" /></p>
<p class="Stil2">Solution:</p>

<input type="text" size="3" name="number1" class="solution" />
<input type="text" size="3" name="number2" class="solution" />
<input type="text" size="3" name="number3" class="solution" />
<input type="text" size="3" name="number4" class="solution" />
<input type="text" size="3" name="number5" class="solution" />
<input type="text" size="3" name="number6" class="solution" />

<input type="text" size="3" name="number7" class="solution" />
<input type="text" size="3" name="number8" class="solution" />
<input type="text" size="3" name="number9" class="solution" />
<input type="submit" name="submit" value="submit" onClick="EnterCode()" class="button" />

<p align="center" class="Stil1"><a href="index.php"><img src="pics/bbbg.jpg" border="0" /></a></p>
Robert Gentel
Reply Thu 6 Aug, 2009 01:31 pm
Have you tried disabling JavaScript and submitting? I found the site, and loaded up the missing css and images from the code you posted, but when I try it myself it just goes to the home page (not sure if I need to be logged in).
Reply Thu 6 Aug, 2009 02:31 pm
@Robert Gentel,
Problem is that the math doesn't add up....

Maybe I'm just missing something.

Thanks for your help.
0 Replies

Related Topics

  1. Forums
  2. » How does javascript handle numbers transmitted via POST?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/21/2024 at 01:03:06