Jump to content

mehdi4467

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mehdi4467's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Dear All, I want know in end of a php file the value of a tag is erased? or save?
  2. <?php if(isset($_POST['add'])) { send_game(); } ?> <form action='' method='post'> <input name='filter' type='submit' id='filter' value='تائيد' /> <select dir="ltr" name="week"> <option value="1">هفته اول</option> <option value="2">هفته دوم</option> <option value="3">هفته سوم</option> <option value="4">هفته چهارم</option> <option value="5">هفته پنجم</option> </select> فيلتر هفته </form> <?php $week = get_param($_POST, "week"); <?php $result = $db->sql_query("SELECT * FROM `billing_game` WHERE `game_week`='$week'" ); while($show_result=$db->sql_fetcharray($result)) { $result2 = $db->sql_query("SELECT * FROM `billing_results` WHERE (`results_gameid`='{$show_result['game_id']}') AND (`results_userid`='{$_SESSION['SUB_USER_ID']}')"); $show_result2=mysql_num_rows($result2); if($show_result2 != 0 ) { $result1 = $db->sql_query("SELECT * FROM `billing_results` WHERE (`results_gameid`='{$show_result['game_id']}') AND (`results_userid`='{$_SESSION['SUB_USER_ID']}')"); $show_result1=$db->sql_fetcharray($result1); $re_ft = $show_result1['results_firstteam']; $re_st = $show_result1['results_secondteam']; $status ="$re_st-$re_ft"; } else { $g=$show_result['game_id']; $status = " <form action='' method='post'> <input name='add' type='submit' id='add' value='ثبت' /> <input name='second_results' type='text' class='results_user_input_text ' id='second_results' /> <input name='first_results' type='text' class='results_user_input_text ' id='first_resultse' /> <input type='hidden' name='game_id' value='$g' /> </form> "; } } echo $msg function send_game() { global $db; $first_results = get_param($_POST, "first_results"); $second_results = get_param($_POST, "second_results"); $game_id = get_param($_POST, "game_id"); if($first_results == "") { $GLOBALS['msg'] = "<font color=red>نتيجه ميزبان وارد نشده است</font>"; } elseif($second_results == "") { $GLOBALS['msg'] = "<font color=red>نتيجه ميهمان وارد نشده است.</font>"; } else { if($db->sql_query("INSERT INTO `billing_results` VALUES (null,'$game_id', '{$_SESSION['SUB_USER_ID']}', '$first_results', '$second_results', '1')")) { $GLOBALS['msg'] = "<font color=green>اطلاعات با موفقیت ارسال شد</font>"; } else { $GLOBALS['msg'] = "<font color=red>اطلاعات ارسال نشد</font>"; } } } ?> the value of $week lost. and I delete some html code from my code for better understanding.
  3. hi in a php file I assign a value to a tag. and with it make a condition for mysql command. but when run query and then using a form for sending some values to a function, all thin is work , but the vale of tag erased. when i trying to define this tag as global I see below errors. Parse error: parse error, unexpected '=', expecting ',' or ';' in C:\Apache2\htdocs\bill\desktop\send_game.php on line 64
×
×
  • 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.