|
Use date-default-timezone-set()[^] early in your PHP. That will set PHP time correctly. I don't know how you would set the SQL server time - maybe it has a similar function.
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
|
Thanks. I was pretty sure that it should exist, but didn't know the details (and, to be honest, didn't have the energy to google it). I'm familiar with the PHP one because I work with Apache servers running on 3 different timezones that should all appear to be local.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
You can use php timestamp
|
|
|
|
|
Hi,
You can set the default time zone by using
date_default_timezone_set()
or by
string date ( string $format [, int $timestamp = time() ] )
for more details please see
http://php.net/manual/en/function.date.php[^]
Thanks & Regards
Arya1685
"You are not only responsible for what you say, but also for what you do not say"
|
|
|
|
|
Hello!
I am using Mystique 3.0.7 theme. I just want to ask that how could I make Parent page link not clickable that whenever I place a mouse over that it just show me the sub pages (child pages) under it.
Parent Page: MU|T|MED|A
site : http://www.bani-hafiz.com/mutmeda/[^]
Thank you!
|
|
|
|
|
Hello frndz,
I am trying to connect with web service using SOAP via CURL. I successfully connect with the web service but i am getting following error.
Does any one knows about such kind of error?
Length Required
HTTP Error 411. The request must be chunked or have a content length.
|
|
|
|
|
Basically, the server is telling you that it cannot determine where your input is going to end. You must either
1. use chunked encoding (which has delimiters so the server can parse the incoming stream and detect the logical end of this message) or
2. send a content-length header up front so it can count bytes to detect the end of the message.
It's in the nature of TCP/IP that the application must have a way of delimiting messages - the protocols don't.
Peter
ps At Code Project, we are not 'frndz', whatever else we might be.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
Hi peter,
Thnx for quick response.
I checked my code, I am already passing the Content-length
following is the code.
$header = array(
"POST /XXXX.asmx HTTP/1.1\r\n",
"Host: demo.XXXX.in\r\n",
"Content-Type: text/xml; charset=utf-8\r\n",
"Content-length: ".strlen($soap_request)."\r\n",
"SOAPAction: \"http://tempuri.org/VerifyLogin\"\r\n",
);
But still i am getting the same error.
i found that i am gettin above error in Chrome and Mozilla but in IE6 am getting something like
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Invalid at the top level of the document. Error processing resource
Do You have any idea about these?..
Thanx in advance.
|
|
|
|
|
I don't understand what browsers have to do with it, if you're running PHP code to access SOAP.
I can only come back with my "standard" reply to all "What's happening over a network?" questions. Get Wireshark on the job. Record successful (if any) and unsuccessful exchanges and compare the traces.
Good hunting!
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
I was told this would work, but it is not. I do not know the value in a particular column, but I want to decrease it by a number.
In other words, Dude buys 2 widgets, the inventory of said widget gets reduced by two.
$u_sql='UPDATE sale_inventory SET invqty = invqty - '.$boughtqty.' WHERE invProdID='.$row['ProdID'];
This yields an SQL Statement like:
UPDATE sale_inventory SET invqty = invqty - 1 WHERE invProdID=1234567
I cannot tell why this is not working.
Thanks in advance.
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
The SQL looks fine. Could you show the PHP code that executes the SQL?
|
|
|
|
|
do you have an error message, can you use something like..
$rst = mysql_query($u_sql) or die(mysql_error());
this will print the message coming from the mysql db.
Chris J
www.redash.org
|
|
|
|
|
Thanks for the replys...
I have error checking
$u_result = @mysql_query($u_sql, $link_b);
if (!$u_result) { exit('<p>Error reducing inventory: ' . mysql_error() . '</p>');}
There is no error thrown, just that value is not reduced.
Like an idiot, when scrubbing my data, I probably should have left it... My invProdID has - marks in them, so I needed quotes around them.
Total newb error.
Thank you both anyway. You assurances that it seemed right made me think down the typo path.
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
Actually I want to create a dynamic page using PHP & MYSQL like PMWIKI....iF ANYONE HAVE ANY SUGGESION,PLEASE provide me the details. One more thing I dont want to use PMWIKI, I want to create my own dynamic page.
|
|
|
|
|
I would suggest reading the source code of that or a similar project to get an idea of the scope of this project, how to lay it out and ball park the time you will need to devote to it.
Chris J
www.redash.org
|
|
|
|
|
My first suggestion would be that you DO NOT YELL! For many people there will be a perceived inference that they are not intelligent enough to identify important parts of the question..
My second suggestion would be to do as one always does when programming, and break the problem up into a number of smaller steps/chunks. In essence, the concept is really quite simple:
1) Implement access control system - i.e password=correct, pass=true. password=incorrect, pass=false
2) Devise a way of storing page data in a database
3) Implement a way of adding user-entered text into the database tables used in step 2
None of these 3 steps necessarily need to be complicated in order to provide basic functionality.
I'd expect to be able to bash out some code that would allow me to dynamically add page content if my password was correct in a few hours.
The polishing, refining and adding of other expected features are what I expect to take the absolute bulk of the time.
It's only 1/2 a Mb, why not download the code and take a look at it? You do get all the source code after all.
I've gleaned dozens of tips from the old game engines wolf3d, doom, quake, etc. Yet I've not copy/pasted a single line of code from any of them. Humans 'progress' because we are able to build-upon and extend the work of others..
|
|
|
|
|
Is it possible to have voice recording feature in a php based website.
|
|
|
|
|
|
Is there any free solution for voice recording in php?
|
|
|
|
|
You will need to find out for yourself. Try running that google query with free tossed in. Otherwise just start looking through the results you get from google. This will als o giv you a basic idea as to how they did it, like what tools or language features did they use.
best of luck!
Chris J
www.redash.org
|
|
|
|
|
hello there
i have a form for submiting data into mysql table with the name of TERM_LESSON table in this form i have a sets of checkboxes that came from a table with the name GRADE these are my two tables:
TERM_LESSON
CREATE TABLE IF NOT EXISTS `term_lesson` (
`lid` int(5) NOT NULL,
`gradeid` int(1) NOT NULL,
PRIMARY KEY (`lid`,`gradeid`)
) ENGINE=MyISAM ;
GRADE
CREATE TABLE IF NOT EXISTS `grade` (
`gradeid` int(11) NOT NULL AUTO_INCREMENT,
`gname` varchar(40) NOT NULL,
PRIMARY KEY (`gradeid`)
) ENGINE=MyISAM AUTO_INCREMENT=0 ;
and this is my form:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="<?php echo $editFormAction; ?>" method="post" id="form1">
<table align="center">
<tr valign="baseline">
<td align="right">LID</td>
<td">
<input name="lid[]" type="text" id="lid[]" value="<?php echo $row_rslesson['lid']; ?>" size="32" readonly="readonly" />
</td>
</tr>
<td >GRADE</td>
<td >
<?php do { ?>
<input name="gradeid[]" type="checkbox" id="gradeid[]" value="<?php echo $row_rstotalgrade['gradeid']; ?>" />
<label for="gradeid[]"></label>
<?php echo $row_rstotalgrade['gname']; ?><br />
<?php } while ($row_rstotalgrade = mysql_fetch_assoc($rstotalgrade)); ?></td>
<tr valign="baseline">
<td style="text-align: center"></td>
<td align="right"><input type="submit" value="submit" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
</body>
</html>
i want to make a TABLE ROW in TERM_LESSON for every checkboxes that is selected by user with same LID in form like: (for 2 chekbox seledted)
lid gradeid
11 , 1
11 , 2
and this is my php code for doing that:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
foreach ($_POST['gradeid'] as $i) {
$insertSQL = sprintf("INSERT INTO term_lesson (lid, gradeid) VALUES (%s, %s)",
GetSQLValueString($_POST['lid'], "int"),
GetSQLValueString($i, "int"));
mysql_select_db($database_register, $register);
$Result1 = mysql_query($insertSQL, $register) or die(mysql_error());
}
$insertGoTo = "lesson_term_added.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_register, $register);
$query_rstotalgrade = "SELECT * FROM grade";
$rstotalgrade = mysql_query($query_rstotalgrade, $register) or die(mysql_error());
$row_rstotalgrade = mysql_fetch_assoc($rstotalgrade);
$totalRows_rstotalgrade = mysql_num_rows($rstotalgrade);
?>
but when i submit the form i face to this error :
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in C:\wamp\www\register\admin\add_lesson_term.php on line 11
Column 'lid' cannot be null
i appreciate any idea.
with prior thanks
|
|
|
|
|
I wanna some one please advise me where can i begin to learn PHP and have a good experience
|
|
|
|
|
That is interesting.......
if you have experience with other programming language, i think you can start learning php.
If you dont know any other programming language, i am sure you are going to be slow.
You can collect a book. I started learning PHP reading a book published by Wrox publications. written bye 4 writer. i dont remember the name.
And about being professional?: start career as trainee somewhere. If you have the quality to be a programmer you will be.
Otherwise without real work there is no way being professional
|
|
|
|
|
thanks so much Johny
i am already knowing a programming language
and i learned about php but i stopped in session and cookies and can't complete till understand these subjects so thanks so much for ur care .
|
|
|
|