Jump to content

J.Daniels

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Everything posted by J.Daniels

  1. chmod -R will recursively set the directory and all files below
  2. You should var_dump the array variable to make sure it is correctly populated.
  3. Try this: $ttarget2 = $ttarget1 . $_SESSION['id'] . 'jpg';
  4. Try to echo out $r['Content'] to see if the string is in there and how it is displayed.
  5. Check if it selected the database: $db = mysql_select_db("zoka_3628910_messages",$con) or die('Error: '.mysql_error());
  6. The variables aren't consistent in your example, but here is a possible solution to what you are trying to do: $lastname = array('Smith', 'Jones', 'Anderson'); $Smith = array('Answer 1', 'Answer 2', 'Answer 3'); foreach($lastname as $staffmember) { $sm = $$staffmember; echo "Question 1: " . $sm['0'] . "<br> Question 2: " . $sm['1']; }
  7. Are you selecting a database in db.php?? mysql_select_db()
  8. PHP is a server side language, so it cannot modify anything after the page has been loaded. If you do not want to use javascript, there are probably a few ways: Using a form: <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <input type="button"> </form> Using a link and styling it to look like a button: <a href="<?php echo $_SERVER['PHP_SELF']?>">Refresh</a>
  9. Here is one way that might work: <!-- css --> <style type="text/css"> right { float: right; width: 50%; } </style> <!-- html --> <div id="container"> <div id="left"> <div id="right"> <!-- right content --> </div> <!-- left content --> </div> </div>
  10. if ($u_row[char_mnu]=1){ and else if($u_row[char_mnu]=0){ are assigning values, which will always return true (which is why haku wanted to you echo them out) They need to be changed to: if ($u_row[char_mnu]==1){ and else if($u_row[char_mnu]==0){
  11. There are a few distro choosers online that will ask a few questions and try to match a distro to your needs. For example: http://www.zegeniestudios.net/ldc/ To test your pages on different platforms: IE - ies4linux (requires wine) Safari - Konqueror uses the same web engine Firefox - Native Support Image Manipulation: Photoshop - GIMP - Native image manipulation program
  12. Do you have SSH access on the server??
  13. Yes. A primary can consist of one or more columns. If you are using MySQL, there is the REPLACE function that works like an INSERT, but if the PRIMARY KEY(S) exist, it will DELETE then INSERT the new record.
  14. When I mentioned that a field should contain one value, I meant that it should represent one value. You are correct that you can concatenate several values into one string and parse it out later, but the theory behind a relational database is that one row equates to one record or transaction. I'm not sure what the difference in efficiency of the two methods would be (one linking table or one table for each user), however, the "best practice" would be to use the linking table. This way, you do not need to create a new table for each new user, and the linking table can be keyed. If each user were to perform the task only once, you can set the primary key to (UID, TID) as they would be unique in the table. If each user were able to perform a task more than once, you want an auto incrementing primary key, then set the UID and TID as foreign keys. I believe this should help the database engine index the records. So, if you had the User and Task tables: User {userID, username, password, ... } Tasks {taskID, name, difficulty, ... } The linking Score table if a user can perform a task once: Score {userID, taskID, Points} or if they can perform a task multiple times: Score {scoreID, userID, taskID, Points} This way there is no redundancy as each record is unique. Hopefully, I have explained this well enough.
  15. A field should only contain 1 value. I would create the Users table to store the user information. Then I would create a linking Tasks table that would include the userID for one field, the Task number for the next, and finally the value for that task in the last field. It would look something like this: User {UID, username, password, ... } Tasks {UID, Task, Points}
  16. Can you do a view source and post the generated output?
  17. '</span'; You are missing the closing bracket on 3 lines.
  18. You might have to move it to the constructor: <?php class foo { public function hello() { echo "Hello World this is Foo"; } } class bar { private $fooClass; public function __constructor() { $this->fooClass = new foo(); } public function bar() { echo "Hello world this is bar"; $this->fooClass->hello(); } } $master = new bar(); ?>
  19. Try something like this: <?php if (isset($_POST['submit'])) { $title = $_POST['title']; $name = $_POST['name']; $surname = $_POST['surname']; .... $address = $_POST['address']; $postcode = $_POST['postcode']; $output_form = false; if (empty($name)) { echo '<b style="font-weight:bold;color:red"> Please type in your name.</b><br />'; $output_form = true; } ......if (empty($agree)) { echo '<b style="font-weight:bold;color:red">Please tick the "I agree" box at the bottom of the form.</b><br />'; $output_form = true; } else { $output_form = true; $dbc = mysqli_connect('', '', '', '') or die('Error connecting to MySQL server.'); $query = "INSERT INTO table (title, name, surname, address, phone, mobile, email, mocupation, focupation,". "mnationality, fnationality, freligion, practiceit, language, childna, disabledm, disabledma, babye, singlep,". "pets, anyhelp, vegetarian, smoke, interests, share, reference, aupair, natpreference, natspecification, englishlevel,". "aupairgender, driver, car, smoker, vegaupair, duration, weekhrs, money, engcourses, choirs, start, hadaupair,". "comments, homespec, aupairroom, amenities, agree) " . "VALUES ('$title', '$name', '$surname', '$address', '$phone', '$mobile', '$email', '$mocupation', '$focupation',". "'$mnationality', '$fnationality', '$freligion', '$practiceit', '$language', '$childna', '$disabledm', '$disabledma', '$babye', '$singlep',". "'$pets', '$anyhelp', '$vegetarian', '$smoke', '$interests', '$share', '$reference', '$aupair', '$natpreference', '$natspecification', '$englishlevel',". "'$aupairgender', '$driver', '$car', '$smoker', '$vegaupair', '$duration', '$weekhrs', '$money', '$engcourses', '$choirs', '$start', '$hadaupair',". "'$comments', '$homespec', '$aupairroom', '$amenities', '$agree')"; $result = mysqli_query($dbc, $query) or die('Error querying database.'); mysqli_close($dbc); } } else { ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p id="form">Family registration form</p><br /> <table id="first"> <tr> <td><label for="title"> Title:</label></td> ...... <?php } if (!empty($name) && !empty($surname) && !empty($address) && !empty($phone) && !empty($email) && !empty($mocupation) && !empty($focupation) && !empty($mnationality) && !empty($fnationality) && !empty($freligion) && !empty($language) && !empty($childna) && !empty($reference) && !empty($duration) && !empty($weekhrs) && !empty($money) && !empty($start) && !empty($homespec) && !empty($aupairroom) && !empty($amenities) && !empty($agree)){ echo '<p id="thanks">Thank you for registering with us!</p>'; } ?>
  20. If the UPDATE query fails, it will only return false. Check if there are any errors: mysql_query("UPDATE users SET full_name = '$full_name', account_num = '$account_num', user_email = '$user_email', amount_due = '$amount_due', due_date = '$due_date', user_pwd = '$user_pwd',address = '$address', joined = '$joined' where id = '$id'") or trigger_error('Error: '.mysql_error(), E_USER_ERROR);
  21. I think the $data variable is getting overwritten. change $data = trim($line)."\n"; to $data .= trim($line)."\n";
  22. You need to start it with an if statement: include 'includes/pulljobs.php'; if (isset($_REQUEST['cdate'])) include 'includes/pulljobscdate.php'; elseif (isset($_REQUEST['company'])) include 'includes/pulljobscompany.php'; else include 'includes/pulljobs.php';
  23. There are probably a few ways to do it, but to build on what you have, I would create a hidden input field and set the value to $itemID. Then you'll be able to reference that when you get your $_POST variables: $_POST['extras_'.$_POST['itemID']]
×
×
  • 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.