-
Posts
122 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Male
-
Location
Stockport
adamriley's Achievements

Member (2/5)
0
Reputation
-
The array. Output of the variable $v xmlrpcval Object ( [me] => Array ( [struct] => Array ( [sec] => xmlrpcval Object ( [me] => Array ( [string] => 349955dd5d3156af95cb4e75a13cffaa ) [mytype] => 1 ) ) ) examples of what I have tried echo $v->string; How could I get the value of [string]. I know that its an object but cannot find how to get the value.
-
The problem I have is when you enter a username in the textbox the page reloads I would like it to update the div named "result" with the responce form.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Login</title> <script language="JavaScript" type="text/javascript"> <!-- function submit(theform) { if (theform.username.value=="") { document.getElementById("result").innerHTML="Result : Please type a username to login!"; return false; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; return false; } } xmlhttp.open("GET","login_submit.php?u="+theform.username.value,true); xmlhttp.send(); } //--> </script> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="Form1" style="position:absolute;left:0px;top:0px;width:797px;height:414px;z-index:4;" align="left"> <form name="Form1" method="POST" action="" id="Form1" onsubmit="return submit(this)"> <input type="hidden" name="q1000" value="2"> <input type="text" id="username" style="position:absolute;left:149px;top:81px;width:424px;font-family:Courier New;font-size:16px;z-index:0" name="username" value="Username"> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:293px;top:152px;width:75px;height:24px;font-family:Arial;font-size:13px;z-index:2"> <div id="result" style="position:absolute;left:27px;top:215px;width:500px;height:24px;z-index:3;" align="left"> <font style="font-size:21px" color="#000000" face="Arial">Result : N/A Click submit</font></div> </form> </div> <div id="Text1" style="position:absolute;left:0px;top:7px;width:787px;height:32px;z-index:5;" align="center"> <font style="font-size:27px" color="#000000" face="Arial">Login</font></div> </body> </html>
-
Thanks very much for your help
-
Bumpy Bumpy ????
-
Now this is my code ... language.php <?php session_start(); $con = mysql_connect("sql09.freemysql.net","adamlr14",""); if (!$con) { die('Could not connect: ' . mysql_error()); } echo mysql_error(); mysql_select_db("language", $con); if(!mysql_select_db("language", $con)) { die('Could not select db: ' . mysql_error()); } $sql = 'SELECT ref, text FROM en'; $result = mysql_query($sql); if($result) { while($row = mysql_fetch_row($result)) { list($id, $text) = mysql_fetch_row($result); $lang[$id] = $text; } } print_r($lang); echo mysql_error(); ?> The problem is is that if you try to pull an odd number for example $lang[3] it echos nothing but if you change it to even number $lang[2] it echo what it should ....... I used print_r(lang) and it only has even numbers ??????? print_r($lang) Array ( [2] => try2 [4] => try4 [6] => try6 ) database ref text 1 try1 2 try2 3 try3 4 try4 5 try5 6 try6
-
Require what page? The aim of this file is to pull the 'text' from the database and the requiring page would show it example of the file requiring language.php adam.php <?php require("language.php"); echo {the bit I cannot do} {echo $row[text] were $row[ref] = 1 } ?> I would like it to echo Welcom this site is in construction!
-
This is what I have so far... language.php <?php session_start(); $con = mysql_connect("sql09.freemysql.net","adamlr14",""); if (!$con) { die('Could not connect: ' . mysql_error()); } $language = 'en'; echo mysql_error(); mysql_select_db("language", $con); if(!mysql_select_db("language", $con)) { die('Could not select db: ' . mysql_error()); } $result = mysql_query("SELECT * FROM en"); $row = mysql_fetch_array($result); echo mysql_error(); ?> example of database ref text 1 Welcom this site is in construction! 2 Please login before you continue! Now the bit I want to do now is 'require' the page and echo for example $row[text] were $row[ref] = "1" Sorry if it is confusing
-
Thanks very much for your help
-
Is there any chance you can explain on what you mean : I am trying to select the "url" field in the table "report" is there any chance of example please
-
one of my stupid moments its name is "reports" but I now have a problem in that the listbox does not have any info html reply <select name=student value=''>Student Name</option><option value=></option><option value=></option><option value=></option><option value=></option></select>
-
error = no database selected from mysql_error() "mysql_select_db("report", $con);" does that not select the database list.php <?php require($_SERVER['DOCUMENT_ROOT'] ."/mysql.php"); // connect to mysql server /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ mysql_select_db("report", $con); $query="SELECT url,ref FROM report"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ $result = mysql_query ($query); echo "<select name=student value=''>Student Name</option>"; // printing the list box select command while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option value=$nt[id]>$nt[name]</option>"; /* Option values are added by looping through the array */ } echo "</select>"; // Closing of list box echo mysql_error(); ?> mysql.php <?php $con = mysql_connect("localhost","all",""); if (!$con) { die('Could not connect: ' . mysql_error()); } ?>
-
Thanks for your reply
-
As you will guess after this im rubbish (new) to javascript how can this be done ---------------------------------------------------------------------------------------------------------------- <script language="javascript" type="text/javascript"> var url = document.location.href; window.location="http://localhost/blocked.php?url=+url"; </SCRIPT> ----------------------------------------------------------------------------------------------------------------