Jump to content

AndieB

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by AndieB

  1. Hi all! I have a very strange situation. I have a webpage, built using PHP, where a visitor shall register his/her first name, last name, e-mail, phone and that choose a dish from a drop-down list. All this takes place using a form that is posted to a "process.php" script which validates the form and then put the data into SESSIONs. A confirm page shows the entered data to the visitor before it is being stored into a database. Pretty common scenario I would assume. The problem I face, is that empty data are being put into the database. After some communication with some of the visitors, I've managed to narrow it down to be related to Apple iPad and/or iPhone users who try to enter their information. Pretty weird! Anyone else who have experienced this? Maybe someone have a solution? Many thanks in advance! Sincerely, Andreas
  2. Hi all GURU's, I have a problem with UTF-8 characters when I post values/data from my MySQL database into the OPTIONs that I use when using a SELECT in my FORM. The PHP script files are in format UTF-8. The database, the tables and the columns are all set in UTF-8. The charset in the META-tag for the html output is set to UTF-8. All other text that is fetched from the database shows my characters (Swedish å ä ö) the right and correct way, EXCEPT when I echo the data in the OPTIONs in my SELECT box. What can I do? Sincerely, Andreas
  3. Thank you very much! This one was really interesting! I'll investigate it further! --Andreas--
  4. Hi all, I am new to this AJAX concept. Have walked through a couple of "tutorials" and get a bit of an idea of how things work out. But I seem not to understand how to get the following in place. [*]A webpage with an INPUT field of type Text [*]User should start a type a country name and it should lookup from a database (live search) [*]When user notices that the correct country is shown, he/she should just hit enter to "select" it. If user finds the correct country two rows down, he/she should be able to step down with the arrow-keys and hit enter to autofill it in the text field. How do I get the above in place? Thankful for any kind of help or script examples or tutorials. Sincerely, Andreas
  5. Hi, if I fetched some data into a string from a database, how do I remove the NL (new line) in the string?? Could be a case where I also get a POST from a FORM treated by PHP. Thankful for any kind of help! Sincerely, Andreas
  6. Hi all, I'm going to load a CSV file and then take the data and do a MySQL insertion. Of course, that is just to import with MySQL, but I need to do some testing of the data first, in order to see into what table the data should be put. Positive values will go into one table and negative values into another. Now, the CSV file I've got, is in UTF-8 charset. When testing this simple code: <?php $row = 1; $handle = fopen("finance.csv", "r"); while (($data = fgetcsv($handle, 0, ";")) !== FALSE) { $num = count($data); echo "<p> $num fields in line $row: <br /></p>\n"; $row++; for ($c=0; $c < $num; $c++) { echo $data[$c] . "<br />\n"; } } fclose($handle); ?> I get a problem. It does not show the data correctly. I've modified the script to look like this: <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> </head> <body> <?php $row = 1; $handle = fopen("finance.csv", "r"); while (($data = fgetcsv($handle, 0, ";")) !== FALSE) { $num = count($data); echo "<p> $num fields in line $row: <br /></p>\n"; $row++; for ($c=0; $c < $num; $c++) { echo $data[$c] . "<br />\n"; } } fclose($handle); ?> </body> </html> But that did not help at all. What am I doing wrong? How should I make sure that the CHARSET becomes correct? Thank you for any kind of help! --Andreas
  7. Yes, I can imagine that it is indeed a very profitable Service to provide. There is a Service with the name go2webinar.com who has kind of the functionality that I am after. Thought that there would be some sort of OpenSource for this as well. I mean, there are ShoutCAST applications for free where you can connect and stream your audio to listeners... so it must exists some sort of application that can combine audio AND video. But I'll keep on searching. Thank you for your reply!
  8. Hi, I'm looking for an application (webbased) that can reside on a host (Linux/Windows) which will stream my video/audio to all who login to my page. I've searched and found some companies that provides such services, but I am looking for tools/applications that I can run/host myself on my own hardware. Anyone got any suggestions? Thank you in advance! Sincerely, Andreas
  9. I used a Windows installer. But I managed to solve it. I downloaded the ZIP file and in that, I found ALL the .dll files. Thank you for your willingness to help! --Andreas
  10. AndieB

    Help with MATH

    Excuse my lack of knowledge, but what is weighted percentage? Sincerely, Andreas
  11. Hi all, I just installed Apache 2.2, PHP5 and MySQL on my laptop. It worked fine and was quite easy. Then I downloaded the phpMyAdmin application. This application complains and alerts me the mcrypt and mbstring needs to be in place in order to function properly. I checked the PHP.ini file and found nothing about mcrypt. Did some search and found an article that I have to add extension=php_mcrypt.dll. But I then noticed that a mbcrypt.dll file is missing and I can not find it anywhere. Any kind soul who can help me out? Sincerely, Andreas
  12. AndieB

    Help with MATH

    Hi all, I need some help learning doing math calculation, hopefully you guys here can help me out. How do you make a TOTAL percentage correctly calculated if the TOTAL percentage is based on lets say 5 other average percentage. Example: I have five (5) tables, lets call the T1 through T5. In each table, I have five (5) rows, lets call these R1 through R5. Each row, states only TRUE or FALSE. So, it could look like this: T1: R1=FALSE, R2=TRUE, R3=TRUE, R4=FALSE, R5=TRUE So in order to calculate the percentage of HOW many are in status TRUE, the calculation would be made like this: 3 ROWS have value TRUE. So, 3 divided by 5 (number of total ROWS) will equal 0,6, which is 60%. Now, for the rest of the tables it could look like this: T1 = 60% T2 = 60% T3 = 80% T4 = 20% T5 = 0% If I now want to give an overall percentage for all the tables percentage values, HOW do I do the math for that? Is it as simple as (60+60+80+20+0)/5 ?? Anyone got some feedback about this? Thanks in advance, Andreas
  13. Hi all, I've got a Javascript code (in an external file) that has the function to validate values in a FORM. Now, I've created my webpage to support more than one language, this by creating a lang.php file where variables are set. As an example eng.lang.php looks like this: $langpack["title"] = "Welcome!"; and for another language, Swedish, the "almost" same file looks like this: $langpack["title"] = "Välkommen!"; Based on the visitors selection of language, the relative language file is included. My question now is: Is it possible to put PHP variables in a Javascript, so that it is processed when the page is loaded and the PHP variables are replaced with values that Javascript can interpret? In my current Javascript code for validating the FORM, is something is not according to my rules, an ALERT box appears, but the text is in English. I would like to be able to use my *.lang.php files variables together with Javascript, so the ALERT boxes displays the message in the language that the visitor has choosen. Am I clear with what I want to achieve? Thank you in advance! Sincerely, Andreas
  14. My Query looks something like: $sqlQuery = "SELECT e_ticketbuyer.*, events.title, events.date, events.city, events.country FROM e_ticketbuyer, events WHERE events.e_id = e_ticketbuyer.e_id Or is there a better way to write it? But, also the main question: When doing a mysql_fetch_assoc for a SQL query, HOW do I differ the fields based on above query? Sincerely, Andreas
  15. No, what I meant I solved, was to extract the table layout. --Andreas
  16. Think I solved it. Here is first table, called EVENTS. Field Type Null Key Default Extra e_id int(11) NO PRI NULL auto_increment e_title varchar(250) YES NULL e_date date NO MUL e_starttime time NO e_stoptime time NO e_regstart time NO e_regstop time NO e_city varchar(250) NO e_country varchar(250) NO e_venue varchar(250) NO e_address varchar(250) NO e_map_lat double NO 0 e_map_lng double NO 0 e_manager varchar(250) NO e_man_email varchar(250) NO e_man_phone varchar(20) NO e_num_tickets varchar(250) NO e_max_tickets_buyer int(5) NO e_guest_tickets int(2) NO 0 e_end_res_date date NO e_last_payday datetime NO e_reggable tinyint(2) NO 0 The second table, called E_TICKETBUYER: Field Type Null Key Default Extra e_id int(11) NO PRI NULL auto_increment e_title varchar(250) YES NULL e_date date NO MUL e_starttime time NO e_stoptime time NO e_regstart time NO e_regstop time NO e_city varchar(250) NO e_country varchar(250) NO e_venue varchar(250) NO e_address varchar(250) NO e_map_lat double NO 0 e_map_lng double NO 0 e_manager varchar(250) NO e_man_email varchar(250) NO e_man_phone varchar(20) NO e_num_tickets varchar(250) NO e_max_tickets_buyer int(5) NO e_guest_tickets int(2) NO 0 e_end_res_date date NO e_last_payday datetime NO e_reggable tinyint(2) NO 0 Hope this helps.
  17. How do I extract the structure via phpMyAdmin so that will become readable in this forum? Sincerely, Andreas
  18. Thank you very much! It seems to work like I want it! I experienced another interesting thing though. In the first table I've used the pre-fix e_ to identify what "application" the belong too. Now, this goes also for table2 AND this makes me thinking. In table1 I've got the following field: e_city In table2 I've got the same field: e_city When I do a mysql_fetch_assoc to obtain the data from my sqlQuery in PHP, HOW will I know which of these fields I'm showing, when echoing: $row["e_city"] ?? Am I fuzzy or clear in my description? Thank you again for your answer! Sincerely, Andreas
  19. Hi all, I've read many posts about JOIN, LEFT JOIN, RIGHT JOIN.. I guess every JOIN alternative I could get hold of, but I must admit that it confuses me. What I would like to achieve is the following. I have two tables. Table one consists of user information and one field (e_id) which is relative to a post that exists in the second table. I want to get ALL the fields from TABLE1 and get only three fields from TABLE2. That match that must take place is that the e_id field is equal in both tables. HOW do I write this query?! Thankful for any kind of help! Sincerely, Andreas
  20. That was the solution!! Thank you very much webster08! Sincerely, Andreas
  21. Thank you for your answer. But window.open() opens up a brand new window. I want the page to be opened in the same window, just like if I was using a <A HREF...> TAG, but it should act when clicking on the ROW in the TABLE. Sincerely, Andreas
  22. Hi all, I've created the following PHP script: <?php $bgcolor = "#aabbcc"; while ($sqlRows = mysql_fetch_assoc($sqlResult)) { $bgcolor = ($bgcolor == "#aabbcc")?"#ffffff":"#aabbcc"; echo "<tr style=\"background-color: " . $bgcolor . "\" onMouseOver=\"style.backgroundColor='#D87093'\" onMouseOut=\"style.backgroundColor='" . $bgcolor . "'\" onClick=\"document.open('event_info.php?e=" . $sqlRows["e_id"] . "', '')\" >\n"; echo "<td id=\"listLeft\" ><a href=\"event_info.php?e=" . $sqlRows["e_id"] . "\" target=\"_self\" >" . $sqlRows["e_date"] . "</a ></td >"; echo "<td id=\"listMiddle\" ><a href=\"event_info.php?e=" . $sqlRows["e_id"] . "\" target=\"_self\" >" . $sqlRows["e_city"] . "</a ></td >"; echo "<td id=\"listRight\" ><a href=\"event_info.php?e=" . $sqlRows["e_id"] . "\" target=\"_self\" >" . $sqlRows["e_country"] . "</a></td >\n"; echo "</tr >\n"; } ?> My problem is that when I click the row it does only open a BLANK page. I want it to open the event_info.php file and send the value with it so the PHP script can run through the database and fetch the data in order to present it. But again, my result above only creates a BLANK white page. What am I doing wrong? Thankful for any kind of help! Sincerely, Andreas
  23. Hi all, I'm about to upgrade to PHP5 on one of my domains that are being hosted by www.one.com. Now, I am not familliar with what differencies there are between PHP4 and PHP5. I'd like to know what could go wrong and what must be changed in my PHP scripts that worked in PHP4 and that will not work in PHP5. Anyone have some ideas? Sincerely, Andreas
  24. Hi Ken!! Thank you very much! Now I recognize the row that I was talking about: $bgcolor = ($bgcolor == "#445566")?"#667788":"#445566"; What is this called when you use a ? character and a : ?? It somehow switches the values, right? Again, thank you very much! Sincerely, Andreas
  25. Hi all, I'd like to create a javascript that changes the background-color of a ROW in a table when moving the mouse pointer over the ROW. I've seen some examples, but these examples have written the background-color values static in each <TR> tag. I want a function that should be called upon. Is it possible to FETCH the current background-color value in the onmouseover function to be used by the onmouseout function, so that the background-color goes back to its origin color? The reason I ask, is because the TABLE itself and the ROWS/CELLS are created with PHP script and in that SCRIPT the background-color value is defined in a STRING. Anyone who can assist me? Thank you in advance! --Andreas
×
×
  • 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.