Jump to content

thehubclick

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by thehubclick

  1. Im on my phone Barand? Ctrl + - is done on Desktop. I dont use my desktop much.
  2. It might be my Firefox browser. Look at screenshot my screen wont zoom.
  3. The reason i dont see it is because im on my phone. I code on my phone. Not the desktop.
  4. Oh by the way im using my android phone to post and code i dont see the <> button icon . It might be on the desktop and not my android phone.
  5. Thanks Barand that fixed my code displaying code inside my code correctly i will make sure to use it when posting my php or html code here. Thanks again
  6. I cant get code to display right. In (<>). I need help
  7. I cant get my code to display ^^^ up there (<>) my bad
  8. Sorry. For delay I m using POST.. To get 0 - 8 im using input username2 lets say i put 0 in username2 input when I click post i need to grab that 0 and pass it to my $charactors[$nine]->name Its not reading my string $nine from my input box username2. Like i wrote earlier ^^^ it will only work this (< Then $nine='0'; $codx =$characters[$nine]->name; When i write in javascript working with the input box i can read it into a string but not in Php programming. I m still learning php im sure this isnt that hard to do. Hope any experts in php here can see my issue. Hope my code displays right. About making code easy to read is it < code > or (< code. >) ill try both my bad if this dont work. (< <form action="" method="post"> <input disabled="disabled" style="background-color:white; color: white" type="text" name="subject" id="subject" size="1" style="display:none" value="1"> <hr> Password: <br><input style="background-color:black; color: white" type="password" name="text_one" value="0923532"> <button type="submit" name="ok">OK</button> dec19/ <INPUT TYPE = "Text" VALUE ="" ID = "username2" NAME = "username2"> </form>
  9. <INPUT TYPE = "Text" VALUE ="0" ID = "username2" NAME = "username2"> <?php $value1 = $_POST['username2']; $nine=$value1; $codx =$characters[$nine]->name; ?> Im tring to get '0' in username2 inputbox readit in php $nine $codx =$characters[$nine]->name; as you can see in my <?php code above I cant get the 0 from this inputbox It only works like this <?php $nine='0' $codx =$characters[$nine]->name; ?> What i need is to get the users input. from a textbox on my page called username2 they would enter between 0 and 8 as you can see its set to 0 on my textbox, the 0 - 8 is the character location $characters[$nine] the $nine will hold the number between 0 - 8 My php code i cant read my texbox input. How do I read the user input into my my textbox post pulls the input $nine = $_POST['username2']; $codx =$characters[$nine]->name; i noticed it wouldn't work it only works this way $nine='0'; $codx =$characters[$nine]->name; Let me know how to read in user input from my username2 textbox. Thanks in advance sorry to repeat i needed to explain so you can see my error.
  10. Ok ty. I cant get my test <> To work how do i learn on this forum how to embed Is it (< my code. >) Let me know because in my test i did < my code > But it didnt work. Ty
  11. Sorry Not sure how to Use <> my code inside (< <script type="text/javascript"> function sam_click() { var x="<?php ex(); ?>"; alert(x); return false; } </script> >) I cant find the edit to fix my code. So did this test. Ty
  12. <script type="text/javascript"> function checker1() { (tboxinp1.value==000) { alert("error3") } { // call php script from javascript ??? <?php not looking to use alert here is part of the php script to call } <?php /// can I put a function to call this. This php script is taken from my sumbit button. I want to check if condition mets before the submit sends the data $t = $_GET["email"]; echo '<script>checker1()</script>'; if ($t == 1) { // heres submit i want to call from javascript if(isset($_POST['textdata'])) i dont know how to approach this javascript call. Thanks if you can help. What i mean is the <?php script runs when i click submit i want to catch if data was not entered before it submits, if it does not i like the submit to cancel. The php script as follows when submit button is clicked <?php $t = $_GET["email"]; echo '<script>checker1()</script>'; if ($t == 1) { if(isset($_POST['textdata'])) { // return false; session_start(); $cm_name = $_GET["name"]; // Check if a text file exists. // If not create one and initialize it to zero. if (!file_exists($cm_name)) { - $f = fopen($cm_name, "w"); - fwrite($f,"0"); - fclose($f); } // Read the current value of our counter file $f = fopen($cm_name,"r"); $cmVal = fread($f, filesize($cm_name)); fclose($f); // Has visitor been counted in this session? // If not, increase counter value by one if(!isset($_SESSION['hasVisited'])){ - $_SESSION['hasVisited']="yes"; - $cmVal++; - $f = fopen($cm_name, "w"); - fwrite($f, $cmVal); - fclose($f); echo "Have a good day!"; } echo '<script>showname()</script>'; // $data=$_POST['textdata']; // $fp = fopen('data1.txt', 'a'); // fwrite($fp, $data); // fclose($fp); } //echo "Have a good day!"; } // echo '...'; ?>d
  13. Ok im using the Xampp. Program to startup webserver ill see how to turn on error reporting on. I just started using it to test my website before i put it on my paid web hosting .www example:mydomain.com/home1.php thanks This xampp is the best It installs everything php perl so it works correctly Sometimes i forget how to edit php.ini file You know configuration With xampp it makes it all work all you do is start up the webserver 5 stars xampp.
  14. Thank you Barand What you said adding ";" fixed it i left that out Thanks for your help My code works with your all helping Good day.
  15. The working php file when i run in my webserver localhost <!DOCTYPE html> <html> <head> <meta http-equiv="pragma" content="nocache"> <meta name=viewport content='width=1100'> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> <!--320--> <title>Store form data in .txt file</title> </head> <body> <form method="post"> Enter Your Text Here:<br> <input type="text" name="textdata"><br> <input type="submit" name="submit"> </form> </body> </html> <?php if(isset($_POST['textdata'])) { $data=$_POST['textdata']; $fp = fopen('data.txt', 'a'); fwrite($fp, $data); fclose($fp); } ?> I changed it to now its not running when i run this php On my webserver if(isset($_POST['textdata'])) { $data=$_POST['textdata']; $fp = fopen('data.txt', 'a'); $string1="@@@ " added this Added this $data=$data.$string1; fwrite($fp, $data); fclose($fp); }
  16. hello i am learning php a newbie . i am a perl javascript vb script visual basic. some php. i am tring to put multiple $strings into one then save it to file i need to be abe to split up the data later. my split symbol is "|" or | the second code below is my changes the second code below had errors first code original this code works i tested this it grabbed the clients user input. // this is the user input / textdata if(isset($_POST['textdata'])) { $data=$_POST['textdata']; $fp = fopen('data.txt', 'a'); fwrite($fp, $data); fclose($fp); } ?> second code changes i made. . if(isset($_POST['textdata'])) { $data=$_POST['textdata']; $fp = fopen('data.txt', 'a'); // i added this line $string1="| " // i changed this line below // my error might be here $data=$data.$string1; fwrite($fp, $data); fclose($fp); } ?> can i get help fixing this to work $data=$data.$string1 thank you in advance.
×
×
  • 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.