Jump to content

zenlord

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

zenlord's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. http://be.php.net/manual/en/cairo.requirements.php Are those requirements fulfilled? Did you install the library or not? V
  2. What you really want to do, seems like a possible security-flaw to me: fetching external scripts to run on your server... Wouldn't an account with f.e. github not be better? You put all classes together, you can maintain your code very easily and everytime you make some adjustments, you can simply fetch the updates with git...
  3. zenlord

    Help

    Between these lines: $result = ... $url = ... You just add a new check: if ($newCat !="") { mail($to, $subject, "Cat has been changed to $newCat"); } More info on mail: http://be.php.net/manual/en/function.mail.php Vincent
  4. That doesn't look right: $_POST["row['course_id']"] You should add name="courseid" to your <select> and then change the line 'course_id' => $_POST["row['course_id']"]); to 'course_id' => $_POST["courseid"]);
  5. Those 'inputs' that you echo should be part of a new <form method="post" action=""> with action set to the php-script to handle the POST-vars and insert them into a table.
  6. Did you read the 'common pitfalls' on the setcookie-page? Things I can think of: * If you set or delete a cookie, it is visible when the page is reloaded - do you reload your page before checking? * You use single and double quotes together * Try explicitly setting the value of the cookie to 'false' - no need to set the time in the past, that is something that is done internally by PHP
  7. Example of PHP-framework? The best-known are Zend, CodeIgniter, CakePHP etc. 'Recently' there are a few new competitors that aim to be more lightweight: Kohana, Yii etc. I'll be diving into Kohana the moment I feel at ease using objects. I am now struggling somewhat to make the change... If you want a validation routine, then I guess you should look into the official documentation for PHP Filters. They contain pre-built functions to validate and even sanitize different data formats (strings, numeric, email, url, etc). The examples that are given in that section of the documentation are very good...
  8. I could be completely wrong, but wouldn't this work: class bar extends foo { function foobar($text) { parent::foobar($text); $text = $text . 'c'; return $text; } } So you call the parent-function inside the extended function...
  9. Not confusing at all. Look at the part 'WHERE user = $user_id' in the query I supplied. That is the part that will only return events that are coupled to user with the specified $user_id. If that wasn't clear yet: you should add a column named 'user' to your table 'events' or a column named 'event' to your 'users'-table (one-to-many-relationship), or, if you need to be able to couple more than 1 user to more than 1 event: you should add a table with 2 columns: 1 for 'event_id' and one for 'user_id' in which you can couple more than 1 user to more than 1 event (many-to-many-relationship) If the latter is the solution to your problem, then you weren't really clear on the problem... Zl.
  10. I think he wants to do it the other way around. At the OP'er: You need to process the $_POST['keyword'] into an array (f.e. accept comma's to separate keywords and convert whitespace and other symbols with urlencode()) Then you can use header("Location:http://www.domain.com/default.aspx?st=FT&ss=$keyword") to send the user to that page. (my example will only work when there is only 1 keyword, you need more processing to add multiple keywords to that URL) Vincent
  11. You know how to get all the user names from the table 'users', but you don't know how to get all the event names from the table 'events'? I don't think you have thought it through. Just make a SQL-query SELECT <necessary column names> FROM events WHERE user = $user_id ORDER BY date ASC The $user_id could be put in a session whenever a user logs in on the site, so that you have quick access to the above information.
  12. I guess you really should read up on for-loops... Try changing ++ in -- Or: start at -5 and then ++ until you reach 0...
  13. http://www.php.net/manual/en/book.filter.php Builtin into PHP: functions to validate and to sanitize several data formats: url, email, string, numeric etc. I guess this is the reason you don't find anything new about validation anymore: everyone should be using these filters...
×
×
  • 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.