I have a login page which sets a _SESSION parameter of 'id' upon login. After logging in the user is redirected to the index.php page and at this point the session parameter is still set, I know this because I can print it with PHP. However, when navigating to the account.php page the parameter is lost and I am not sure why.
Most of the other questions asked on here regarding this are because of the session_start not being used but I have used this on the account.php page.
Any help in resolving this would be grateful.
The code for the account.php page is below:
<?php session_start(); ?>
<?php
$con=mysqli_connect("localhost","tkernick96","Tylerkernick1996","users");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$id = $_SESSSION['id'];
$query = mysqli_query($con,"SELECT * FROM users WHERE id = $id");
$row = mysqli_fetch_array($query,MYSQLI_ASSOC);
$firstname = $row ['firstname'];
$lastname = $row ['lastname'];
$email = $row ['email'];
$age = $row ['age'];
$nationality = $row ['nationality'];
$language1 = $row ['language1'];
$language2 = $row ['language2'];
$language3 = $row ['language3'];
$language4 = $row ['language4'];
$language5 = $row ['language5'];
$form = "<div id='header'>
<img src='logo.png' id='logo'>
<div id='headerdiv'>
<table id='login'>
<tr>
<td style='padding-right: 20px;'>
<h2 style='margin-top: 0px'>No account?</h2>
<h3 style='margin-top: 0px'><a href='signup.php'>Sign Up Now!</a></h3>
</td>
<td style='padding-left: 20px; border-left: 1px solid #838383'>
<h3>Login:</h3>
<form method='post' action='login.php'>
<input id='logininput' type='email' name='email' placeholder='Email'>
<br>
<input id='logininput' type='password' name='password' placeholder='Password'>
<input type='submit' name='login' value='Login'>
</form>
<p id='p1'><a href='forgotdetails.php'>Forgotten Details?</a></p>
</td>
</tr>
</table>
</div>
</div>";
$account = "<div id='header'>
<img src='logo.png' id='logo'>
<div id='headerdiv'>
<table id='accounttable'>
<tr>
<td id='account'>
<p id='p2'><a href='account.php'>My Account</a></p>
<p id='p2'><a href='account/companions.php'>My Companions</a></p>
<p id='p2'><a href='account/messages.php'>Messages(".$messages.")</a></p>
<p id='p2'><a href='logout.php'>Sign Out</a></p>
</td>
</tr>
</table>
</div>
</div>
<table id='profiletable'>
<tr>
<td id='profiletabletd1' rowspan='2'>
<img src='images/avatar.png' id='profileimage'>
</td
<td id='profiletabletd1'><p id='profilename'>".$firstname." ".$lastname.", ".$age."</p></td>
</tr>
<tr>
<td id='profiletabletd3'><p id='profileinfo'>Nationality: <b>".$nationality."</b>     Languages Spoken: <b>".$language1." ".$language2." ".$language3." ".$language4." ".$language5."</b></p></td>
</tr>
</table>
";
if ($id == "") {
$output = $form;
}
else {
$output = $account;
}
mysqli_close($con);
?>
index.php:
<?php session_start(); ?>
<?php
$con=mysqli_connect("localhost","tkernick96","Tylerkernick1996","users");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$id = $_SESSION['id'];
$form = "<table id='login'>
<tr>
<td style='padding-right: 20px;'>
<h2 style='margin-top: 0px'>No account?</h2>
<h3 style='margin-top: 0px'><a href='signup.php'>Sign Up Now!</a></h3>
</td>
<td style='padding-left: 20px; border-left: 1px solid #838383'>
<h3>Login:</h3>
<form method='post' action='login.php'>
<input id='logininput' type='email' name='email' placeholder='Email'>
<br>
<input id='logininput' type='password' name='password' placeholder='Password'>
<input type='submit' name='login' value='Login'>
</form>
<p id='p1'><a href='forgotdetails.php'>Forgotten Details?</a></p>
</td>
</tr>
</table>";
$account = "<table id='accounttable'>
<tr>
<td id='account'>
<p id='p2'><a href='account.php'>My Account</a></p>
<p id='p2'><a href='account/companions.php'>My Companions</a></p>
<p id='p2'><a href='account/messages.php'>Messages($messages) </a></p>
<p id='p2'><a href='logout.php'>Sign Out</a></p>
</td>
</tr>
</table>";
if ($id == "") {
$output = $form;
}
else {
$output = $account;
}
mysqli_close($con);
?>
it should be $_SESSION not $_SESSSION!
you should see a warning with the right error reporting level, e.g.
error_reporting(E_ALL);
Are you using IIS?
If it is, you should check the php.ini file (under c:\php or in c:\windows), find the session.save_path parameter, and be sure that points to a folder that exists.
Then edit the rights of that folder and give read/write permissions to the IUSR user.
If you're using Apache, you should find the user that is starting the daemon (you can find this in /etc/apache2/apache.conf), then be sure that that user have r/w permissions in the folder that php.ini session.save_path points.
Restart the IIS or Apache after that.
Hope it helps.
Related
I am currently building eCommerce site using CI HMVC method. I completed it for computer design and all back-end. It work perfectly. But my dessign is terrible for mobile so i decided to write jquery mobile code. I almost complete the code in jquery mobile but i got i problem which i cannot solve.
I have the form which is use to add the item into the cart. For this i have add to cart function which has view file add_to_Cart.php whis has actual form. After submitting form goes to store_basket/add_to_basket function. Here i writ code to sore the comming information to store_basket table. Then it redirect the page to another controller cart where i have view file of list of items which is in cart.
when i submit the form it store item in store_basketm table. Then it show the view of cart controller but the url is localhost/shop/store_basket/add_to_basket Which should be localhost/shop/cart. But despite of url localhost/shop/store_basket/add_to_basket it show the contents of localhost/shop/cart
<?php $form_location = base_url().'store_basket/add_to_basket'; ?>
<div id="cart" style="background-color: #ddd; border-spacing: 7px; padding: 7px; color: black;">
<form ajax-date="false" data-url="true" action="<?= $form_location ?>" method="POST">
<table class="table">
<tr>
<td>ID: </td>
<td><?php echo $item_id ?></td>
</tr>
<input type="hidden" name="item_id" value="<?php echo $item_id ?>">
<input type="hidden" name="item_title" value="<?php echo $item_title ?>">
<?php if($num_colour > 0): ?>
<tr>
<td style="padding-top: 20px;">Colour: </td>
<td style="margin-left: 50px;">
<?php
$status = '';
$additional_dd_code = 'name="select-choice-mini" id="select-choice-mini" data-mini="true" data-inline="true"';
echo form_dropdown('item_colour', $colour_options, $submitted_colour, $additional_dd_code);
?>
</td>
</tr>
<?php endif; ?>
<?php if($num_size > 0): ?>
<tr>
<td style="padding-top: 20px;">Size: </td>
<td style="margin-left: 50px;">
<?php
$status = '';
$additional_dd_code = 'name="select-choice-mini" id="select-choice-mini" data-mini="true" data-inline="true" style="background-color: white;"';
echo form_dropdown('item_size', $size_options, $submitted_size, $additional_dd_code);
?>
</td>
</tr>
<?php endif; ?>
<tr>
<td>Price: </td>
<td><?= $item_price ?></td>
</tr>
<input type="hidden" name="price" value="<?= $item_price ?>">
<tr>
<td style="padding-top: 20px;">Qty: </td>
<td>
<input type="number" name="item_qty" value="1" min="1" required>
</td>
</tr>
</table>
<!-- <a rel="external" href=""><input name="submit" value="Submit" class="btn"></a> -->
<button type="submit" name="submit" value="Submit" id="cart-btn" class="ui-shadow ui-btn ui-corner-all" style="margin-top: 20px; width: 75%; margin-left: 30px;"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add To Basket</button>
<?php echo form_close() ?>
store_basket/add_to_basket
function add_to_basket() {
// var_dump($_POST); exit;
$this->load->module('site_settings');
$this->load->library('session');
$this->load->module('site_security');
$is_mobile = $this->site_settings->is_mobile_device();
$submit = $this->input->post('submit', TRUE);
if($submit == "Submit"){
//library for form validation
$this->load->library('form_validation');
//validation rules
$this->form_validation->set_rules('item_colour', 'Item Color', 'numeric');
$this->form_validation->set_rules('item_size', 'Item Size', 'numeric');
$this->form_validation->set_rules('item_qty', 'quantity', 'required|numeric');
$this->form_validation->set_rules('item_id', 'Item_id', 'required|numeric');
if($this->form_validation->run($this)) {
// echo "Success"; exit;
$data = $this->_fetch_the_data();
$this->_insert($data);
redirect('cart');
} else {
// echo "Fail"; exit;
$refer_url = $_SERVER['HTTP_REFERER'];
$error_msg = validation_errors("<p style='color: red;'>","</p>");
$this->session->set_flashdata('item', $error_msg);
redirect('cart');
}
}
}
cart/index.php
function index() {
// echo "here"; exit;
$this->load->module('site_settings');
$is_mobile = $this->site_settings->is_mobile_device();
$data['flash'] = $this->session->flashdata('item');
$data['view_files'] = "cart";
if($is_mobile==TRUE) {
$data['view_files'] .= "_jqm";
$template = 'public_jqm';
} else {
$template = 'public_boostrap';
}
$token = $this->uri->segment(3);
if($token!='') {
$session_id = $this->_check_and_get_session_id($token);
} else {
$session_id = $this->session->session_id;
}
$this->load->module('site_security');
$shopper_id = $this->site_security->_get_user_id();
if(!is_numeric($shopper_id)) {
$shopper_id = 0;
}
$table = 'store_basket';
$data['query'] = $this->_fetch_cart_contents($session_id, $shopper_id, $table);
//count the items in basket or cart
$data['num_rows'] = $data['query']->num_rows();
$data['showing_statement'] = $this->_get_showing_statement($data['num_rows']);
$this->load->module('templates');
$this->templates->$template($data);
}
Hi everyone i need some help regarding this error. Im trying to create a module that will allow users to upload their image and display it to the other page. I am using 3 forms (index.php for displaying, create.php for sql query and addform.php for adding records). But everytime I run the program it always shows an error: Undefined index: file_img
index.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="assets/jquery-1.11.3-jquery.min.js"> </script>
</head>
<body>
<div class="container">
<h2 class="form-signin-heading">Employee Records.</h2><hr />
<button class="btn btn-info" type="button" id="btn-add"> <span class="glyphicon glyphicon-pencil"></span> Add Employee</button>
<button class="btn btn-info" type="button" id="btn-view"> <span class="glyphicon glyphicon-eye-open"></span> View Employee</button>
<hr />
<div class="content-loader">
<table cellspacing="0" width="100%" id="example" class="table table-striped table-hover table-responsive">
<thead>
<tr>
<th>Title</th>
<th>Content</th>
<th>Photos</th>
</tr>
</thead>
<?php
require_once 'dbconfig.php';
$sql = $db_con->prepare("select id, name, content, imgname from tblkeanu");
$sql->execute();
while($result=$sql->fetch(PDO::FETCH_ASSOC))
{
echo '<tr>';
echo '<td>' . $result["name"] . '</td>';
echo '<td>' . $result["content"] . '</td>';
echo "<td><img src = 'images/" . $result['imgname'] . "' height='350px;' width='300px;' class='img'></td>";
echo "<td><a id = $result[id] class = 'edit_link' href='#' title = 'EDIT'> EDIT </a></td>";
echo "<td><a id = $result[id] class = 'delete_link' href='#' title = 'DELETE'> DELETE </a></td>";
echo ' </td>';
echo '</tr>';
}
?>
</table>
</div>
</div>
<br />
<div class="container">
<div class="alert alert-info">
Tutorial Link
</div>
</div>
</body>
</html>
create.php
<?php
require_once 'dbconfig.php';
if($_POST)
{
$name = $_POST['txtname'];
$content = $_POST['txtcontent'];
$filetmp = $_FILES['file_img']['tmp_name'];
$filename1 = $_FILES['file_img']['name'];
$filetype = $_FILES['file_img']['type'];
$filepath = 'images/'.$filename1;
try{
move_uploaded_file($filetmp,$filepath);
$sql = $db_con->prepare("INSERT INTO `tblkeanu`(`name`, `content`, `imgname`, `imgpath`, `imgtype`) Values (:name,:content,:filename1,:filepath,:filetype)");
$sql->bindParam(":name",$name);
$sql->bindParam(":content",$content);
$sql->bindParam(":filename1",$filename1);
$sql->bindParam(":filetype",$filetype);
$sql->bindParam(":filepath",$filepath);
if($sql->execute())
{
echo "Successfully Added";
}
else{
echo "Query Problem";
}
}
catch(PDOException $e){
echo $e->getMessage();
}
}
?>
addform.php
<form method='post' id='emp-SaveForm' action="#" enctype="multipart/form-data">
<table class='table table-bordered'>
<tr>
<td>Title</td>
<td><input type='text' name='txtname' class='form-control' placeholder='EX : john doe' required /></td>
</tr>
<tr>
<td>Content</td>
<td><input type='text' name='txtcontent' class='form-control' placeholder='EX : Web Design, App Design' required></td>
</tr>
<tr>
<td>Photo</td>
<td><input type='file' name='file_img'/></td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-primary" name="btn-save" id="btn-save">
<span class="glyphicon glyphicon-plus"></span> Save this Record
</button>
</td>
</tr>
</table>
The tricky part here is if i combined the addform.php to create.php and address bar is "..../..../create.php" the program runs smoothly and the input type was identified. but i need these 2 to be separated and not combined on one page so the webpage will not be refreshed everytime because im also using a javascript and jquery and the address should only be "..../..../index.php".
It will be much appreciated if you could help me out.
In your addform.php file the form dosen't have an action yet, The form action should be create.php.
In the create.php file the condition:
if($sql->execute())
{
echo "Successfully Added";
}
else{
echo "Query Problem";
}
Should be modified as :
if($sql->execute())
{
header("Location: index.php");
}
else{
echo "Query Problem";
}
This way after saving the records to the database you will be redirected to index.php .
**IN This Section **
<tr>
<td>Photo</td>
<td><input type='file' name='file_img'/></td>
</tr>
Please try this edit, It may help..
<tr>
<td>Photo</td>
<td><input type='file' name='file_img' accept='image/*'/></td>
</tr>
I'm having trouble setting up some css code for a table I'm generating using php from a database. I want every even row to have a different background-color, so I tried using nth-child(even) for this, but it doesn't seem to work for some reason. Here's my code:
style.css:
#usertable {
border-collapse: collapse;
font-family: "Trebuchet MS", Arial;
}
#usertable td, #usertable th {
border: 1px solid black;
background-color: rgb(228,227,227);
padding: 8px;
}
#usertable tr:nth-child(odd){background-color: rgb(115,115,115);}
admin.php:
<table id="usertable">
<tr>
<th> Id: </th>
<th> Username: </th>
<th> Rights: </th>
</tr>
<?php
$userquery = "SELECT id, username, strength FROM users";
$result = $conn->query($userquery) or die($conn->error);
while ($row = $result->fetch_assoc()) { ?>
<tr>
<td> <?php echo $row['id']; ?> </td>
<td> <?php echo $row['username']; ?> </td>
<td>
<form method="post" action="">
<input type="number" min="0" max="255" name="newrights" value=" <?php echo $row['strength']; ?> ">
<input type="text" name="idnumber" hidden="true" value=" <?php echo $row['id']; ?> ">
<input type="text" name="usertochange" hidden="true" value=" <?php echo $row['username']; ?> ">
<input type="submit" value="Update">
</form>
</td>
</tr>
<?php
}
?>
</table>
There is some markup error with your code
<table id="usertable">
<tr> <!--Add this-->
<th> Id: </th>
<th> Username: </th>
<th> Rights: </th>
</tr> <!--Add this-->
<?php
$userquery = "SELECT id, username, strength FROM users";
$result = $conn->query($userquery) or die($conn->error);
while ($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row['id'] . "</td><td>" . $row['username'] . "</td><td>";
echo "<form method=\"post\" action=\"\">
<input type=\"number\" min=\"0\" max=\"255\" name=\"newrights\" value=\"" . $row['strength'] . "\">
<input type=\"text\" name=\"idnumber\" hidden=\"true\" value=\"" . $row['id'] . "\">
<input type=\"text\" name=\"usertochange\" hidden=\"true\" value=\"" . $row['username'] . "\">
<input type=\"submit\" value=\"Update\">
</form></td></tr>";
}
?>
Also looks like you have used many slaces so i suggest you to check table markup on browser
Updated: Add
#usertable td:nth-child(odd) { background-color: #efefef;}
Do not use tr as you have given background color to td and th initially
Why don't you sue some CSS class in each alternate table row?
Ex:
HTML
<tr class="bg-red">
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr class="bg-blue">
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
CSS
<style type="text/css">
.bg-blue{
background-color: blue;
}
.bg-red{
background-color: red;
}
</style>
I think this will simplify your code & make it easy to read.
Example for Dynamic Data
<?php
$users[] = array('fname'=>'Jill', 'lname'=>'Smith', 'age'=>50);
$users[] = array('fname'=>'Eve', 'lname'=>'Jackson', 'age'=>94);
$rowColClass = 'bg-blue';
foreach ($users as $key => $value)
{
echo "<tr class='$rowColClass'>";
echo "<td>$value[fname]</td>";
echo "<td>$value[lname]</td>";
echo "<td>$value[age]</td>";
echo "</tr>";
if($rowColClass == 'bg-blue')
$rowColClass = 'bg-red';
else
$rowColClass = 'bg-blue';
}
?>
I've created a form that is supposed to update table contents in input boxes, when the content of the input boxes are changed and submitted the database is supposed to update.
This is my first page:
<body>
<form action="qa1.php" method="post">
<ul>
<li><a class="active" href="df1.php">Disease</a></li>
<li><a href="drug.php" >Drug</a></li>
<li>Interaction</li>
Alternate Drug
</ul>
<?php
$query = "SELECT * FROM disease;";
$result = mysqli_query($dp, $query);
echo "<table border=5>
<tr>
<th>Select</th>
<th>Edit</th>
<th>Disease ID</th>
<th>Disease</th>
<th>Sub Disease</th>
<th>Associated Disease</th>
<th>Ethinicity</th>
<th>Source</th>
</tr>";
while($row = mysqli_fetch_assoc($result)) {
echo "<tr>";
echo "<td><input type='radio' name='select' value=".$row['Disease_id']."/> </td>";
echo "<td>".$row{'Disease_id'}."</td>";
echo "<td><a href='edit.php?Disease_id=".$row['Disease_id']."'>edit</a></td>";
echo "<td>".$row{'Disease'}."</td>";
echo "<td>".$row{'SubDisease'}."</td>";
echo "<td>".$row{'Associated_Disease'}."</td>";
echo "<td>".$row{'Ethinicity'}."</td>";
echo "<td>".$row{'Source'}."</td>";
echo "</tr>";}
echo "</table>";
$selectedRow=$_POST['select'];
?>
<div>
<table border="0" align="center" style="border-spacing: 40px 30px;">
<caption><strong>QualityAnalysis:</br></br></strong></caption></br></br>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="4" WIDTH="40%">
</br><div><center>
<button style="color: red">Add</button>
<input type = 'submit' value = 'Delete' name = 'submitdelete' button style="color: red"></button>
<input type = 'submit' value = 'Update' name = 'submitupdate'>
</center></div> </TABLE>
</body>
</html>
This is my editing page: edit.php
<body>
<form action="edit.php" method="post">
<ul>
<li><a class="active" href="df1.php">Disease</a></li>
<li><a href="drug.php" >Drug</a></li>
<li>Interaction</li>
Alternate Drug
</ul>
<div>
<?php
$conn = mysqli_connect('localhost','root','','tool');
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_error());
}
if(isset($_GET['Disease_id']))
{
if(isset($_POST['Update']))
{
$id=$_GET['Disease_id'];
$name=$_POST['Ethinicity'];
$query3=mysqli_query("update disease set Ethinicity='$name', where Disease_id='$id'");
if($query3)
{
header('location:qa1.php');
}
}
$query1=mysqli_query("select * from disease where Disease_id='$id'");
$query2=mysqli_fetch_array($query1);
?>
<table border="2" align="center" style="border-spacing: 40px 30px;">
<caption><strong>Edit</br></br></strong></caption></br></br>
<tr>
<td>Ethinicity<input type="text" list="Ethinicity" name="Ethinicity" value="<?php echo $row['Ethinicity'];?>"/>
<input type="hidden" name="Disease_id" value="<?php echo $row['Disease_id']; ?>"/>
<input type="submit" name="Update" value ="Update">
<?php
}
?>
</center></div></div>
</form>
But Data is not getting updated in the database. Can anyone help me with this?
Firstly, mysqli_query requires the connection parameter.
Secondly, there's a syntax error with your UPDATE query, there isn't a need for a comma.
So, it should be:
$query3=mysqli_query($conn, "update disease set Ethinicity='$name' where Disease_id='$id'");
$query1=mysqli_query($conn, "select * from disease where Disease_id='$id'");
Also, if($query3) won't check if the row is successfully inserted, use mysqli_affected_rows instead.
I wanna check same exist database, but doesn't work the $check. What's wrong ı cannot find.
ı taking this error when post;
error 1-Members not added :(
Mysql error:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''459' at line 1
error 2- 459 memb_id already in databese, try again!
This is my code:
<?php
$row_data = array();
foreach($_POST['checkbox'] as $row=>$Name) {
$name=mysql_real_escape_string($Name);
$memb_id=mysql_real_escape_string($_POST['memb_id'][$row]);
$memb_srnm=mysql_real_escape_string($_POST['memb_srnm'][$row]);
$kur_id=mysql_real_escape_string($_POST['kur_id'][$row]);
$row_data = array("'$memb_id'", "'$memb_srnm'", "'$kur_id'");
}
if (!empty($row_data)) {
$check = mysql_query("SELECT * FROM basvurular WHERE memb_id='$memb_id");
if (mysql_affected_rows() ){
echo '<h4 class="alert_error"><strong>'.ss($memb_id).'</strong> already in databese, try again! </h4>';
header('Location: index.php');
} else {
$query = 'INSERT INTO basvurular (memb_id, memb_srnm, basvur_kurid) VALUES (' .implode(',', $row_data) . ')';
}
if (mysql_query($query)){
echo '<h4 class="alert_success"> <label style="color: blue; font-size: 26px; font-weight: bold;"><img style="width: 4%" src="images/pers2.png" alt=""/>-'.mysql_affected_rows().'- </label> Succesfull :) </h4>';
header('Location: index.php');
}else{
echo '<h4 class="alert_error">Members not added :( <br> Mysql Error:'.mysql_error().'</h4>';
return false;}
}
?>
<article class="module width_3_quarter" style="padding-bottom: 10px; width: 95%">
<header>
<div style="float:right;font-size:14px;font-weight: bold; padding:10px"></div>
<h3 class="tabs_involved">POST SELECTED</h3>
</header>
<div class="tab_container">
<?php
$query = query("SELECT * FROM members INNER JOIN kurumlar ON kurumlar.kur_id = members.kur_id WHERE kurumlar.kur_id=' ".$_SESSION["kur_id"]." ' && ceza=0 ORDER BY memb_id DESC");
if (mysql_affected_rows()){
?>
<div id="tab1" class="tab_content">
<?php echo '<form action="" method="post" name="frm" onsubmit="return check">
<table class="tablesorter" cellspacing="0"> '; ?>
<thead>
<tr>
<th><a style="text-decoration: none;font-size:14px;font-weight: bold; color: blue" href="javascript:void(0);" id="link" onclick="slct()">All Select</a></th>
<th align= "left" >ID Number</th> <th></th>
<th align= "left" >USER NAME</th><label style="padding-right: 10px;padding-bottom: 10px;float:right " ><input style="color: red" type="submit" name="post" value="Selected Post"></label>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ($row = row($query)){
?>
<tr>
<td><input type="checkbox" name="checkbox[]" id="checkbox[]" ></td>
<td><?php echo ss($row["membName"]);?></td><td><input name="memb_id[]" type="hidden" value="<?php echo ss($row["memb_id"]);?>"></td>
<td><?php echo ss($row["memb_srnm"]);?></td><td><input name="memb_srnm[]" type="hidden" value="<?php echo ss($row["memb_srnm"]);?>"></td>
<td><input name="kur_id[]" type="hidden" value="<?php echo ss($_SESSION["kur_id"]);?>"></td>
</tr>
<?php }?>
</tbody>
<?php echo '</table></form>'; ?>
</div>
<?php }else{ ?>
<h4 class="alert_warning">Nobody Here :(( </h4>
<?php }?>
</div>
</article>
You're missing a quote on this line:
$check = mysql_query("SELECT * FROM basvurular WHERE memb_id='$memb_id'");
Also, to check whether a SELECT query returned any rows, you should use mysql_num_rows(), not mysql_affected_rows() -- the latter is only for queries that modify tables.
You should also check that the query is successful:
$check = mysql_query("SELECT * FROM basvurular WHERE memb_id='$memb_id")
or die(mysql_error());