Jump to content

mac_gyver

Staff Alumni
  • Posts

    5,449
  • Joined

  • Days Won

    174

Everything posted by mac_gyver

  1. have you created the mysql database and the database user/password and assigned that user to the database you created? can you connect to the database through a simple .php script using those database credentials? you will need to find out exactly what error is being detected by the code. there either could be a php error or a mysql error. there's a chance that the software is logging php/mysql errors. check in the web server's error log file, then check for any other obvious log files. make sure that php's error_reporting is set to E_ALL and log_errors is set to ON in your php.ini to get any php detected errors to be logged. you may need to find where in the code it is attempting to make the mysql database connection and add logic to log any mysql errors at that point in the code.
  2. in order to send an email through a gmail account to an arbitrary destination email address, you will need to use smtp authentication against that gmail account, which the php mail() function does not support. you would need to use one of the php mailer libraries (or write your own smtp command software.)
  3. here's a programming hint about writing out block after block of code that only differs in the value it produces. you need define data in an array (or a database table), then write general purpose code that will work regardless of how many different data values there are. this will allow you to add, change, or remove values by simply changing the data definition. your hair selection code would look like this - $hair_default = 52; $hair[52] = array('name'=>'Default','file'=>'hair/M/Default.swf'); $hair[55] = array('name'=>'Goku1','file'=>'hair/M/Goku1.swf'); // define the rest of the possible choices here... or simply store this information in a database table and retrieve it when you need it // input is $hairid if(!isset($hair[$hairid])){ $hairid = $hair_default; // if not one of the possible choices, use the default } $hairname = $hair[$hairid]['name']; $hairfile = $hair[$hairid]['file']; also, by having the data defined in an array (or database table), you can dynamically produce the menus used on your web pages by using that same data definition, and again you can add, change, or remove choices from the menu simply by changing the data definition.
  4. what's your code where you attempted to add email confirmation to your existing script? help forums are not here to find or to write code for you. we are here to help you with code you have written. if you haven't attempted anything yet, you don't have anything which we can help you with. p.s. just about everything that can be done using php has been done. there are countless examples posted all over the place showing how to accomplish any particular task and sending an email from php is a very common task. p.p.s you need an actual mail server to send any email through. php alone cannot send mail, it's not a mail server.
  5. what you are asking is "how do i do a basic operation" and that is what the documentation is for. you are going to need to have a specific question or problem with some code you have written in order to get help on a php help forum. all you have stated is what you want and in programming, going from what you want to having the code that does that takes programming and effort.
  6. repeatedly just stating what you want your code to do and then expecting someone to post code that does that is not how programming help works. if you don't know how to do something in programming, you research it, for as much time as necessary, until you do understand it, because we cannot provide you with an understanding remotely over the Internet. programming help forums are for when you get stuck at a step with code you have written. you have to bring enough of the basics with you so that you can attempt and at least get the gist of what is being posted in the replies. you appear to not know how to make a form, with a select/drop-down menu, then take the submitted value from that form, query for data dependent on the value, and produce a related select/drop-down menu. you would need to start with the tasks that accomplish these goals. start by making your first select menu, submitting that menu (you can use an onchange event to submit the form without needing a specific submit button), test for that form submission in the php code, validate the value, then use the value to retrieve the data needed for the second select menu. get at least to this point so that you will be comfortable with the basic skills needed to perform this for any number of related select menus. btw - you would not store the data in three separate tables. you would have one table with a type or category column that relates the three choices web , net , prog with the corresponding students (in a students or user table.)
  7. your query is failing due to an error (or you are using the wrong variable, overwriting the variable...) do you have any error checking logic in your code so that you would know when and why your query is failing?
  8. if you don't know, how could we possibly know? edit: even though you have two databases, if they are on the same database server and have or can have the same database user, you don't need two connections in your code. you just need to select the correct database or even just list the database name in your queries.
  9. assuming your void are actually nulls and the data is in $data - $data = array_map('array_filter',$data);
  10. every mysql_query(), mysql_select_db(), and mysql_error() statement must use the correct connection variable. you have several instances that don't.
  11. is the database server ip (or hostname resolution) the same in all the scripts/tools? this symptom is screaming data from two different database servers.
  12. your code is concatenating the $dynamicList variable every pass through the loop, resulting in a mess in the html - i would also re-factor the code so as to not repeat (DRY) - if ($i % 3==0) { if ($i <> 0) { // end the previous row, when not the first one $dyn_table .= "</tr>"; } // start a new row $dyn_table .= "<tr>"; } // the data section in each row $dyn_table .= "<td>$dynamicList</td>"; $i++;
  13. edit to the above: because of the way unset() works, what i suggested above won't work without using the $GLOBALS array, which we should probably forget exists.
  14. i would write a call-back function to unset() the element based on the value, whatever it actually is, and use array_walk_recursive() to apply that function to every level/element of the array.
  15. when a user requests a 'protected' page, your code must do two things - 1) check the current user's logged in status, which might not exist at all, 2) if not logged in, prevent the remainder of the code on the 'protected' page from running by causing the code to take a known and specific execution path. for item #1, you need to use isset() to make sure $_SESSION['status'] exists before you try to reference the value in it. for item #2, rather than returning from your function that is using a header() statement to tell the browser to perform a redirect and request a new url, you should just exit;/die; after the header() statement so that you stop program execution at that point.
  16. you also should not be creating a new instance of your database class inside of another class method just to run each query.
  17. tapantor24, programming help does not mean that we write and give you code that does what you want. if it is beyond your ability to attempt to solve these problems yourself, you will need to hire a programmer to do this work for you.
  18. your reply indicates you did not or cannot perform this basic debugging - i'm afraid there's not much that we can do for you based on just the end symptom. in programming, because there are multiple different ways of accomplishing any task, there is not a 'one symptom' has exactly a 'one cause' relationship. there is at least a dozen different things that could cause any one query or code to not operate as expected when moving between different server configurations or different server versions and we don't have any information in this thread that would narrow down the problem by eliminating any of those possibilities. the only additional thing that comes to mind is the posted query could be executing with the expected values in it, but it is failing due to an error. have you tried adding some error checking logic to the query that would give you the mysql_error() output?
  19. you would need to determine why the two php variables holding those values don't have the expected contents. it's also possible that the code where that UPDATE query is at isn't even being executed and you are only seeing the initial values that have been INSERTED into the table. the query you posted also hints at an application that is poorly designed, resulting in a huge amount of code. why do i state that. it's an UPDATE query with a hard-coded value in the where clause. you would normally only UPDATE existing data to alter values or correct errors in previously entered data and each field would have the possibility of being edited/updated. there would also be the possibility of specifying the row corresponding to any match number. that's not what this query is showing, so i suspect that at some point blank rows are being inserted for each possible match number into a unique table for each new season, then someone goes through editing/updating every row with the division, HomeTeam, and AwayTeam, with code repeated for each hard-coded match number? if so, there's a huge amount of unneeded code.
  20. are you sure the php statement is being executed before any output has been sent to the browser? do you have php's error_reporting set to E_ALL and display_errors set to ON?
  21. a) you somehow marked your last post as being the post that solved the thread. b) we cannot tell you what is wrong with your code unless you post your code and tell us what sort of problem or error you having with that code.
  22. we cannot specifically tell you why your code doesn't work because we don't know what your code is. you likely have repeated id's in the html, conflicts in some javascript, ... in general, trying to copy/pasted together web pages using include statement only works for very simple pages. there's no telling what sort of interaction you are having without seeing the code. you have got a complete web page that doesn't function. you would need to post code that reproduces the problem to get help with it.
  23. because he didn't attempt to make use of any of the suggestions in the previous thread.
  24. just an fyi - i downloaded the offending script, put in my database connection credentials, ran the .sql script to create the database tables, and both registration and login work as expected.
  25. ummm. no he didn't. go back and read the title and first post in that thread. the posts you made in that other thread have been removed, because you did hijack it. that other thread isn't someone USING the same code. it's someone asking for opinions about that code, before he starts to write his own login script. what have you done to troubleshoot what your code is doing in your browser and on your server? do you have javascript turned on in your browser? are you requesting the form page using its URL on your web server so that the php code would even be executed?
×
×
  • 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.