Jump to content

joel24

Members
  • Posts

    760
  • Joined

  • Last visited

Everything posted by joel24

  1. commented next to modifications. starts at line 181 function array_search_recursive($needle, $haystack, $path=array()){ if (is_array($haystack)) //check that $haystack is an array { foreach($haystack as $id => $val){ $path2 = $path; $path2[] = $id; if(eregi($needle, $val)){ return $path2; } else if(is_array($val)){ if($ret = $this->array_search_recursive($needle, $val, $path2)){ return $ret; } } return false; } } else //if $haystack was not an array, return false. { return false; } }
  2. set the default timezone to europe/london or whichever timezone you're in. put this line at the very top of the script date_default_timezone_set('Europe/London');
  3. seems your server's timezone is set to somewhere around the u.s.a. do this to check echo date('e'); exit(); to set your timezone, use date_default_timezone_set() a list of timezones are here i.e. //using server's timezone echo date('e g:ia d/m/y', 1288393200) . '<br/>'; //change to london date_default_timezone_set('Europe/London'); //same command using london timezone. echo date("e d/m/y g:ia", 1288393200); exit();
  4. it is a timestamp. the time/date (g:ia d/m/y) from that timestamp is 10:00am 30/10/10 if that is not the anticipated date/time, you'll have to have a look at how the timestamps are being inserted into the database.
  5. but what does $row_events['event_date'] echo by itself? change the line <? echo ($row_events['event_date']==""?$row_events['event_name']:date ("D, j F y", $row_events['event_date'])) ; ?> to exit("<p>Value: ".$row_events['event_date']).'</p>'; and post whatever value it prints
  6. all depends on what $row_events['event_date'] returns (format) echo $row_events['event_date']; and post it here.
  7. what value does $row_events['event_date'] return?
  8. the date function takes unix timestamps as its second operator, not a formatted date. if date("c") is returning the wrong date, then it would seem your server is set in a different timezone? http://www.php.net/manual/en/function.date-default-timezone-set.php or //timezone php. change australia/sydney to your timezone as listed on the PHP.net site putenv('TZ=Australia/Sydney');
  9. for the query function in the class I would have the input to be function Query($query, $where, $extra) { //rarrararara $sql = "$query $where $extra"; //execute and return results } then to call it $do->Query("SELECT * FROM users", "WHERE id=1", "LIMIT 1");
  10. then what's the point of having a loop? you're missing the () after num_rows if ($result->num_rows() > 0){
  11. you already have an update query in the code...? $sql = "UPDATE settings SET site_name='$site_name', description='$description', keywords='$keywords', email='$site_email', name='$your_name' WHERE id='$id'"; have a look at some mysql/php tutorials. You'll need to do a select query and then echo the results. start here
  12. you're missing a $ infront of $_POST['username']... you just have _POST['username'] if (!$_POST['id'] | !_POST['userName'] | !$_POST['passWord'] | !$_POST['confpassWord'] | !$_POST['email'] ) {
  13. are you trying to set the primary key on the insert query? or is it an automatically incrementing field?
  14. here is a sandbox site paypal has set up for developers to play around in. and here is the documentation
  15. Yes, if you suspect the website will grow large then you'll want the payments automated, it will be quite time consuming to send out payments manually... and also opens up the risk of human error. Paypal API allows you to make payments automatically with your script The other option is to automatically generate invoices and send these to companies, however then you'll need to either monitor the incoming payments or once again set up your payments applications API to monitor incoming transactions etc etc. Someone else might be able to offer some greater insight, I'm a novice when it comes to automated payments
  16. the mysql IN conditions need to be enclosed in brackets, surrounded by ' if they are strings (no need for integers) and then separated by , i.e. SELECT FROM tables WHERE field IN ('first', 'second', 32, 58) as for the error with the implode function, is $user_id an array?
  17. you're not closing the <span> tag which sets the text to #FF0000 if(count($errors)>0) { $errorText .= "<span style=\"color:#ff0000;\">"; $errorText .= "De volgende fout(en) zijn opgetreden:<ul>\n"; foreach($errors as $errorMsg) { $errorText .= "<li>$errorMsg</li>"; } $errorText .= "</ul></span>" //was span style=\"color:#ff0000;\"; }
  18. % is a wildcard in mysql queries, i.e. WHERE surname LIKE '%a%' will search for anything with a in it. Whilst WHERE surname LIKE 'a%' (like in your code) will search for anything starting with the letter a. In your code you have where SURNAME like '$_POST['name']%'... searching for anything that starts with the form posted surname. Try put this bit of code underneath the $query= line and then you'll be able to see all the values posted from the form and the mysql search string you are generating and then diagnose the problem. print_r($_POST); echo $query; exit(); set the width of the last column using CSS and the others will still have automatic widths set. Shorthand way, you only need to set the width of one cell in the column and all others will follow suit.
  19. for the redirecting, use php's header() function and then exit(); when you want to redirect the user... in your case after the email script header('Location: http://www.yourDomain.com'); exit(); if you want an error or success message, you can redirect to a success or error page or send the error/success in the url with $_GET ... or you could also send it via a session but I wouldn't for a public page. And as for the $_GET error/success And now for the form validation, you can use isset() to ensure that a variable is set if (isset($_POST['email'])) { echo "it is set"; } // exclamation point reverses condition if (!isset($_POST['email'])) { echo "email is not set. Error"; } that should get you started...
  20. surround the new value of the variable in brackets, and also you don't need the square brackets around T in the date function. i.e. class Settings { public static $mysql_datetime_format = ("%c/%e/%Y %l:%i %p " . date("T")); }
  21. increment is done with ++ in a loop, $count++; would increment $count + 1 for each loop. function wp_rss( $url, $num_items = -1 ) { if ( $rss = fetch_rss( $url ) ) { echo '<div id="charts">'; if ( $num_items !== -1 ) { $rss->items = array_slice( $rss->items, 0, $num_items ); } //start count $i = 1; foreach ( (array) $rss->items as $item ) { printf( '<div id="chart_lt">'.$i.'</div><div id="chart_rt">%3$s</div>', esc_url( $item['link'] ), esc_attr( strip_tags( $item['description'] ) ), htmlentities( $item['title'] ) ); //increment $i++; } echo '</div>'; } else { _e( 'An error has occurred, which probably means the feed is down. Try again later.' ); } }
  22. sorry, mixed up a with y. $data = mysql_query("SELECT y.*, (SELECT COUNT(posts) FROM YBK_Ads a WHERE a.UID = y.UID) AS postCount FROM YBK_Login y") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print "<td>".$info['postCount'] . " </td>";Print "<td>".$info['UID'] . " </td>";Print "<td>"."#"."</td>";Print "<td>".$info['ID'] . "</td> "; Print "<td>".$info['Allowed'] . "</td> ";Print "<td>".$info['pass'] . " </td>";Print "<td>".$info['HR'] . " </td>"; } ?>
×
×
  • 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.