Jump to content

cbolson

Members
  • Posts

    139
  • Joined

  • Last visited

    Never

Everything posted by cbolson

  1. MadTechie was saying that it was pointless because you already have this control at the beginning of the page. If the user is no logged in, this page will never be seen as you have told it to redirect to main_login.php with this code: if (! isset ( $_SESSION ['myusername'] )) { header ( "location:main_login.php" ); exit (); } So, as only logged in users can see the page, you don't need to the if/else clause and you can directly show the welcome message as per MadTechie's example. Chris
  2. A parse error often referrs to a previous line to the one indicated in the php warning (simply because it doesn't *know* there is an error until it gets to that line) I can't see a "<" in the code that you posted so it is probably happening somewhere else on the page or even in database.php Chris
  3. Hi, Why do you want to populate it with jquery (when modifying)? As you already have the country and province, surely you can populate the province dropdown list in the *normal* way - ie do a direct select from your database using the country id to select the provinces and the provinceid to mark it as selected. Chris
  4. You could try fpdf.org It is free and requires no server side installation. I use it a lot and certainly fulfills my needs Chris
  5. What errors are you getting?
  6. Hi, You have forgotten to close your iframe: <iframe src="content.php" width="600" height="400" name="content"></iframe> Chris
  7. Hi, Rather than this line: myTextField.setAttribute("style", "background-color: ' . color . '"); Have you tried this: myTextField.style.backgroundColor = color; Chris
  8. Hi, Without seeing the full code it is hard to tell, but, are you sure that the form has the id "register" ? Chris
  9. Hi there, I can't help you much with the actual jquery code but your problem is probably due to the fact that you are using a non-unique "id" for the hidden messages. ie. all the messages (and subject spans) have the same id so the javascript is only ever going to address the first one that it finds. You are going to have be more creative with your naming (eg use the item $row["to_id"]) both for the subject span and the message span then, in your javascript (jquery) extract this value from the subject span when clicked to know which message you want to expand. As I say, I am not hot on jquery but you could do something this like this: $(".subjects").click(function(){ // get rel value (this will be the id) msg_id=attr("id"); // not quite sure how you get the element id in jquery, in mootools you can just use "this.id" $("#msgBox_"+msg_id+"").css('display', 'inline').fadeIn(3000); }); and the code in your while loop could look like this: while($row = mysql_fetch_array($SQL)){ // Only a function to get the username instead of user id! do not see it! $sender = sender($row["from_id"],$row["to_id"] ); // Out put format! echo 'From: '.$sender[0].' |,| And To '.$row["to_id"].' |,| subject! is:'; // Subject here! look in it has span id of *SUBJ* ! echo '<span id="'.$row["to_id"].'" class="subjects"><font color="red">'.$row["subj"].'</font></span>'; // The Private message! echo '<span id="msgBox_'.$row["to_id"].'" style="display:none;">'.$row["msg"].'</span>'; } Not sure if my code will work but hopefully you will get the idea of how it could be done. Chris
  10. The back slash is not actually needed, I was just quoting a part of your url. In general terms, in an url, only the first "?" is read as meaning "variables to follow" after that is is regarded as part of the variable name or value. As you now know, the ampersand (&) is used to seperate diferent variables and the "=" to define the value of each variable. Chris
  11. Hi, assuming that the code that you have pasted is your actual code, you have a problem with the vars attached to the url as you have added an extra "?" in there: /?link=photo?page=FSU As I am sure you know, seperate variables should be seperated by "&" so that link should be: /?link=photo&page=FSU Chris
  12. Have you confirmed that $_POST["start"] has a value? Also, unless it is in the $_POST value (unlikely) you need a comma between the offset number and the limit: ... LIMIT " . $_POST['start'] . ", 100"; Otherwise it will be read like this (eg where $_POST["start"]=20): ... LIMIT 20100"; Chris
  13. Opps, I missed a closing bracket in the middle there, not very helpful of me sorry. Of course you are right about not needing the extra brackets, I should have mentioned them as they aren't part of the problem. Other than what you suggest about the correct way to check if the query has returned a result, I still think that the main problem here is the lack of the closing brackets on the "if" clause. Sorry if I have caused any confusion, trying to do too many things at once, I need to step away from the keyboard for a while Chris
  14. Hi, If you have php installed (which you do) but are getting a white screen, this means that you have a php error but the server has it's warnings turned off. Glancing through your code I can see the following errors: line 15. You are missing various brackets. You have this: if(!isset($_POST['username']) || !isset($_POST['password'])){ it should probably be this: if( (!isset($_POST['username']) || (!isset($_POST['password'])) ){ Then, you open an "if" but don't close it: if ($rows != "") { echo "Welcome please select your lake"; } else { ?> <form id="form1" name="form1" method="post" action=""> <p> <label> User Name: <input type="text" name="username" id="username" /> </label> </p> <p>Password: <label> <input type="text" name="password" id="password" /> </label> </p> <p> <label> <input type="submit" name="submit" id="submit" value="Submit" /> </label> </p> </form> After that closing form tag you need to open php again and close the "if": </form> <?php } ?> That should help you on your way. Chris
  15. You have this: if($num == 1){ That is rather limiting as it only returns true if there is exactly one result, what if the email is in the db more than once? You should use this if($num <>0){ or if($num >0){ Chris
  16. Removed my comments as BuCki has now replied to me pm that I sent several hours ago. Chris
  17. Hi, this error message normally means an error due to new line formatting in the email "body" I wonder if there is something in the wordwrap() function that is messing things up? You have this: $message = wordwrap($message, 70); Can you post that function? Also, it might be worth doing an echo on $message just to see what you actually have. Chris
  18. Are you sure that it isn't inserting into the database? - ie have you checked your tables directly? You have a small error here: if($results){ echo "Account createed Successfully, please login with your details."; } You have defined the mysql_query as $result no $results so your message will not be shown. Chris
  19. well I'm baffled. Assuming that you have changed all the appropriate = to == as phpORcaffine mentioned this really should work. Unless... As I am sure you know, "true" is normally used for Boolean values. Hoever, for whatever reason, here you are using them as a normal string, but maybe in your IF clause php interprets $_SESSION["Normal"] as being true (boolean) because it is defined and has a value.... Doesn't sound right but might be worth testing with a differnt value other than the words "TRUE" and "FALSE" Chris
  20. Hi, can you print out the session vars as they are right before you decide which page to show? Clearly the $_SESSION["Normal"] is not being changed to "False" Chris
  21. Before you start looping through the results set a variable to 0 like this: $cart_total=0; Then, within your loop add the item total to this variable: $cart_total=$cart_total+$total_price; Chris
  22. The thing is that if you want all the entries you don't need/want any WHERE clause. Can you post your php code as you have it now? Also, it might be useful to see your code (form) that posts the users choice Chris
  23. What do you mean by "it does not work right" If you want all the dogs regardless of breed from the database, there is no need to have a WHERE clause. Chris
  24. Hi, You have: WHERE titre='%$srch%'" I suspect that that should be: WHERE titre LIKE '%$srch%'" Also, this line $info = mysql_fetch_array( $result); is not needed as you have this in the while loop. Chris
  25. Hi, You may well actually have different code from what you have pasted here but if your code is actually like this your first problem is that you are not actually writing the value of the variable $text in the hidden layer as you have closed the php tags. You should do something like this: <div style='display:none;' id='<?php echo $number; ?>'><?php echo $text1; ?></div> <img src='http://www.hgdhhd.com/test.jpg' alt='test!' onclick='ChgText(<?php echo $number; ?>)' /> Secondly, in the javascript you are telling it to write to an element with the name "reply". There is no element with that name in your code. You have <textarea name='info' cols='50' rows='10' wrap='hard' id='reply'></textarea> So, either modify your javascript to use the name "info" or, preferable in my opinion, change it to reference the element id using getElementById() like this: document.changer.getElementById('reply').value += newtext; Chris
×
×
  • 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.