Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Everything posted by PC Nerd

  1. hi guys.... i want to have a function, where i can go something liek: if mysql has error, { mysql_status_enable = 0; } this way, it would cancel all funtions and variables relying on anything to do with the database....... and even replace those values, with something like "ERROR" is there a function or a way to do this? PS im not looking for a simply or die(); statement thanks
  2. ok..... i checked the release of mysqli and it was version 4.1.3, and im running 4.4.6 or higher i think..... ok, ill contact my host about the ini file, thanks for all your help
  3. ok, ill try it in a sec, however im sunniny 5.0.6 i think for mysql, and 4.4.1 for php so mysqli should beworking anyway. ill have a look, and let you know if i come up with anything thankyou
  4. ok: if all you want is to select country, then automatically give appropriate options for state, then city etc.: then just have an ID in your database, so that your table of states, has another field, for which country, and so forth for all the other tables: then you displaythem all into javascript arrays or something. then use an onclick with the first menu, and even make the other menus unavailable till an onclick on the first menu, and for each menu, use something like: onclick = function1() function function1() { var menu1_value = document.forms[0].menu1.value document.forms[0].menu2.options = options2_array } or somethign like that i cant really come up with the full script here, however if you still need to get it, i coudl do it for you. gimlie_legs@msn.com. gdlk
  5. ok...... what i would do is: database tables: ID, Title, Text: query etc, and result is: while($article_array = mysqli_fetch_array) { } then in that while would go: $article = explode(" ", $article_array['Article']); then i would display the first eg 3 sentances: echo $article[0], $article[1], $article[2]; then echo "<a href = 'article.php?article_id=".$article_array['id']."'>Read Article</a>"; then in article.php go: if(isset($_GET['article_id'] && !empty[$_GET['article_id'])) { questio database for the article of $_GET['article_id'] eg SELECT * FROM Table WHERE ID = $_GET['article_id']; then simply format as you like: i hope that helps. }
  6. ok, well ive had a look, however i still cant find a way to fix the error, any more suggestions?
  7. instead of specifying rand in the SQL, use shuffle on the array retreived. gdlk
  8. hi guys, ive come across this error before, bt have been able to fix it. im changing servers, and ive uploaded the file, and ive ensured that all my users and paasswords and database stuff is correct, but im still getting this error: Fatal error: Call to undefined function: mysqli_connect() in FILE NAME on line 13 is this saying that the function isnt there, or that the arguments are incorrect? <?php $host="localhost"; $account="USER"; $password="PASSWORD"; $dbname="DATABASE NAME"; $DB_Server = mysqli_connect($host, $account, $password); if(!$DB_Server){ die("There was an error in connecting to the database. Please try again later"); } $DB = mysqli_select_db($DB_Server, $dbname); if(empty($DB)){ die("There was an error in selecting the database. Please try again later."); } ?>
  9. ok, justy quickly without reading the code...... if your looking for a way to submit something, on a refresh, however not allow duplicates ( like refreshing etc.) then why not do a function, where it does it, and then relocates using javascript, like window.location = "domain.com/thing.php" and then echo out a line, for browsers that dont allow javascript..... basically what youd be wanting to acheive, is the function, to do stuff, and relocate the user, however to the same page, so that the GET data or whatever, is reset. gdlk
  10. ok..... simply ,dont add the stuff thats specific..... i dont see why you would bneed to specify the browser type, and if its only used for the one browser, then why do you need to specify the domain etc.? all you need is name = value, and thats it...... if you want a cookie that expires, when someone logs out, then simply put in a system where if theyve been in for 20 minutes, get then to login again, this also helps to aviod auto scripts etc. if you ned more help, lets me know
  11. and look at the _SERVER or _GLOBAL arrays, theres one element for IP address's. look at a post started by me, about a month ago, ( roughly) good luck
  12. i understand this is the wrong section, but how would i do that in javascript? i want it to all be done on the one page.
  13. but i need to create the multidimensional thing, whether its cookie, POST or whatever.... how do i do it?
  14. ok, so i cant do my idea, having the cookie holding arrays..... can POST or GET hold arrays, eg: $_POST[index1][index2] ? thanks
  15. can i create a multi dimensional array cookie, or POST, or GET? direct from the form? how would i go about deoing this cookie?
  16. so how would i do this..... i have 10 forms, and i need each form to become an array ( its fields the arrays elements...) i dont really mind if its POST data, or simply a cookie, and can i do this directly from the form eg method = '' action = '' etc/. thanks?
  17. firstly, can i create a cookie, drectly from a hmtl form? is it possible to have a multi domensional cookie, ie: cookie = documdnt.cookie cookie[index1][index2] etc. can i do this? if not, how would i have something like that?, can i make POST datab or GET data like this? thanks
  18. what do you meaen by belete function..... as in to delete the use or their website or wat, and where?
  19. hi guys ive got an arrey: $Avail_Questions[]....... and i want to selet a random element, buti want to save the key with it im using shuffle() and it rnaodmizes the keys and the values....... so how can i save the key? i had trouble with array_rand(), but im happy to go back to it..... thanks so much
  20. ok, yeah that helps, im getting errors though, but ill post them later if i keep getting them, thanks
  21. um, roughly, if all your trying to do is mask the domain of the address: $explode($email, "@"); $new_email = $explode[0]."*.com"; of whatever you could make a loop for the length of teh domain name, and then actually get the real length masked, but this is simpler i cant remember if its explode or impode() or explode(), but i think impode joines the array back to gether again. gdluck
×
×
  • 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.