Jump to content

adamriley

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Everything posted by adamriley

  1. 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.
  2. 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>
  3. Thanks very much for your help
  4. 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
  5. 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!
  6. 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
  7. 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
  8. 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>
  9. 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()); } ?>
  10. 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> ----------------------------------------------------------------------------------------------------------------
  11. db.php ----------------------- mysql_select_db("adamlr14_multi", $conect); $result = mysql_query("SELECT * FROM status_disk_space"); while($row = mysql_fetch_array($result)) { echo "Check number: $row['check_number']"; echo "Check date : $row['date']"; echo "Check Time : $row['time']"; echo "Check Free : $row['free']"; echo "Check used space : $row['used_space']"; echo "Check Percent used :$row['per_used']"; echo "Check percent free: $row['per_free']"; echo '<br />'; echo '<br />'; } echo mysql_error(); i get this ----------------------------------------------------------------------------------- syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/adamlr14/public_html/1/db.php on line 23
  12. Yes it now works thanks for your reply
  13. adamriley.php (part file) if (isset($_SESSION["delete_session"])) && ($_SESSION["delete_session"] == 'yes'){ session_destroy(); } could some one say why i get an error of "Parse error: syntax error, unexpected T_BOOLEAN_AND "
  14. main <?php // Some varibles for the football game card $Free_Games = Free; // the games are free e.g "Free" = free games "Pay" = Pay $Paypal = <<<paying <form target="PayPal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="business" value="*********"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="item_name" value="Football card | Stockport"> <input type="hidden" name="item_number" value=""> <input type="hidden" name="amount" value=""> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="shipping" value="1"> <input type="hidden" name="shipping2" value="0"> <input type="hidden" name="handling" value="0"> <input type="hidden" name="return" value="http://localhost/Game/Continue.php"> <input type="hidden" name="cancel_return" value="http://localhost/Game/Failed.php"> <input type="hidden" name="undefined_quantity" value="0"> <input type="hidden" name="receiver_email" value="***************************************************"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="no_note" value="1"> <input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" alt="Make payments with PayPal, it's fast, free, and secure!"> </form> paying; $link = <<<free <font style="font-size:27px" color="#000000" face="Arial"><b><a href="Continue.php">Continue</a></b></font> free; $message_free = <<<message_free Nobody has requested this slot if you wish to <br> Click the text below to continue! message_free; $message_pay = <<<message_pay Nobody has requested this slot if you wish to <br> Use the following image to buy it! message_pay; ?> What i would be doing is updating this file using another one
  15. hi how can you add php in a heredoc e.g <?php $adam = <<<phpcode <?php $adam = $_POST['hello']; ?> phpcode; ?>
  16. Thanks very much for your reply
  17. Bumpy any one at the other end ?
  18. This is the up to date file but still , I used the "==" and the if statement does not return even though that the $name is a sware word listed in the "Bad_words_list.txt" what im thinking is that you cannot Require the file so theres nothing for it to check ??? <?php error_reporting(E_ALL); if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) @date_default_timezone_set(@date_default_timezone_get()); // session_start(); // check to make sure there is a session if(!isset($_SESSION['dir'])){ echo "Please contact webmaster as soon as posible"; die(); } else { } $Name = $_POST['Name']; $Email = $_POST['Email']; $code = $_POST['Code']; $dir = $_SESSION['dir']; $file = $_SESSION['dir']; // // Automatic detection dissabled due to not beeing coded fully /* $file = <<<Words Require("includes/bad_word_list.txt"); Words; */ // $Time = date('h.i.s A'); // get the time // $Date = date('l jS \of F Y'); // get the date // // check the name to witheld it from the front person if ($Name == "Please Enter your full name"){ $Name = "**********"; } else { } // // // Check That the name has not got no sware words in it /* if ($Name == $file){ // unset($_SESSION['dir']); // write the normal info into the Blocked list $Blockfile = fopen("Blocked.txt","a+"); fwrite($Blockfile, "\r\n$Email:$code:$Date:$Time"); echo "Please contact webmaster due to bad name being detected with you security code you got from the last stage" die(); } else { } */ $pfile = fopen("places/$dir.txt","w"); fwrite($pfile, "\r\n$Name:$Email:$code:$Date:$Time"); header('Location: http://localhost/Game/red.php?$dir'); // ?>
  19. Submit.php ----------------------------------------------------- <?php // error_reporting(E_ALL); // echo '<pre>$_GET:' . print_r($_GET,true) . '</pre>'; // echo '<pre>$_SERVER:' . print_r($_SERVER,true) . '</pre>'; // echo $_SERVER['REQUEST_METHOD']; if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) @date_default_timezone_set(@date_default_timezone_get()); // session_start(); // check to make sure there is a session if(!isset($_SESSION['dir'])){ echo "Please contact webmaster as soon as posible"; die(); } else { } // $Sware_words = <<<Words Require("includes/bad_word_list.txt"); Words; $Name = $_POST['Name']; // get the name from the form $Email = $_POST['Email']; // get the email from the form $code = $_POST['Code']; // Get the secrity code $dir = $_SESSION['dir']; // Get who they have picked $file = $_SESSION['dir']; // Get the dir // $Time = date('h.i.s A'); // get the time // $Date = date('l jS \of F Y'); // get the date // // check the name to witheld it from the front person if ($Name = "Pleasae Enter your full name"){ $Name = "**********"; } else { } // // // Check That the name has not got no sware words in it if ($Name = $Sware_words){ unset($_SESSION['dir']); // write the normal info into the Blocked list $Blockfile = fopen("Blocked.txt","a+"); fwrite($Blockfile, "\r\n$Email:$code:$Date:$Time"); die(); } else { } $pfile = fopen("places/$dir.txt","w"); fwrite($pfile, "\r\n$Name:$Email:$code:$Date:$Time"); header('Location: http://localhost/Game/red.php?$dir'); // ?> Could any one tell me why the if statement returns when the $name is not one of the sware words ?? if ($Name = $Sware_words){ unset($_SESSION['dir']); // write the normal info into the Blocked list $Blockfile = fopen("Blocked.txt","a+"); fwrite($Blockfile, "\r\n$Email:$code:$Date:$Time"); die(); } else { }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.