Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

php code


  • Please log in to reply

#1
G!RL

G!RL

    New Member

  • Member
  • Pip
  • 7 posts
Create a form that makes the user guess a number. Give the form user 5 trials only.
  • 0

Advertisements


#2
mpfeif101

mpfeif101

    Member 1K

  • Retired Staff
  • 1,411 posts
You would have to make a form, then make a random number using rand().

If the number = rand, then they win, if not, then you autoincrement a variable. make it so if the variable > the number of choices they can have they lose.

- Matt
  • 0

#3
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 875 posts
This does not answer your question, but here's code to see if one's web site can run php code. Send the following to your site as a htm file, then run it. THis will also test browsers for the current version of javascript running.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Web Site Test for PHP</title>
</script>
</head>

<body>




<?php
$testString = " YES ";
?>

<p align="center">
<table border="10" width="400">
<tr>
<td>&nbsp;</td>
<td>FOUND?</td>
</tr>
<tr>
<td>Javascript 1.1</td>
<td>&nbsp;
<script LANGUAGE="JavaScript1.1">
document.write("YES");
</script>
</td>
</tr>
<tr>
<td>Javascript 1.2</td>
<td>&nbsp;
<script LANGUAGE="JavaScript1.2">
document.write("YES");
</script>
</td>
</tr>
<tr>
<td>Javascript 1.3</td>
<td>&nbsp;
<script LANGUAGE="JavaScript1.3">
document.write("YES");
</script>
</td>
</tr>
<tr>
<td>PHP</td>
<td>&nbsp;

<?php
echo "$testString ";
?>
</td>
</tr>
</table>
<br><br>
<a href="index.htm">HOME</a>
</p>

</body>
</html>
  • 0

#4
mpfeif101

mpfeif101

    Member 1K

  • Retired Staff
  • 1,411 posts
or just...

<?php phpinfo(); ?>
  • 0

#5
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 875 posts
or just ...

<?php phpinfo(); ?>

even better!
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP