postbil.com
Members-
Posts
32 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
postbil.com's Achievements
Member (2/5)
0
Reputation
-
run Windows programs in Internet Explorer or other browsers
postbil.com replied to postbil.com's topic in Applications
All kind of windows application, like MS Word or NuSphere PhpED -
Hello Phpfreaks. I've got a challenge from one of my friends. To create an Internet-based system that makes it possible to run Windows programs in Internet Explorer or other browsers. Do you got a suggestion? I seek not the entire code to solve the problem. But just some advice or features that make it all possible .. Please help me. Postbil.com
-
Hello Is there anyone here who can answer me if it is possible to get stock prices into a php script? to use the rate constant feedback to a stock market game. I hope someone can help .. Postbil.com
-
Hello Phpfreaks.. I had a little problem by insetting a timestamp in to a MySQL table. I have two timestamps $ts1 & $ts2 but all the time I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'header ="test", startTs ="1309680000", ' at line 2 Here is the code where I try to insert the timestamp. $query = 'insert user_calendar header ="' . mysql_real_escape_string($header, $db) . '", startTs ="' . mysql_real_escape_string($ts1, $db) . '", endTs ="' . mysql_real_escape_string($ts2, $db) . '", subject ="' . mysql_real_escape_string($subject, $db) . '", userCalendarID = "' . mysql_real_escape_string($site_user['userID'], $db) . '"'; mysql_query($query, $db) or die(mysql_error($db)); Here is the code where I create the table to database: $query = 'CREATE TABLE IF NOT EXISTS user_calendar ( userCalendarID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, header VARCHAR(50) NOT NULL, startTs DATETIME NOT NULL, endTs DATETIME NOT NULL, subject VARCHAR(255) NOT NULL, PRIMARY KEY(userCalendarID) ) ENGINE=MyISAM'; mysql_query($query, $db) or die (mysql_error($db)); Can someone please tell me what I do wrong!! Postbil.com
-
Yes yes.. It works.. That so nice.. Thanks a lot!!
-
Hey Phpfreaks. I had a littel problem with my calendar script. I want i that way, then I click at the current day it reload the script (But only the calendar function) and remember which day there is selected. The problem is then I reload the script it just display ”0”. Can somebody please help me.. Postbil.com <?php function calendar (){ // selecct the current timezone date_default_timezone_set('Europe/Paris'); // accept incoming URL parameter $timestamp = (isset($_GET['t'])) ? $_GET['t'] : time(); $tsDM = (isset($_GET['tsDM'])); // Here I get the infomation about witch day the user had selected // determine useful aspects of the requested month list($month, $day, $year) = explode('/', date('m/d/Y', $timestamp)); $first_day_of_month = date('w', mktime(0, 0, 0, $month, 7, $year)); $total_days = date('t', $timestamp); // output table header echo '<h8>'; echo '<table id="calendar">'; echo '<tr id="calendar_header"><th colspan="7">'; echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?t=' . strtotime('-1 month', $timestamp) . '"><</a> '; echo date('F', $timestamp) . ' ' . $year; echo ' <a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?t=' . strtotime('+1 month', $timestamp) . '">></a>'; echo '</th></tr>'; echo '<tr><th>Man</th><th>Tir</th><th>Ons</th><th>Tor</th><th>Fre</th>' . '<th>Lør</th><th>Søn</th></tr>'; // output date cells // here the loop started, to show the current day. $current = 1; while ($current <= $total_days){ echo '<tr class="calendar_dates">'; for ($i = 0; $i < 7; $i++){ if (($current == 1 && $i < $first_day_of_month) || ($current > $total_days)){ echo '<td class="empty"> </td>'; continue; } // find the correct timestamp at day. $tsDMY = urlencode(mktime(0, 0, 0, $month, $current, $year)); // Here we save a timestamp with infomation about Month, Day, Year $tsDM = urlencode(mktime(0, 0, 0, $month, $current, 0)); // Here we save a timestamp with infomation about Month, Day // Print the actual date echo "<td>"; // here I make a link. // I use the "' . htmlspecialchars($_SERVER['PHP_SELF']) . '?tsDM=$tsDM" function before i want my page page only to reload the calender function, and remember witch day the user had selected. The $tsDM have to be sendt echo '<centerI><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?tsDM=$tsDM">' . $current . $tsDM . '</a></center>'; echo "</td>"; $current++; } echo '</tr>'; } echo '</table>'; echo '</h8>'; echo $tsDM; // Here I print the selected timestamp. }
-
Hello Phpfreaks. I had created a calender, but I tryed to send a timestamp, in a link and print the timestamp under the calendar. But it dosent work.. can somebody please help me !! <?php function calendar (){ // selecct the current timezone date_default_timezone_set('Europe/Paris'); // accept incoming URL parameter $timestamp = (isset($_GET['t'])) ? $_GET['t'] : time(); $tsDM = (isset($_GET['tsDM'])); echo $tsDM; //test // determine useful aspects of the requested month list($month, $day, $year) = explode('/', date('m/d/Y', $timestamp)); $first_day_of_month = date('w', mktime(0, 0, 0, $month, 7, $year)); $total_days = date('t', $timestamp); // output table header echo '<h8>'; echo '<table id="calendar">'; echo '<tr id="calendar_header"><th colspan="7">'; echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?t=' . strtotime('-1 month', $timestamp) . '"><</a> '; echo date('F', $timestamp) . ' ' . $year; echo ' <a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?t=' . strtotime('+1 month', $timestamp) . '">></a>'; echo '</th></tr>'; echo '<tr><th>Man</th><th>Tir</th><th>Ons</th><th>Tor</th><th>Fre</th>' . '<th>L�r</th><th>S�n</th></tr>'; // output date cells $current = 1; while ($current <= $total_days){ echo '<tr class="calendar_dates">'; for ($i = 0; $i < 7; $i++){ if (($current == 1 && $i < $first_day_of_month) || ($current > $total_days)){ echo '<td class="empty"> </td>'; continue; } // find the correct timestamp at day. $tsDMY = urlencode(mktime(0, 0, 0, $month, $current, $year)); $tsDM = urlencode(mktime(0, 0, 0, $month, $current, 0)); // Print the actual date echo "<td>"; echo '<center><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?tsDM=$tsDM">' . $current . '</a></center>'; echo "</td>"; $current++; } echo '</tr>'; } echo '</table>'; echo '</h8>'; echo $tsDM;
-
I had a little problem With the include() function
postbil.com replied to postbil.com's topic in PHP Coding Help
Yes yes, that great.. It works perfect thanks a lot -
I had a little problem With the include() function
postbil.com replied to postbil.com's topic in PHP Coding Help
Do you have a way to work behind this error? -
I had a little problem With the include() function
postbil.com replied to postbil.com's topic in PHP Coding Help
okay.. I hat try to change the code: $validate = realpath('includes/userData.inc.php'); include $validate; But I Still get an error. include() [function.include]: Filename cannot be empty in C:\xampp\htdocs\modules\updateUser.inc.php -
Hello Phofreaks. I had a little problem With the include() function. 1.Example – works fine $validate = 'C:\xampp\htdocs\includes\userData.inc.php'; include $validate; 2.exampel – Get an error $validate = '../includes/userData.inc.php'; include $validate; I do not understand what the different is, but every time I get the following error. include(../includes/userData.inc.php) [function.include]: failed to open stream: No such file or directory - Postbil.com
-
I have a little problem with creating a timestamp and display it again with date () Here is a small shript: <?php $day = 6; $month = 7; $year = 1985; $ts = mktime($month, $day, $year); echo date("d-m-Y",$ts); ?> In my world would result in 6-7-1985 but instead I get 06-11-2010 Why .. what am I doing wrong? POSTBIL.COM
-
thanks a lot.. it works
-
Hello Phofreaks Now I have a new problem. I had created a date validation function after the script has been validated by the day, I will create a timestamp. If I print the time stamp to the screen directly from the function it works fine, but if I print it from my html form, I get nothing. how can it be? And in my role, I have some error messages, but if I make a mistake, do not I get an error. Is there someone who can explain to me what is going wrong?? Thank postbil.com Here is my function [function.php] <?php function validateDate($date, $tsDate, $errors){ if(!preg_match('|^\d{2}-\d{2}-\d{4}$|', $date)){ $errors[] = urlencode('error date. dd-mm-yyy'); }else{ list($day, $month, $year) = explode('-', $date); if(!checkdate($month, $day, $year)){ $errors[] = urlencode('error date. dd-mm-yyy'); }else{ $tsDate = mktime(0, 0, 0, $month, $day, $year); echo $errors; echo $tsDate; } } } ?> And here is my html form [send.php] <?php include ('function.php'); ?> <html> <head> </head> <body> <form action="send.php" method="post"> <input type="text" name="date" > <input type="submit" name="submit" value="send"> <?php if(isset($_POST['submit']) && $_POST['submit'] == 'send' ){ global $tsDate; $date = isset($_POST['date']) ? trim($_POST['date']) : ''; validateDate($date, $errors, $tsDate); echo $tsDate; echo $errors; } ?>
-
Thank you all .. But I have just two more questions .. How can it be that readdir () will always be '. " and '..' even if the folder is empty? and how can I give you poing?