Jump to content

cbolson

Members
  • Posts

    139
  • Joined

  • Last visited

    Never

Everything posted by cbolson

  1. Hi, A quick and easy solution might be to have the complete image as the background (ie without the white strip down the middle) then put this white background (with padding) on the page contents. This could be done by wrapping the complete contents in a wrapper layer. This wrapper would have a style something like this: #wrapper{ width:900px; background-color:#FFF; padding:10px; margin:0px auto; } Then, in the html you would put : <div id="wrapper"> immedeatly after your <body> tag and close it again directly before the closing </body> tag. Chris
  2. you need to add it to the page load (eg in the <body> tag).
  3. Yes, it looks like exactly the same problem. The register_globals applies to all variables passed, be it via POST or GET. For the he photos you need to use $_GET as they are being passed via the url. Chris
  4. Hi, Personally, if you have the id of the user on page load, I would get the data using php rather than using ajax. Alternatively, you could call the javascript function on page load, passing it the id of the user: eg. (where 1=id of user) onload="showUser(1)" Chris
  5. Try changing $myServer = "127.0.0.1"; to $myServer = "localhost"; Chris
  6. Hi, your brevity, whilst appreciated, makes it rather difficult to know what is going wrong. Can you post the complete code for additionsuccessful.php? You say: "... "additionsuccessful.php" is displayed with only the first field completed." What do you mean by this? completed where? Are you saving this to a database? Have you tried printing out the POST values to see what your additionsuccessful.php is actually receiving? Try adding print_r($_POST); at the beginning of the page to show what the page is getting. Chris
  7. How about this: <div style="float:left;background-color:red;height:200px">Menu</div> <div style="float:right;clear:right;background-color:blue">Right</div> <div style="background-color:orange"> <span>Some text here</span> <span style="float:right;background-color:yellow;clear:none;">Right Floated Span</span> </div> <div style="float:left; clear:left;background-color:green">Left</div>
  8. Hi, With your code I am getting the "Left" column below the rest of the columns. Is this correct? Now, if I move this left-floated column to above the "Menu", it all seems to work correctly (ie your content spans are ligned up un the center column: <div> <div style="float:left; clear:left;background-color:green">Left</div> <div style="float:left;background-color:red;height:200px">Menu</div> <div style="float:right;clear:right;background-color:blue">Right</div> </div> <div style="background-color:orange"> <span>Some text here</span> <span style="float:right;background-color:yellow;clear:none;">Right Floated Span</span> <span style="clear:both;"></span> </div> However I am not totally convinced that that is what you want to do. Anyway, the thing is that the "offending" line is that left-floated layer. I hope that is of some help Chris
  9. well, can't answer that one for you If it is on wamp I presume that means that you created the database so therefore you should have the ability to go in and modify the settings, don't you? I'm afraid that servers is not my area. sorry Chris
  10. Hi, you are missing the closing ";" at the end of these lines: $myusername = $_POST['myusername'] $mypassword = $_POST['mypassword'] Chris EDIT - you are also missing one at the end of this line further down: echo "Wrong Username or password"
  11. Hi, It is opening all the hidden elements because that is what you are telling it to do. In the same way that you have used $('.forumPaster').hide(); to hide them all, you are using the same code when you want to open just one. Either you need to address each hidden layer individually by using a unique id, or you could try to get the "next" layer after the button. I am not familar with jquery, personally preferring mootools, but you could try something like this: $(document).ready(function() { $(".forumPaster").hide(); $(".ForumPasteButton:button").bind('click', function() { this.next(".forumPaster'").toggle(); }); }); As I say, I don't know jquery code that well but this, or an adaption of this should work. Chris
  12. I would say that you have 3 choices: 1. - Use javascript to control the format and data type (ie numeric only) 2. - Alternatively you could provide 4 text boxes and set the maxlength on each one accordingly then, when the form is posted, join them up with php. However, you would still need some javascript if you want to only allow them to input numbers. 3. - Finally this could be checked and controlled by php when the form is posted. However, this means that you will have to show the form again if the number is incorrect and prefill all the fields with the data that the user has introduced. Chris
  13. OK, I have checked your site out and the page is working (ie no php errors)so it is not what I said though it would be a good idea to make that change anyway. So, it is probably due to the fact that you aren't referring to the posted variable correctly. The code uses the variable name directly "assuming" that php know what they are (again, a server side configuration setting) For example you have this: if ($Submit) That should be : if (isset($_POST["Submit"]) Likewise for all the variables within that conditioned section that is supposed to be reading the posted values. Chris
  14. Hi there, First thing that I noticed is that the code uses the deprecated php short tags. ie <? rather than the (now) correct <?php Newer versions of php have the short tags turned off. Try changing all them and see if it works. Chris
  15. are you getting a blank page on page load - ie can you even see the photos for voting? A blank page normally means that there is some php error. It sounds like you server has php error reporting turned off. If you add these lines at the beginning of your page you should start to see some useful php errors: error_reporting(E_ALL ^ E_NOTICE); ini_set("display_errors", 1); Chris
  16. add print_r($_SESSION); right before the queries and tell me what you get. Chris
  17. OK, I have taken a quick look at your file and made a few changes. You should be able to find my code as I have added a comment before starting "// chris - " Basically I have used session_start() at the top of the page to start the php session (without this it will never work) When the user votes a session variable is defined with the id of the photo. This session variable is used to prevent the mysql_query() that updates the votes from being exectued more than once if the page is reloaded. It is also used to stop the photos from being shown again once they have been voted. Clearly I haven't tested this code as there is a lot of other stuff in there which relates to your other database stuff. Let me know how it goes Chris [attachment deleted by admin]
  18. So, if the user can't vote for the same photo more than once, surely the best option would be to not show it again, wouldn't it? If this is the case you would need to condition the database query to not select the photos whose id is in the session variable array. To achieve this you can loop through the ids in the array to add a condition for your database query something like this: $sql_condition=""; foreach($_SESSSION["vote"] AS $id_photo){ $sql_condition.=" AND ID!=$id_photo"; } $res=mysql_query("SELECT ID, Name, Thumbnail, LinkText, LinkUrl FROM Models WHERE Status='1' ".$sql_condition." ORDER BY RAND() LIMIT 2"); Chris
  19. Create a session variable to store the id photo when a user votes for it. Then, each time a user votes, check that the photo being voted upon isn't in the session already. The user will be unable to vote for the same photo again until they begin a new session. Something like this: if(!isset($_SESSION["vote"]["id_photo"])){ // your vote save code // save id photo into the session $_SESSION["vote"]["id_photo"] =1; }
  20. date('m'); returns a number (01-12) so that should work. Chris
  21. $month=10; $query = "SELECT * FROM staffsched WHERE service = '$service' AND MONTH(calldate)=$month ORDER BY calldate "; However, you probably want a specific year as well; $month=10; $year=2009; $query = "SELECT * FROM staffsched WHERE service = '$service' AND MONTH(calldate)=$month AND YEAR(calldate)=$year ORDER BY calldate "; Chris
  22. If you check the php.net docs: http://www.php.net/manual/en/geoip.requirements.php you will see that this requires this : http://www.maxmind.com/app/c which is the same company as the url that I posted. It appears (haven't tried it myself) that this needs to be complied on your server. Chris
  23. Take a look at geoip here: http://www.maxmind.com/ Chris
  24. Yes, as you are referencing 2 tables with one query, using the "." with the table name (or alias) before the column name tells the query which table to get the column from. If the tables have completely different column names this is not a problem but if they have common names, which is often the case, it needs to know which one to get.
×
×
  • 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.