Jump to content

twm

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Everything posted by twm

  1. Well, where should I start. As you will/can tell, my first language isn't English, so I apologize for grammar and spelling. Been a sort of programmer for a while. Started in '83 then went to play soldier for a few years (in '88). Once I learned English (had no choice, ended up in Canada), I started up with programming again, and been doing it on and off for a few years now. Even got a diploma in Internet and E-Commerce Application Development. Woohoo! An other one for the office wall! Everybody has to make a living, right? Currently working as a sub contractor for a video conferencing company / network provider. Don't do much programming anymore, so it became a sort of a hobby, doing projects for companies (name dropping spot here: Intel, Orange Julius, Peek Freans and a few more smaller - bigger projects for companies (internal applications) Telemerge, IPV Gateways...etc The fave is PHP/MySQL stuff but sometimes still code .NET (but we don't talk about that). Most of my time is spent front of the computer, but it has it's upside as well. Don't have to leave the house if I don't feel up to it. Grab a beer and a smoke and have fun with some code. What do I do for fun? Write PHP scripts. J/K. I play pool in a few leagues, and get together with a few buddies for a poker game or two. (or maybe that is in the drinking beer category) Oh well, next I will learn some social skills, so I can actually talk to people about something (or at least myself). :-D
  2. try and see if anything different happens. <?php session_start(); if(isset($_SESSION['otherusername'])){ $db=mysql_connect('localhost', 'root', ''); $res=mysql_select_db('textgame',$db) or die(mysql_error()); $otherusername = $_SESSION['otherusername']; //"SELECT item FROM users_items WHERE username='".$Username."'"; $res=mysql_query($otherusername)or die(mysql_error()); while($row = mysql_fetch_assoc($res)){ echo $otherusername; echo $row['item'] . "<BR />"; } }else{ echo "Sorry your not a member please join us!"; } } ?>
  3. I don't see $Username set anywhere. is it supposed to be the $_SESSION['otherusername'] in place of $Username ?
  4. And how exactly does that work better? There was nothing wrong with the way it was before. Variables are parsed when they are put inside double quotes. they are also in single quotes inside the doubble quotes...don't know, old habbits are hard to get rid of
  5. meaning echo to screen, copy and paste on the forum
  6. I find that this works better for me: $otherusername = "SELECT item FROM users_items WHERE username='".$Username."'"; Make sure that you check your spelling (field name, table name ... etc) and the variable $Username exists (it isn't actually $username) and it isn't empty or NULL.
  7. the way you are using strtotime it works fine if your date is in a format mm/dd/yyyy
  8. http://www.phpriot.com/articles/multi-step-wizards
  9. $_POST is all caps , you have $_Post
  10. what is the date field name?
  11. on the second page change $artid=$r["artid"]; to $artid=$_GET["artid"];
  12. <?php $sql='SELECT * FROM horsedata WHERE id='.$thehorse.' AND DOB BETWEEN 3 AND 36'; ?>
  13. <?php $query = "SELECT * FROM modlpae WHERE userid = '$user'"; $result = mysql_query($query) or die('Error : ' . mysql_error()); $total_questions = 15; $qcounter = 1; $filled = 0; while ($row = mysql_fetch_assoc($result)) { if(!is_null($row["q".$qcounter]) || $row["q".$qcounter] != '') { $filled++; } $qcounter++; } $percentage = ($filled/$total_questions)*100; echo $percentage; ?>
  14. you could store the values in session variables or cookies
  15. in my view it is better to use id numbers not usernames. If you set up your id field as the primary and increment, it should not have duplicates no matter what.
  16. //From the php.net strtotime entry user comments: ################ # Returns date of the Monday for given number of Iso Week(1..53) # and year. Output is UNIX-Timestamp <?php function get_monday ($week, $year="") { $first_date = strtotime("1 January ".($year ? $year : date("Y"))); $w_day = date("w", $first_date); $d_week = 0; switch($w_day) { case 1: $monday = $first_date; break; case 2: case 3: case 4: $d_week = 604800; default:$monday = strtotime("Monday", $first_date)-$d_week; }; $plus_week = "+".($week-1)." week"; return (strtotime($plus_week, $monday)); }; # to use it call: date("m/d/Y", get_monday($someweek, $someyear)); ?>
  17. yes, but is it posting it? try to echo out the horseid or the whole post variable to see what is being posted to the script.
  18. see if this helps: if ($_POST["form"] == "Submit"){ $name = $_POST['name']; $startDate = $_POST['startDate']; $endDate = $_POST['endDate']; $duration = $_POST['duration']; $type = $_POST['type']; $source = $_POST['source']; $details = $_POST['details']; $sql = " INSERT INTO polyphasic (name, startDate, endDate, duration, type, source, details) VALUES ('$name', '$startDate', '$endDate', '$duration', '$type', '$source', '$details') "; $query = mysql_query($sql, $con); unset($_POST["form"]); } <form action="index.php" method="post"> <tr> <td><input type="text" name="name" value="" /></td> <td><input type="text" name="startDate" value="" /></td> <td><input type="text" name="endDate" value="" /></td> <td><input type="text" name="duration" value="" /></td> <td><input type="text" name="type" value="" /></td> <td><input type="text" name="source" value="" /></td> <td><input type="text" name="details" value="" /></td> </tr> </table> <input type="submit" name="form" value="Submit" /> </form> }
  19. your script can not have any output before calling the header function
  20. might be just my mistake Correct / replace code for $check_query variable: $check_query = "SELECT * FROM winterfest WHERE horseid = "'".$horseid."'"; It is trying to select empty ( '' ) from the mysql table. So, either the horse id is missing, or it requires single quotes around the variable.
  21. ok, this worked in mysql: <?php include ("connectdb.php"); $sql = "CREATE TABLE `procedures` ( `proc_id` int(11) NOT NULL auto_increment, `pt_id` int(11) NOT NULL, `proc_date` date NOT NULL, `procedures` varchar(20) NOT NULL, `proc_type` enum('GC','NS','Staff') default NULL, `dx` varchar(20) NOT NULL, PRIMARY KEY (`proc_id`) )"; // Execute query mysql_query($sql) or die(mysql_error().": $sql"); ?>
  22. You are missing the = sign in every form element ( name\"name2\" should be name=\"name2\" ) <?php echo " <table cellspacing=\"0\" cellpadding=\"10\" style=\"color:#999999; font-family: arial; font-size: 13px;\"> <tr bgcolor=\"#000\"><td align=\"right\"> Name </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"name2\" value=\"$_POST[name2]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Company Name </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"company\" value=\"$_POST[company]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> Email </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"email\" value=\"$_POST[emalil]\" size=\"30\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> Phone Number </td><td> <input type=\"text\" maxlength=\"3\" class=\"textfield2\" name\"phone1\" value=\"$_POST[phone1]\" size=\"3\" /> <input type=\"text\" maxlength=\"3\" class=\"textfield2\" name\"phone2\" value=\"$_POST[phone2]\" size=\"3\" /> <input type=\"text\" maxlength=\"4\" class=\"textfield2\" name\"phone3\" value=\"$_POST[phone3]\" size=\"4\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Address </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"address2\" value=\"$_POST[address2]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> City, State </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"city\" value=\"$_POST[city]\" size=\"13\" /> <input type=\"text\" maxlength=\"2\" class=\"textfield2\" name\"state\" value=\"$_POST[state]\" size=\"2\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Zip </td><td align=\"right\"> <input type=\"text\" maxlength=\"5\" class=\"textfield2\" name\"zip\" value=\"$_POST[zip]\" size=\"5\" /> </td></tr> <tr><td align=\"right\"> </td><td align=\"right\"> <input type=\"submit\" name=\"submit\" value=\"Submit\" /> </td></tr> </table> "; ?>
×
×
  • 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.