Jump to content

john_jack

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by john_jack

  1. var file1 is declared inside javascript, if you try console.log(file1) it should work . when you call Response.Write("file1=" + file1) this is an ASP call which cannot access the variable File1 (which is a javascript variable) Good luck
  2. Can you post the entire code please. Or you can check this tutorial https://www.w3schools.com/xml/dom_intro.asp . Good luck
  3. I believe this is what you are trying to achieve https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_post sending and receiving Data.
  4. You can use Ajax to load data(images, text ....) from a separate file which contains php,asp, txt depending on what you are using once the data is ready to be displayed you can use w3 animation to make it look fancy . Here's the ajax tutorial Ajax.
  5. here's a JS library you can use to sign/verify signatures . JsRSAsign
  6. on the second screenshot the Enable/disable checkbox is not checked .you should also verify your api-login and transactionkey make sure they are both correct. i assume you already have a woocommerce account linked to your credit card / bank account .
  7. you can use this .box-1:hover{ background: #390142; } i am using :hover the CSS will take effect when hovering the class box-1 . and do the same for the other boxes . good luck
  8. john_jack

    Site Help Please

    Take a look at Media queries https://www.w3schools.com/css/css_rwd_mediaqueries.asp these are what you need to make your style reshape it self when on a small resolution , that can also fix your image size problem .(you gonna have to write your proper css that you want to be executed on each @Media query) for the font problem theres already an existing css file somewhere in the website which overrides your current css . using !important; in css to override the previous css .
  9. Share the info provided by the bank then maybe someone can help.
  10. here you can check out this tutorial ,might help you do what you ask .Tutorial
  11. <?php session_start(); //start the session for the page include("../include/db.php"); //include database file include("../include/settings.php"); //include configuration file //Check if page was entered by a submit button $email=$_POST['email']; //Get username !!FROM FORM!! $email = ereg_replace(" ", "", $email); //take away all spaces from username (if any) !!FROM FORM!! $password=base64_encode($_POST['password']); //Get name !!FROMFORM!! if (empty($email) || empty($password)) { echo "Empty fields";} else{ //check to see if the username or email allready excists $ck=$flash->prepare("SELECT * FROM `user` WHERE `email`=:email AND `password`=:password "); //get rows where the username or email address is allready registered $ck->bindParam(':email',$email); $ck->bindParam(':password',$password); $ck->execute(); //if email address allready excists if($ck->rowCount() > 0){ echo "user loged in successfully"; } else{ echo "Login or password inccorect";} } ?> use that phpand keep the alert(result); it should be clear now
  12. i believe you got gist of it, when using ajax calls, you do not use header :location instead you can echo a unique value depending on the case . and on the javascript side use if(result=="something"){do something} if(result=="somethingelse"){do somethingelse} Good luck
  13. replace that with this so you knowwhat you are doing : success: function(result) { alert(result); } and on the php side depending on what error pops up make a code : empty fields echo 0 login was succesfull echo 1 login or pass incorrect echo 2
  14. replace the "header('location:../indess.html');" with " echo '0';" all theredirections should be done on the Ajax/Js side
  15. replace that with lets say : success: function(result) { if(result=="1") { //here is where you do redirect to ../user.html using javascript check the paths window.location.assign("../user.html") } else { //error hadling show a message login or password incorrect depending on what or where you want to display them } } and replace this with : if($ck->rowCount() > 0){ echo "1"; } else{ echo "0";}
  16. firstname isnt the field name it should be $_POST['email']; since you have this :
  17. maybe this was the problem ? should'nt it be "./../member/login.php;" what do you get as an error? it would help a lot Good luck
  18. i am not sure where all these variables come from or their value ,but heres what you do : when you load the page in the browser check if each the checkboxs have a different value than the other . when that is confirmed ,check the other page that receives the data from the form and try to echo the value of each checkbox to make sure the data was received properly . one last thing was $_SESSION['follow_success'] declared as an array ? if not, then it will only keep the last value received inside the loop . you should also consider a different name for each checkbox, having multiple $_post . Godd luck .
  19. you can split the page into 2 pages for example index.php : <!DOCTYPE html> <html> <link rel="stylesheet" href="style.css" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet"> <meta name="kontakt"> <head> </head> <body> <div class="col-md-12"> <div class="form-area"> <div id="error" style="color:#FF6633"></div> <form method="post" action="#" onsubmit="sendmail()"> <br style="clear:both"> <h3>Piši nam</h3> <div class="form-group"> <input type="text" class="form-control" name="fname" placeholder="Ime" id="idname"> <span class="error">* </span> </div> <div class="form-group"> <input type="text" class="form-control" name="email" placeholder="Email" id="idemail"> <span class="error">* </span> </div> <div class="form-group"> <input type="text" class="form-control" name="subject" placeholder="Naslov" id="idsubject"> <span class="error">* </span> </div> <div class="form-group"> <textarea class="form-control" type="textarea" placeholder="Sporočilo" id="idmessage" name="message" rows="8"></textarea> <span class="error">* </span> </div> <input type="submit" class="btn btn-primary" name="submit" value="Submit"> <!--<button type="button" name="submit" class="btn btn-primary pull-right" value="Submit">Pošlji</button>--> </form> </div> </div> <script> document.getElementById("error").display="none"; function sendmail() { event.preventDefault(); fname=document.getElementById("idname").value; email=document.getElementById("idemail").value; subject=document.getElementById("idsubject").value; message=document.getElementById("idmessage").value; //alert(fname); var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("error").innerHTML = this.responseText; } }; xhttp.open("POST", "./verify.php", true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send("fname=" + fname + "&email=" + email + "&subject=" + subject +"&message=" + message); } </script> </body> </html> and a seconf page that handles the the inputs for eg : verify.php <?php // define variables and set to empty values $nameErr = $emailErr = $genderErr = $websiteErr = ""; $name = $email = $gender = $comment = $website = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["fname"])) { echo "Vpiši ime!"; die(); } else { $name = test_input($_POST["fname"]); if (!preg_match("/^[a-zA-Z ]*$/",$name)) { echo "Dovoljene so samo črke in presledki!"; die(); } } if (empty($_POST["email"])) { echo "Vpiši email naslov!"; die(); } else { $email = test_input($_POST["email"]); if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Vpišite veljaven email naslov!"; die(); } } if (empty($_POST["subject"])) { echo "Vpiši naslov sporočila!"; die(); } else { $subject = test_input($_POST["subject"]); } if (empty($_POST["message"])) { echo "Vpiši sporočilo!"; die(); } else { $message = test_input($_POST["message"]); } // email Stuff goes here here } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } ?>
  20. If you want the form error handling to be smooth and user friendly, isuggest you use javascript/ajax check this js/ajax . for the mailing part check this : https://www.w3schools.com/php/func_mail_mail.asp .(if you are working on a local environement the mail will probably fail,you would have to tweek your php.ini but still the email received might be considered as spam) . Good luck.
  21. You can store the query results in a multidimensional array check this https://www.w3schools.com/php/func_array.asp "example 4" you can then return the array .
  22. If you want to use Javascript, here's the aproach : replace the following : with this : echo '<td data-sort-initial="Descending"><a href="#" onclick="delete_row(' . $row['id'] . ')">Delete</a></td>'; now we will define the function delete_row(x) as a javascript function : function delete_row(x) { // this is to avoid firing the default click on the <a> element event.preventDefault(); var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("errordiv").innerHTML = this.responseText; } }; xhttp.open("GET", "delete.php?id=" + x , true); xhttp.send(); } you will have to add a <div id="errordiv"></div> in the page that displays the Rows . all you have to do now is echo the errors on the delete.php like this : <?php /* DELETE.PHP Deletes a specific entry from the 'players' table */ // connect to the database include('connect-db.php'); // check if the 'id' variable is set in URL, and check that it is valid if (isset($_GET['id']) && is_numeric($_GET['id'])) { // get id value $id = $_GET['id']; // delete the entry $result = mysql_query("DELETE FROM players WHERE id=$id") or die(mysql_error()); // redirect back to the view page echo 'the player id '.$id.' was succesfully deleted'; //header("Location: view.php"); } else // if id isn't set, or isn't valid, redirect back to view page { echo 'The id provided was empty or not Numeric '; //header("Location: view.php"); } ?> so no more redirections . keep in mind that the mysql_ functions are outdated i suggest you use PDO or Mysqli to acces your database .checkout this for more info about Ajax https://www.w3schools.com/xml/ajax_intro.asp Goodluck
  23. let me answer your questions first : 1) Can the "videos" folder be set to private where no one can go to www.mysite.com/videos and see ALL the videos at once? if you have access to your Apache Configuration file you can prevent directory listing and you can also use .htaccess file to prevent that . 2) Will my page be mobile friendly? it depends on your CSS , is your template mobile friendly ? as for the easy way to share your video on your website try to upload the video on youtube and display it on the page , Good luck .
  24. i think this is what you are trying to do : $sqllast="UPDATE prodt SET pdname=(SELECT MAX(pdname) from prodt WHERE oid = ".db_escape($oid)." ) + 1 , pcyn = ".db_escape(0)." WHERE id = ".db_escape($a)." AND oid= ".db_escape($oid)." "; hope this helps .
×
×
  • Create New...