Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Everything posted by ober

  1. Well, the way to search a file for a string is to read it into either a string or an array and search those. As for the most efficient, if you're just looking for a specific string in the entire file, I'd suggest just reading it all into one string. In 98% of all other cases, I'd suggest reading it into an array. You can just as easily search the array as well.
  2. *looks around... resizes window... throws up hands* I don't know what you're talking about.
  3. [!--quoteo(post=370435:date=May 1 2006, 08:33 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 1 2006, 08:33 PM) [snapback]370435[/snapback][/div][div class=\'quotemain\'][!--quotec--]I assume anyone who can speak/write more one language is pretty smart.[/quote] While I agree with you on some levels, that's a fairly big assumption.
  4. I'm changing the title of this thread to be lower case... there is no reason for an all caps title for this thread. Don't do it again businessman.... you've already been warned twice about stuff on these forums... you're on thin ice as far as I'm concerned.
  5. I'd say you're pretty much screwed. There is no "undo" with MySQL, and phpMyAdmin doesn't have any feature that will help you either. This is why people constantly preach about backups. Do it or pay. Looks like you're going to pay.
  6. ober

    PHP and XML

    That will probably help someone, but I don't personally have any experience in that area. But I'll bump the thread again for you just in case someone else does.
  7. From the manual: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]To format dates in other languages, you should use the setlocale() and strftime() functions instead of date(). [/quote]
  8. My math may be a little off. Try changing this: $id = substr($key,11); To this: $id = substr($key,10); Or just play around with that to make sure you're getting the entire ID out of the POST variable. Also, you can remove the while loop since you should only have to call that mysql_fetch line once.
  9. I edited your title. I normally just ignore the bad grammer if I can understand the question. Some people here really butcher the language, but if you can get your point across enough to explain your problem, your question is going to be answered. Do I care? Sometimes. I feel like if you expect to get help from an english-speaking board, you should at least try to get most of the grammer right. And granted, most do, but it seems like some people either just started learning english the day before or they don't really care.
  10. ober

    PHP and XML

    Alright... you don't need to get snippy. You could have explained yourself a little better.
  11. This might help you... but you'll have to have access to enable the extension: [a href=\"http://us3.php.net/manual/en/ref.mcal.php\" target=\"_blank\"]http://us3.php.net/manual/en/ref.mcal.php[/a]
  12. ober

    PHP and XML

    Maybe you should ask them what they mean first. If they just want to store XML files on your server, that's nothing more than a normal upload script.
  13. Alright... that makes a little more sense. However, might I suggest a slight modification? I assume you have IDs associated with each candidate, correct? I'd suggest using the IDs as the names instead of the candidate names because you're going to run into issues with spaces being converted in the URL and so on and so on. Beyond that, I also suggest the following: Name your radio button groups like this: [code]<input type="radio" name="candidate_'.$arr1['ID'].'" value="1"/>[/code] Then in your processing, use a simple foreach loop to pull those out and manage them seperate from your other form elements (if there are any): [code]foreach($_POST as $key => $val) {      if(substr($key,0,10) == 'candidate_')      {           $id = substr($key,11);           // run query to get name from ID           echo "candidate x has been given a rating of $val";      } }[/code] Does that help?
  14. You're going to have to give us more information, and please use code tags when you post code. Are you getting any errors? Is any of the data showing up in the second table correctly? And I can only assume that the PHP code is on a different page after they submit it, correct?
  15. I'm not sure you understand how radio buttons work: 1) If you have a group of radio buttons, they all have the same name. 2) The value of the one that is selected will be passed as the result. <input type="radio" name="asdf" value="1">blah <input type="radio" name="asdf" value="2">blah <input type="radio" name="asdf" value="3">blah <input type="radio" name="asdf" value="4">blah <input type="radio" name="lkjh" value="1">blah <input type="radio" name="lkjh" value="2">blah <input type="radio" name="lkjh" value="3">blah <input type="radio" name="lkjh" value="4">blah Then in the post, you'll have $_POST['asdf'] and $_POST['lkjh'] with a value between 1 and 4. If that doesn't clear it up, please rephrase your question. I think your problem is that you're putting the array value as the name instead of the value.
  16. Your form is not laid out very well and the last few questions are pretty pointless if the user didn't look at the download yet (like me). You might want to provide a "N/A" option for the last few.
  17. It looks pretty professional, but you've got a few issues, as mentioned by the others. My main complaint is the initial load. If I had been on dialup, I could have gone and grabbed a sammich by the time it was done loading. > 600kb for the index is simply unnacceptable, especially with the amount of content you have. Most of that should be CSS and text. I'm not even sure where the size is coming from. Also, you need to fix your rounded edges on the column header images. Not only is it a poor job of creating the curve, but there's barely enough curve to even notice that there is one. Either remove it and just use CSS or make it more dramatic. Short of those few things, it looks really good!
  18. So I have a project where I'm graphing 2 recordsets against each other, and each recordset contains 12000 records. I first pull the data out of a database and dump it into arrays, then I feed those arrays to the graphing function. The users have the option to graph up to 5 channels (columns of data) at a time, so before I was checking to see if the channel was selected and then adding a value to that specific array. What I've done (and I've run the timing numbers and it is faster) is to calculate the total number of channels that have been selected and us a switch without breaks to figure out how many I have to fill: [code]    if($result && mssql_num_rows($result) > 0)     {         $d0 = array();         $d1 = array();         $d2 = array();         $d3 = array();         $d4 = array();         while($row = mssql_fetch_array($result))         {               switch($fldcnt)             {                 case 5:                     $d4[] = $row[5];                 case 4:                     $d3[] = $row[4];                 case 3:                     $d2[] = $row[3];                 case 2:                     $d1[] = $row[2];                 case 1:                     $d0[] = $row[1];                 break;             }         }     }     else     {         $t1ok = false;         echo '<br/><br/><p class="warn">There is no 10Hz data for test 1.</p>';     } [/code] I guess I'm just curious if someone would have a better way to do this, as I think I've come up with the best solution.
  19. Templates would be the preferred option in most if not all cases.
  20. Just FYI, your database is very poorly designed. You need to look up normalization and split that stuff into multiple tables.
  21. ober

    ip address

    You must save the file with a PHP extension unless your PHP installation is configured to parse html pages.
  22. There's not going to be an easy way to do this unless you can programatically grab the information out of the PDF and stuff it into a database. You're still going to have to go through the content and do formatting and so on. My suggestion is to create a table for "topics" or "products" or whatever you want to call them. Put the content for each item in a seperate record and then create one page that pulls the correct information out of the database. If the layout for each item is similar, you can leave most of the formatting to the one PHP page and seperate your product content into various fields (item number, serial number, description, etc) and format it as you pull it out of the database. I don't know what you're looking for as far as a specific answer, so I hope that helps.
×
×
  • 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.