|
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 .
|
|
|
|
|
|
thanks so much Richard A. Abbottfor ur effort these sites is very helpful
|
|
|
|
|
look at the source code for some open source php projects. As a programmer you are going to read a lot of code, but if you can understand why the programmer designed the app the way he did you will gain quite a bit of info.
Chris J
www.redash.org
|
|
|
|
|
i don't know why my firefox browser executing mysql query two times. and this is happening only with firefox. i have tested the code with chrome and opera and its working fine.
modified on Thursday, August 11, 2011 9:45 AM
|
|
|
|
|
The fact is your browser doesn't execute your query twice. your php/html code has an mistake. different browser handle your mistake html code differently. may be that is why you are seeing result twice.
read your returned code.
Better is post your php code
|
|
|
|
|
i am posting my mysql query check it if you find any problem?
$sql_item=mysql_query("select * from add_out_stock where challan_no='$challan_no'");
while($rs=mysql_fetch_array($sql_item))
{
$cata_name=$rs['catalogue_name'];
$design_no=$rs['design_no'];
$qty=$rs['quantity'];
$sql_stock=mysql_fetch_array(mysql_query("select * from stock where catalogue_name='$cata_name' AND design_no ='$design_no'"));
$tqty=$sql_stock['roll_no']-$qty;
$qty= mysql_query("update stock set roll_no='$tqty' where catalogue_name='$cata_name' AND design_no ='$design_no'");
}
when i am using this code it executing $qty two times
|
|
|
|
|
What type of request are you sending to server from your broswer?
is it ajax request ? normal request?
|
|
|
|
|
its a normal request. i am just opening the page in localhost or server.
|
|
|
|