hoangthi
-
Posts
56 -
Joined
-
Last visited
Posts posted by hoangthi
-
-
Hello friendsI got a problem with Mysql.I want to link ONE UID in table Account to MANY UID in table ChatI set UID as foreign key in table Chat and then, references to account (UID)I tried to use Navicat to make a relationship but not succeedWhat I want is UID in table Chat MUST be one of the UID in table AccountThis is images:
UID in this table is NOT one of UID in table Account
Longing for your helps!
-
Hello. I am new at AJAX, today, I made a small script, that will post a data and return that data.It works very well in my Localhost:
but after I had uploaded to my hosting, It didn't work anymore.
I don't understand what happened.here is my code:file ajax_post :
<!DOCTYPE html>
<html>
<head>
<title>The 2nd ajax</title>
<meta charset="UTF-8">
<script>
function loadXML(){
var httpXML;
if (window.XMLHttpRequest) httpXML= new XMLHttpRequest();
else httpXML=new ActiveXObject("Microsoft.XMLHTTP");
httpXML.onreadystatechange=function(){
/* readyState: 0: request not initialized
1: server connection established
2: request received
3: processing request
4: request fished and response is readyState
status: 200: "ok";
404: page not found */
if (httpXML.readyState==4 && httpXML.status==200){
document.getElementById('myDiv').innerHTML= httpXML.responseText;
}
}
httpXML.open("POST","test.php",true);
httpXML.setRequestHeader("Content-type","application/x-www-form-urlencoded");
httpXML.send("input="+document.getElementById('form1').value);
}
</script>
<body>
<input type="text" value ="Type something" name ="input" id="form1"/>
<button type="submit" onclick ="loadXML()"> Click here</button>
<div id="myDiv"> The information appears here. </div>
</body>
</head>file test.php:
<?php
echo "you have inputted:".$_POST['input'];
?>Please help me to resolve this!
-
Oh right, I can use function: explode
-
I have a sentence:
$s = 'this,is,a,my example !';
So I want to get this:
$s2[0] = this
$s2[1] = is
$s2[2] = a
$s2[3] = my
$s2[4] = my example !
I tried to use a for loop to strlen ($s) but not successful
So thanks for helping
-
Hello friendsI have some secret informations need to be saved in Mysql Database and I need to show them in some cases. So how should I encode and decode them safely ?I think I can use Md5 to encode the password and noone can see the password anymore. But here, I need to show in browser the information which encoded. So who can help me ?Thanks in advance!
-
I assume you've done something to try to troubleshoot what's wrong, and not just tell us it doesn't work and wait for an answer? What have you tried? Have you checked the HTTP response code, which involves curl_getinfo? Have you checked that you're sending the right XML? Have you done a View Source on the page to see if maybe, just maybe, you were outputting XML and so couldn't see the markup because the browser was pretending it was HTML?
of course I viewed the source, Nothing... I will try again!
-
"xmlfile.xml" is not XML. It is a filename.
curl_setopt($curl, CURLOPT_POSTFIELDS, file_get_contents("xmlfile.xml"));
I tried this but the response is still nothing
-
What does your cURL structure look like after adding your XML?
Oh I used Requinix 's example:
$curl = curl_init("https://w3s.webmoney.ru/asp/XMLTrans.asp"); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, "xmlfile.xml"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); echo $response = curl_exec($curl); curl_close($curl);
xmlfile.xml:<w3s.request> <reqn>123</reqn> <wmid>abc</wmid> <sign>123</sign> <trans> <tranid>123</tranid> <pursesrc>123</pursesrc> <pursedest>123</pursedest> <amount>12</amount> <period>123</period> <pcode>123</pcode> <desc>123</desc> <wminvid>123</wminvid> <onlyauthabc></onlyauth> </trans> </w3s.request>
-
In requinix's example, the returned response from that site is saved in the variable $response.
Yes, There is nothing in $response
-
I did this, but Nothing happendedcURL is the easiest. Find a quick primer on it (it's not difficult to use) and pay attention to the CURLOPT_POSTFIELDS setting. Your code should look something like
$curl = curl_init("https://w3s.webmoney.ru/asp/XMLTrans.asp"); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, "your xml here"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); curl_close($curl);
-
The service says that:
Requests should be sent to: https://w3s.webmoney.ru/asp/XMLTrans.asp
Method: POST
and it is Request format:
<w3s.request> <reqn></reqn> <wmid></wmid> <sign></sign> <trans> <tranid></tranid> <pursesrc></pursesrc> <pursedest></pursedest> <amount></amount> <period></period> <pcode></pcode> <desc></desc> <wminvid></wminvid> <onlyauth></onlyauth> </trans> </w3s.request>
so, How can I do -
This is the page, there is a blank area in the right, so my question is, how to add something (table, image...) in to that, Please help me!
-
This is my style tag:
div.scroll
{
width:405px;
height:550px;
}If the content is > 550px, the div area will show a Scroll.So, I want this, If the content is < 550px, ex: 200 px, the div height will be automatically decrease down to 200 px.Thanks -
Thanks you so much! Admin
-
I have a form that only accepts the string: Axxxxxxx (x is a number)
EX: A1234567, A3145321
So, How can I check if the input is valid ?
If user input:
A1234567: True
B1234567: False
AA123121: False
A11 31231: False
Please help me!
-
I am using Php to show a table from mySql database.
The table has too many rows, it 's about 100 +
I only want to show 20 rows each page, and there are 5 pages. I think I can use break function to to that but I don't know how to split to 5 pages.
Example
1 something
2 something
3 something
4 something
..
.
20 something
<page1><page2><page3>
_____________________________
21 something
22 something
23 something
24 something
..
.
40 something
<page1><page2><page3>
Hope you understand my problem and help me!
-
Yes, Thanks, I did itNow I have 361764 seconds, How to convert it to aa days xx hours yy minutes zz second ?
-
Please help me this:
$time = '03-10-2013 00:29:00';echo strtotime($time);and the result is : 1380785340 = Thu, 03 Oct 2013 07:29:00 GMT, Not 03-10-2013 00:29:00I don't understand why. -
I get this from the table of database: 21-10-2013 14:30:00Now, I want to + 5 days, 1 hour, It should be: 26-10-2013 15:30:00How can I do that ?Please help me!Thanks
-
I have a variable get by php from table in database: $time, 06-10-2013 13:24:32
I wan't to echo in browser a $time decreased automtically, 13:24:32, 13:24:31, 13:24:30 ...
and when the time is time out, 00:00:00, the code will do some PHP functions.
Hope you understand and help me
Thanks in advanced.
-
yes. Thank you very much
-
Hello friends.
I have a problem and need your help.
I have 2 png images (100 x 300 ),
I want a submit button from that 1ST image, when I move my mouse to that button, the button will be changed to 2nd image and when I click the button, the button will be sunk...
Hope you understand what I want to say. You know, My English is so bad..
Thanks -
Oh yes, Thank you jazzman1, The problem has been resolved, I found a header() in spend file.
-
Does you hosting allows you to use opening php short tags "<?" instead of "<?php"? Why are you using exit() on the bottom? It terminates execution of the scrip ???
Thanks,
bombcutting.php is history table, but bombcutting.php?action=defuse is that code (#7), so I use exit () to show only defuse page, not history table
(MYSQL) Table relationship and Foreign key
in MySQL Help
Posted
I am not sure, I'll check it out. I am using Mysql in Xampp