Jump to content

dan_t

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by dan_t

  1. I know very little about javascript, but I believe this is supposed to be the navigation system. <STYLE type="text/css"> <!-- .navBackgroundNavigationyss { background-image:url('/~media/elements/LayoutClipart/../LayoutClipart/NavTabs/Basic_Tab_White_Unselected.gif'); background-position: center; background-repeat:no-repeat } .navBackgroundSelectedNavigationyss { background-image:url('/~media/elements/LayoutClipart/../LayoutClipart/NavTabs/Basic_Tab_White_Selected.gif'); background-position: center; background-repeat:no-repeat } --> </STYLE> I tried adding a script tag, but it still did not work. Any idea's? The navigation on the site is not showing, just this error: [an error occurred while processing this directive]
  2. That makes sense. I'll alter the line of code with changes from here on. Thanks PFMaBiSmAd
  3. Before I try and fail again - is there a good way to draw the opposite of a users attribute in a database? like: $query = "SELECT databasetable.sex where $userId.sex != $_SESSION['userId'].sex I realize this would never work, but can you kind of see what I'm going after?
  4. I deleted each one after I tried and failed. I will try another and post it.
  5. I don't have an actual code yet. I'm just trying to figure out how to do it. I've tried a few different ways, but none worked.
  6. Hello everyone, I'm having a little trouble here. I'm trying to use a session created from log in(the user id) and take that user id and pull out information from the data base. An example would be: (this is not the actual code, but I will wrap it anyway) $_session['username']; $userId = 'username'; $query ="SELECT * FROM databasetable where userId = (whatever I need to draw out)"; ( **Here's where the confusion comes in.** How would I take the $userId variable from the users login and get information such as sex being male or female, and then print userId's of the opposite sex? **) So far I have tried about a hundred different ways with no luck, now I turn to the experts. So I have totally confused myself - I hope I am asking the question coherently Hopefully you can figure out what I'm looking for.
  7. Hi guys, Here's my upload file. $target = "./images/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; //This is the sizing condition if ($uploaded_size > 350000) { echo "Your file is too large.<br>"; $ok=0; } //This is the file type limit condition if ($uploaded_type == "text/php") { echo "No PHP files<br>"; $ok=0; } if ($uploaded_type == "text/css") { echo "No CSS files<br>"; $ok=0; } if ($uploaded_type == "text/javascript") { echo "No Javascript files<br>"; $ok=0; } if ($ok==0) { Echo "Sorry your file was not uploaded"; } else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded <br /> Thank you.<br />Your photo will be reviewed for submittance.<br /> This insures the integrity of the site."; } else { echo "Sorry, there was a problem uploading your file."; } } now of coarse my validation doesn't seem to validate, but my real problem is when it goes into the image folder with some crazy number I loose track of who it came from. Is there any way to name it in the database? Here is the form if you need it. <form enctype="multipart/form-data" action="upload.php" method="POST"> Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /> </form>
  8. Sorry that last line had userId it is the wrong line. The correct line is: $about = nl2br(safe_mode($_POST['about_me'])); Sorry about that. Just a simple word like "that's" seems to make it error. I'm I better of cutting down on some of the function? Like is htmlspecialchars and htmlentities overkill?
  9. function safe_mode($string) { $string = strip_tags($string); $string = stripcslashes($string); $string = trim($string); $string = htmlentities($string); $string = htmlspecialchars($string); return $string; } $userId = safe_mode($_POST['userId']); What part of this would kick out the charaters? The other parts just a standard textarea, it works unless you put in a " ' " that's what kicked out on me. just the '
  10. Hi Guys, I've got a function for making input safe. One takes from a textarea on a form. The problem is when someone types a few paragraphs in it, using regular sentence stuff like ( ' , . () ? ) it kicks it out and gives them my error message. How can I keep out the unsafe stuff, but still allow someone to "speak their mind"? Something like a preg_replace maybe? If so, how can I add it on to my other function? Thanks Dan
  11. I have run into this more than once, but I never takes notes. I get this error when running my code: Notice: Undefined index: uploadedfile in C:\wamp\www\upload.php on line 19 The file has been uploaded. Is is uploading, but I get the undefined index. here is my code: $uploaded_size =''; $uploaded_type = ""; $uploadedfile = "" ; $target = "c:/wamp/upload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; //This is the sizing condition if ($uploaded_size > 350000) { echo "Your file is too large.<br>"; $ok=0; } //This is the file type limit condition if ($uploaded_type =="text/php") { echo "No PHP files<br>"; $ok=0; } if ($uploaded_type =="text/css") { echo "No CSS files<br>"; $ok=0; } if ($uploaded_type =="text/javascript") { echo "No Javascript files<br>"; $ok=0; } if ($ok==0) { Echo "Sorry your file was not uploaded"; } else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } } How do I get rid of this warning? How can I define or hide it? Thanks Dan
  12. The missing numbers were to ones that were checked. I read some where you can fix a problem like this by doing something like: $interest = $interest$_POST['interest'] = " "; or something like that. Does that make sense?
  13. Zanus, you have been a lot of help. Have you got an answer for this one? I hope it's an easy fix.
  14. I've got everything working, but i get these: Notice: Undefined index: interest in C:\wamp\www\bills\show_info.php on line 33 Notice: Undefined index: interest2 in C:\wamp\www\bills\show_info.php on line 35 Notice: Undefined index: interest3 in C:\wamp\www\bills\show_info.php on line 36 Notice: Undefined index: interest4 in C:\wamp\www\bills\show_info.php on line 37 Notice: Undefined index: interest5 in C:\wamp\www\bills\show_info.php on line 38 Notice: Undefined index: interest6 in C:\wamp\www\bills\show_info.php on line 39 Notice: Undefined index: interest7 in C:\wamp\www\bills\show_info.php on line 40 Notice: Undefined index: interest8 in C:\wamp\www\bills\show_info.php on line 41 Notice: Undefined index: interest9 in C:\wamp\www\bills\show_info.php on line 42 Notice: Undefined index: interest11 in C:\wamp\www\bills\show_info.php on line 44 Notice: Undefined index: interest12 in C:\wamp\www\bills\show_info.php on line 45 Notice: Undefined index: interest13 in C:\wamp\www\bills\show_info.php on line 46 Notice: Undefined index: interest14 in C:\wamp\www\bills\show_info.php on line 47 Notice: Undefined index: interest15 in C:\wamp\www\bills\show_info.php on line 48 with the unused checkboxes.
  15. I got it without the arrays, but I appreciate your wisdom.
  16. Why would it report back just array, instead of some type of value? Should I put a value in each one and then use an if statement? like: interest[0] and then: if(interest[0]) { $interest = $_POST['interest']; } Or would that just overcomplicate for no reason?
  17. I get this: Fatal error: Cannot use [] for reading in C:\wamp\www\bills\show_info.php on line 19 trying to use this: $interest = $_POST['interest'][]; Just thought I would try-no such luck.
  18. OK, now it enters the word "array" into the field "interest" , but not any values.
  19. So you put braces beside them in the form?
  20. Choosing these from the checkbox list. Art<input type="checkbox" name="interest" value="art" /> Boating<input type="checkbox" name="interest" value="boating" /> Camping<input type="checkbox" name="interest" value="camping" /> Diving (Scuba)<input type="checkbox" name="interest" value="diveSc" /> Diving (Sky)<input type="checkbox" name="interest" value="diveSk" /> Equestrian <input type="checkbox" name="interest" value="esquest" /> Field sports<input type="checkbox" name="interest" value="field_sports" /> Fishing<input type="checkbox" name="interest" value="fish" /><br /> <br /> Golf<input type="checkbox" name="interest" value="golf" /> Hunting<input type="checkbox" name="interest" value="hunting" /> Jogging<input type="checkbox" name="interest" value="jog" /> Line dancing<input type="checkbox" name="interest" value="line_dance" /> Motor sports<input type="checkbox" name="interest" value="motor_sports" /> Music<input type="checkbox" name="interest" value="music" /> Racing<input type="checkbox" name="interest" value="racing" /> Skiing<input type="checkbox" name="interest" value="skiing" /> Tennis<input type="checkbox" name="interest" value="tennis" /> When you choose more than one and submit it, it only submits the last choice to the database, how do you enter more than one value?
  21. OK once again I was overcomplicating things. That seems to be a habit. Would anyone know why information would be entered twice when it is submitted?
  22. how do you insert values into a database from a checkbox or drop-down list?
  23. I have this simple form echo <<<EOF <form action="log_user.php" method="post"> Please enter User Id: <input type="text" name="in_userId"> <input type="submit" name="sub_use" value="send"> </form> EOF; and I have this simple run through an array from a database $in_userId = $_POST['in_userId']; //select user info $users_result = "select userId from persinfo where cat_id =1"; $user_result = mysql_query($users_result); while($row = mysql_fetch_array($user_result)) { print($row['userId']).'<br>'; } How can I check this input against a user in the database? I can't seem to get anything to work.
  24. Confusingly, that's what it says it is and where it is at...? line 30 30 if($con->error) { echo 'Something entered improperly: ' .$con->error; } it just doesn't make sense.
  25. Just the standard connection, it usually works. $con = mysql_connect("localhost", "test", "test" ) or die ('Sorry, could not connect at thie time.');
×
×
  • 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.