Go Back   CodingForums.com > Web Projects and Services Marketplace > Web Projects > Small projects (quick fixes and changes)

Notices

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-28-2010, 06:42 AM   PM User | #1
facarroll
New to the CF scene

 
Join Date: Aug 2010
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
facarroll is an unknown quantity at this point
Help me to develop php mysql website

1) Project Details: (be as specific as possible): My sit www.safetytestingonline.com is under development by me. Sometimes I need some help coding difficult scripts, for example, today I cannot post data from a variable length array and update the associated table. I am self taught, and quite new to php. Example of this problem. Can you see my problem?
PHP Code:
<?php
session_start
(); 
// Place Session variable 'recid' into local variable
    
$recid          $_SESSION['recid'];
    
$username    $_SESSION['name'];
    
$school    $_SESSION['college'];
//Connect to the database
include_once "demo_conn.php";
// Query members data from the database and organise it for display
$sql mysql_query("SELECT group1, group2, group3, group4, group5, group6 FROM members WHERE recid='$recid' LIMIT 1");
while(
$row mysql_fetch_array($sql)){
$group1 $row['group1'];
$group2 $row['group2'];
$group3 $row['group3'];
$group4 $row['group4'];
$group5 $row['group5'];
$group6 $row['group6'];
}
////////////////////////////////////
// Process the form 
if ($_POST['group1']) {
    
$snames $_POST['snames[]'];
    
$userGroup $_POST['group1'];
    
$userGroup $_POST['group2'];
    
$userGroup $_POST['group3'];
    
$userGroup $_POST['group4'];
    
$userGroup $_POST['group5'];
    
$userGroup $_POST['group6'];
    
$userGroup $_POST['group7'];
    
$sql mysql_query("UPDATE users SET userGroup='userGroup' WHERE recid='$recid' AND userId='$snames'"); 
    echo 
'Your group names have been updated.<br /><br />
To return to your editing page, <a href="member_account.php">click here</a>'
;
exit();
// close if posted
////////////////////////////////////
?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>Edit Your User Group Names</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>
<body>
<table align="center" cellpadding="8" cellspacing="8">
  <tr>
    <td width="100"></td>
    <td width="160"><div align="left"> <font size="-1">Select <?php echo "$group1"?> students.</font></div></td>
    <td width="10"></td>
    <td width="150"><font size="-1">Send students to ....&nbsp;&nbsp;</font><font color="#CC0000">&nbsp;</font></td>
    <td width="30"></td>
    <td width="190"><div align="left"><font size="-1"></font></div></td>
  </tr>
<?php
// Query member data from the database
$query1 mysql_query("SELECT userId FROM users WHERE managerId='".$recid."' AND userGroup='".$group1."' ORDER BY userId ASC");
while(
$row1 mysql_fetch_array($query1))
{
$firstGroup .=$row1['userId']. ' <input type="checkbox" name="snames[]" value="1" /> ' "&nbsp;&nbsp;&nbsp;&nbsp;<br /><br>";
}
?>
  <form method="post" enctype="multipart/form-data" action="send_stud_gp_test.php">
    <tr>
      <td>&nbsp;<br /></td>
    </tr>
    <tr>
      <td width="100"></td>
      <td width="160" style="text-align:right;"><?php echo $firstGroup;?></td>
      <td width="10"></td>
      <td width="150" style="text-align:left;">
          <input type="radio" name="group2" value="1" />
          &nbsp;&nbsp;&nbsp;<?php echo $group2?>
        <p>
          <input type="radio" name="group3" value="1" />
          &nbsp;&nbsp;&nbsp;<?php echo $group3?>
        <p>
          <input type="radio" name="group4" value="1" />
          &nbsp;&nbsp;&nbsp;<?php echo $group4?>
        <p>
          <input type="radio" name="group5" value="1" />
          &nbsp;&nbsp;&nbsp;<?php echo $group5?>
        <p>
          <input type="radio" name="group6" value="1" />
          &nbsp;&nbsp;&nbsp;<?php echo $group6?>
        <p>
          <input type="radio" name="group7" value="1" />
          &nbsp;&nbsp;&nbsp;Deactivate student.
        <p>
          <input type="submit" value="submit" name="Send Data">
  </form>
        </td>  
    </tr>  
</table>
</body>
</html>
2) Payment Amount: Negotiable, and realistic.

3) Payment method/ details (Paypal, check? Timeline?): Bank transfer or PayPay on satisfactory completion of each piece of work.

4) Additional Info (about project or potential bidders): Ask me. Contact details on website.
facarroll is offline   Reply With Quote
Old 08-28-2010, 07:52 PM   PM User | #2
Developr
New Coder

 
Join Date: Mar 2009
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Developr has a little shameless behaviour in the past
Are you looking for someone to fix the problem in the code you posted alone or is the problem throughout the script?
Developr is offline   Reply With Quote
Old 08-30-2010, 07:56 AM   PM User | #3
phpdevelopers
New Coder

 
Join Date: Aug 2010
Location: India
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
phpdevelopers is an unknown quantity at this point
Send me more details about your project at info[at]addonsolutions[dot]com.
phpdevelopers is offline   Reply With Quote
Old 09-02-2010, 04:56 AM   PM User | #4
sujithpr
New Coder

 
Join Date: Aug 2009
Location: Cochin,India
Posts: 39
Thanks: 2
Thanked 1 Time in 1 Post
sujithpr is an unknown quantity at this point
I can help you with this work
sujithpr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:29 AM.


Advertisement
Log in to turn off these ads.