Jump to content

Session problems or something else


Recommended Posts

I have a users page that has this in it:

[code=php:0]function GetRandomChar() {
$IMGVER_RandVal = mt_rand(1,3);

switch ($IMGVER_RandVal) {
case 1:
$IMGVER_RandVal = mt_rand(97, 122);
case 2:
$IMGVER_RandVal = mt_rand(48, 57);
case 3:
$IMGVER_RandVal = mt_rand(65, 90);
return chr($IMGVER_RandVal);
function register_form(){
        global $db, $prefix, $name, $email, $username, $password, $user_taken_err, $email_taken_err, $name_taken_err, $type;
if($type == "f"){
$nameout = "Your";
}elseif($type == "b"){
$nameout = "Band";
$nameout = "Your";
$type = "f";



for ($i = 1; $i <= 6; $i++) {
  $IMGVER_TempString .= GetRandomChar();


echo "<div style=\"text-align:center;\"><span class=\"title\">Registration form</span><br />";
echo "Fields marked with a * are required.
      <form id=\"RegisterForm\" method=\"post\" action=\"users.php\">
      <table style=\"margin:0 auto;width:400px;\" border=\"0\" id=\"table1\" cellpadding=\"2\">
<td style=\"text-align:right;width:50%;\">$nameout Name:</td>
<td style=\"text-align:left;width:50%;\"><input type=\"text\" name=\"name\" size=\"20\" value=\"$name\" /> * $name_taken_err</td>
  <td style=\"text-align:right;\">E-Mail:</td>
  <td style=\"text-align:left;\"><input type=\"text\" name=\"email\" size=\"20\" value=\"$email\" /> * $email_taken_err</td>
  <td style=\"text-align:right;\">&nbsp;</td>
<td style=\"text-align:right;\">Username:</td>
<td style=\"text-align:left;\"><input type=\"text\" name=\"username\" size=\"18\" value=\"$username\" /> * $user_taken_err</td>
<td style=\"text-align:right;\">Password:</td>
<td style=\"text-align:left;\"><input type=\"password\" name=\"password\" size=\"18\" value=\"$password\" /> *</td>
  <td align=\"right\">Verify Image:</td>
  <td align=\"left\"><img src=\"doimg.php?"; echo SID."\" /><br /><input name=\"verify\" type=\"text\" id=\"verify\"></td>
<td><input type=\"submit\" value=\"Register\" />
<input type=\"hidden\" name=\"cmg\" value=\"do_Register\" />
<input type=\"hidden\" name=\"type\" value=\"$type\" /></td>
</table></form>[ <a href=\"users.php\" title=\"Back\">Back</a> ]</div>";

here is doimg.php

$IMGVER_IMAGE = imagecreate(150,40);

$IMGVER_COLOR_BLACK = imagecolorallocate ($IMGVER_IMAGE, 0, 0, 0);
$IMGVER_COLOR_WHITE = imagecolorallocate ($IMGVER_IMAGE, 255, 255, 255);



imagechar($IMGVER_IMAGE, 4, 20, 13, $IMGVER_RandomText[0] ,$IMGVER_COLOR_WHITE);
imagechar($IMGVER_IMAGE, 5, 40, 13, $IMGVER_RandomText[1] ,$IMGVER_COLOR_WHITE);
imagechar($IMGVER_IMAGE, 3, 60, 13, $IMGVER_RandomText[2] ,$IMGVER_COLOR_WHITE);
imagechar($IMGVER_IMAGE, 4, 80, 13, $IMGVER_RandomText[3] ,$IMGVER_COLOR_WHITE);
imagechar($IMGVER_IMAGE, 5, 100, 13, $IMGVER_RandomText[4] ,$IMGVER_COLOR_WHITE);
imagechar($IMGVER_IMAGE, 3, 120, 13, $IMGVER_RandomText[5] ,$IMGVER_COLOR_WHITE);

header("Content-type: image/jpeg");

I have used this same thing on a contact page and it works fine. When I go to register now there is just a blank black box. When I go to the contact page, that image loads fine, when I go back to register the same code appears as the contact page I was just on.

Am I missing something? Do you need any other code to look at?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.