Jump to content

keeB

Staff Alumni
  • Posts

    1,075
  • Joined

  • Last visited

Everything posted by keeB

  1. Yes! Great. The reason I posted it in python was because I dont have a PHP environment handy
  2. Answering this question because I like the name Hillary. $query = "SELECT * FROM records WHERE firstName LIKE "$firstName%" \ //THIS IS LINE 28!!! OR lastName LIKE "$lastName%" \ OR age LIKE "$age%" \ OR sex LIKE "$sex%" \ OR raceName LIKE "$raceName%" \ OR distance LIKE "$distance%" \ OR city LIKE "$city%" \ OR state LIKE "$state%" \ OR date LIKE "$date%" \ OR time LIKE "$time%" \ OR place LIKE "$place%" \ OR divPlace LIKE "$divPlace%" \ OR pace LIKE "$pace%""; That should solve your problem
  3. Yeah I bet there was just a problem using fputs. This is the area where PHP really gets messy. Glad it's working now!
  4. So it sounds like you just need a way to glue it together -- meaning, have 1 file which maps all of the actions/commands to the other files. You can implement this as a proxy[1] (which I like) .. or as a Flyweight[2], which could also be nice depending on your needs 1: http://en.wikipedia.org/wiki/Proxy_pattern 2: http://en.wikipedia.org/wiki/Flyweight_pattern
  5. the else is being executed?
  6. From the manual: <?php $fp = fsockopen($host, 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: www.example.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); } ?>
  7. Thats an elegant solution, soak. Pseudo-code: <?php $q = 'select * from events where e_start = '...''; $event_dates = array(); //hold the dates of the events $result = mssql_query($q); while ($row = mysql_fetch_assoc($result)) { print_r($row); //debug, remove when not testing $event_dates[$row['e_start']] = "hi my name is keeb and i want to be your friend"; } print_r($event_dates); // debug, make sure it was populated . . . later on in mk_drawcalendar.. if(array_key_exists($row['e_start'], $event_dates)) // is e_start in event_dates?? { // YES! print "woohoo it's there!"; echo "<td class='tcell'>"; echo "<a href=\"http://www.runningprofiles.com/test2.php?month=$d-$m-$y\" rel=\"facebox\" onClick=\"document.f.eventdate.value='$m-$d-$y';\">$d</a>"; echo "</td>\n"; } else { print "crap there's no event "; echo "<td class='tcell'>"; echo "$d"; echo "</td>\n"; } ?>
  8. PHP user probably doesn't have permission to open sockets on your system.
  9. http://php.net/mysql Time to start reading
  10. Keep in mind that code is in python, not php. Somehow you're going to read that content (points.html) in to a string and explode it.
  11. Well, shit. I was expecting the PHP file you uploaded to be purely php. In this case it has a mix of both?
  12. Until you want to extend your system to do something you haven't thought of yet. There's pros and cons to each approach. You can have a modular design that incorporates plugins!
  13. Read the file using fopen (http://php.net/fopen) and fread(http://php.net/fread) in to $file_str, and... eval($file_str)
  14. Here's a really dumb way of doing it. (in python): str = """<TR><TH>name</TH><TH>header1</TH><TH>header2</TH><TH>header3</TH><TH>header4</TH><TH>header5</TH></TR> <TR><TD>name1</TD><TD>7</TD><TD><BR></TD><TD>-60</TD><TD><BR></TD><TD>30</TD></TR> <TR><TD>name2</TD><TD>7</TD><TD><BR></TD><TD>96</TD><TD><BR></TD><TD>161</TD></TR> <TR><TD>name3</TD><TD>7</TD><TD><BR></TD><TD>82</TD><TD><BR></TD><TD>285</TD></TR> <TR><TD>name4</TD><TD>7</TD><TD><BR></TD><TD>39</TD><TD><BR></TD><TD>59</TD></TR>""" odd = 0 for i in str.split('<TR>')[1:]: if odd == 0: print '<tr class="row1">%s' % i odd = 1 else: print '<tr class="row2">%s' % i odd = 0 instead of using split use explode -- http://php.net/explode Or, do it in python and replace str with: f = open('points.html', 'r') str = "".join(f.readlines()) f.close() . . . rest of code from above Outputs: <tr class="row1"><TH>name</TH><TH>header1</TH><TH>header2</TH><TH>header3</TH><TH>header4</TH<TH>header5</TH></TR> <tr class="row2"><TD>name1</TD><TD>7</TD><TD><BR></TD><TD>-60</TD><TD><BR></TD><TD>30</TD></TR> <tr class="row1"><TD>name2</TD><TD>7</TD><TD><BR></TD><TD>96</TD><TD><BR></TD><TD>161</TD></TR> <tr class="row2"><TD>name3</TD><TD>7</TD><TD><BR></TD><TD>82</TD><TD><BR></TD><TD>285</TD></TR> <tr class="row1"><TD>name4</TD><TD>7</TD><TD><BR></TD><TD>39</TD><TD><BR></TD><TD>59</TD></TR>
  15. Update your mk_drawCalendar function. While drawing each day, check to see if there are events in the DB, if so, do whatever you'd like. If not draw as normal.
  16. What you're looking for is eval. http://us3.php.net/eval
  17. http://us3.php.net/strtotime fyi
  18. Well here's the thing.. In order to provide plugin support you need some sort of glue. That is, something that maps your plugins to your architecture. This is actually the hardest part of a plugin system. I suggest you spend some time thinking about what you want your plugins to be able to do, and what they should not be able to do. Once you come up with this, we can start providing a bit more information.
  19. Ignore what the guy above me said. He's not thinking too clearly. Let's take a step forward, ironman. How about you start by implementing the database for the form and we can go about pulling that data out and translating that to a table.
  20. Yeah I completely screwed up and misread your intent. Can you paste an example points.html and also paste a manual example of what you'd like to do with it?
  21. Provide a uid unique to the url which circumvents the login process http://url/course_videos.php?a=letmein
  22. The fact that you're not getting an error is what's troubling me still. Are you familiar with XDebug? If you could run it through the debugger to find out where it's exiting it could give more information.
×
×
  • 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.