Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. This is a setting in the php.ini file that allows you to choose which flags identify php. It is considered [b]good[/b] practice to use <?php and ignore using anything else so if you can just use <?php.
  2. Why have 2 submit buttons? have one to submit the requested data to the database and replace the other submit button with a nice and simple reset button? <input type="reset"> should do the trick.
  3. you are missing a </td></tr> immediately after the text area on there. Now if that doesn't put the border on have a look at any styles you are using in the page or in your css
  4. Not wanting to re-invert your wheel but I am a great proponent of accessibility on websites... Have you considered using css to do this? It means no javascript (so it doesn't matters if the visitor has js turned off) and you have an opportunity for visually imparied users to have their screen readers not have to deal with messy img tags!!! take a look at www.regeneratingnb.co.uk and the associated css file (you will have to spend a bit of time if you are not familiar with class and id attributes and how to use them in css)
  5. two ways you can do this - one you have identifed the other... well I think a bit more messy but each to their own. counting method... [code]<?php mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_name); $sql = "SELECT * FROM news_site WHERE `show` = '1'"; $results = mysql_query($sql); $count = mysql_num_rows($result); $i = 1; while ($data = mysql_fetch_array($results)) {     var_dump($data);      if ($i++ != $count) print "<hr>"; } ?>[/code] 'messy' method [code]<?php mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_name); $sql = "SELECT * FROM news_site WHERE `show` = '1'"; $results = mysql_query($sql); $data = mysql_fetch_array($results); var_dump($data); while ($data = mysql_fetch_array($results)) {         print "<hr>";     var_dump($data); } ?>[/code] I prefer the former as the code is neater but the latter is probably (very slightly) more efficient in terms of resource use as there is no evaluaion of an if statement or the looping increment of $i Have fun ;)
  6. use php and mysql to generate the html for the page. use javascript for any 'interaction' that you want to do - such as roll overs. document effects are client side matters while php and mysql deals with serverside things.
  7. I have written a function within my upload class that resamples images above a certain size and creates a whole nedw image based on teh original - but smaller. You need to look at the gd functions in the manual to do this.
  8. you will need the gd library functions!!!! here is your starting point - have fun learning ;) [a href=\"http://uk.php.net/manual/en/ref.image.php\" target=\"_blank\"]PHP Image Functions[/a]
  9. Unfortunately that is not all the info php erros can create. Without seeing the actuall source code in line 271 of functions_post.php (and more likely the whole code in that file) then I fear there is little we can do. You can PM myself with your contact details if you wish and I will have a look - if it is a little job I'll just do it - if not you may have to pay whoever to do it; I suspect it is a little job mind.
  10. in the form that teh user fills in have... <input type="hidden" name="IPADDY" id="IPADDY" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>"> now on submission of the form have a table to log ipaddy and the time... $query = mysql_query("INSERT INTO `iplog` (`ipaddy`,`time`) VALUES ('" . $_POST['IPADDY'] . "', '" . mktime() . "'); before you add that line query the table for that ipaddress and se if the corresponding time is > (mktime() - (60 * 15)) if it is they tried less than 15 mins ago so display a message telling thme so. If not process the formand add that info to your log table.
  11. whois is the global domain registration record database - you can search for a domain either by name or ip addy (i'm sure i have seen that one0 and return information about the owners of that domain. You can also track back web hops so that any individual who does something naughty can be reported to their isp given only their ip address and time/date of the incident.
  12. you will have to add another element to your 'cart' array to store the new data. You may also have to add to the script that displays the cart info so that it too displays the new information. You have the code in place to insert new elements to the array so just use that and make sure the data is passed from the form correctly.
  13. If you could give some details... Is there any error message returned? can you post the code from teh scripts that should do the work... Has a change been made on the server? is the database still intact? come back with some more inormation and someone will be able to give you some direction.
  14. I have never had to do anything like BUT perhasp the trick would be to follow how applications on your own computer work. create a table to act as a resource file. for each string (one or more words) creata an entry in the table and have the fields of the table be the language ie. CREATE TABLE `language` ( `string_ID` int(11) NOT NULL auto_increment, `english` varchar(255) default NULL, `german` varchar(255) default NULL, PRIMARY KEY (`string_ID`), KEY `english` (`english`,`german`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data for table `language` -- INSERT INTO `language` VALUES (2, 'Good Bye', 'Aufwiedersehen'); INSERT INTO `language` VALUES (1, 'Hello', 'Guten Tag'); INSERT INTO `language` VALUES (3, 'I am', 'Ich bin'); Then in your code you need only reference the string code and allow a session variable to select the correct field to display. That is how I would approach it. On a point of page design - make sure you define a lang attribute for either the whole page or the relevant elements - it will help the browser and the user.
  15. try: <?php echo "Testing :\r\n"; echo "A new line"; ?>
  16. does the file actually upload? are you given any errors? have you echoed out the query that is generatd so you can try to run directly in phpmyadmin?
  17. try echo "<td><a href=\"javascript:popUp('" . $mosConfig_live_site . "/emailpage/friend.php?id=".$PHP_SELF."\"><img src=\"http://www.oec4x4.com/images/M_images/emailButton.png\" width=\"32\" height=\"32\" alt=\"\" align=\"middle\" name=\"PDF\" border=\"0\" /></a></td>";
  18. You didn't check enough times!!!!! //Insert pilots $query=mysql_[b]query[/b]("INSERT INTO pilot (fname, lname, email, userid, comments, hiredate) values ('$fname', '$lname','$email','$userid','$comments','$hiredate' )"); you can do your own checking on the query results!!!!!
  19. OK. The $_FILES superdooperglobal is an aary of attributes for the uploaded file. you MUST reference this array by the inputname of the form.... $_FILES['form_data']['name'] $_FILES['form_data']['type'] etc etc (often good to use the $_FILES['form_data']['error'] to check things!!) Try that and it should improve things.
  20. without seeing the relevant code mate I don't think anyone could help you! Puts ome up and we will look.
  21. PHP can indeed accomplish the tasks you want to achieve.
  22. do you not have to use setcookie(); to actually alter cookie values???
  23. As if by magic.... [a href=\"http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php\" target=\"_blank\"]Pagination[/a]
  24. this is a style issue - you would be better off giving the text box a class or id attribute and defining its appearance in a style sheet. As for printing what people have entered in there I would post that information to another page and lose the textbox - they only print the visible area of the textarea element so If you have one on your form its best to not try and print it out.
  25. google 'bbcode' - that should provide a tutorial somewhere. What you are actually doing is a series of string replacements when printing the string - so [b] becomes<b> etc. etc. I use regulat expressions to do this but they have taken me a couple fo days to learn to a level where I can use them to there full extent - to start with str_replace will do but you will find sometime down teh line that they are not pwoerful enough for what you want.
×
×
  • 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.