-
Posts
252 -
Joined
-
Last visited
-
Days Won
4
Posts posted by dodgeitorelse3
-
-
Your form is posting to connection.php
I assume that page is your first code with connection info.
Where is it supposed to work with database?
-
Blank page is probably due to this line
$evt_start=$row["evt_start"]; //
$event_date
-
8 hours ago, mac_gyver said:
the sql syntax error is because the SELECT query syntax is incorrect, in that you have a * followed by a column name in the SELECT list.
There are 2 select queries with this issue.
-
I have solved my issue.
In index.html I changed the previous button to display:none
<!-- Previous Button --> <button id="prev-btn" style="display:none;"> <i class="fas fa-arrow-circle-left"></i> </button>
And then in main.js I added
if(currentState == 1){ prevBtn.style.display = "none"; }
underneath the Business Logic section. I also add the display inline or none in 2 places in each of the goNextPage function and the goPrevPage function so they now look like this:
function goNextPage() { if(currentLocation < maxLocation) { switch(currentLocation) { case 1: openBook(); prevBtn.style.display = "inline"; paper1.classList.add("flipped"); paper1.style.zIndex = 1; break; case 2: paper2.classList.add("flipped"); paper2.style.zIndex = 2; break; case 3: nextBtn.style.display = "none"; paper3.classList.add("flipped"); paper3.style.zIndex = 3; closeBook(false); break; default: throw new Error("unkown state"); } currentLocation++; } } function goPrevPage() { if(currentLocation > 1) { switch(currentLocation) { case 2: closeBook(true); prevBtn.style.display = "none"; paper1.classList.remove("flipped"); paper1.style.zIndex = 3; break; case 3: paper2.classList.remove("flipped"); paper2.style.zIndex = 2; break; case 4: openBook(); nextBtn.style.display = "inline"; paper3.classList.remove("flipped"); paper3.style.zIndex = 1; break; default: throw new Error("unkown state"); } currentLocation--; } }
-
I have found some code online to make flip pages (a book if you will).
I am trying to hide the previous button before the book is opened or the next button when end of book is reached.
index.html is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Book</title> <link rel="stylesheet" href="./style.css"> <script src="./main.js" defer></script> <script src="https://kit.fontawesome.com/b0f29e9bfe.js" crossorigin="anonymous"></script> </head> <body> <!-- Previous Button --> <button id="prev-btn"> <i class="fas fa-arrow-circle-left"></i> </button> <!-- Book --> <div id="book" class="book"> <!-- Paper 1 --> <div id="p1" class="paper"> <div class="front"> <div id="f1" class="front-content"> <h1>Front 1</h1> </div> </div> <div class="back"> <div id="b1" class="back-content"> <h1>Back 1</h1> </div> </div> </div> <!-- Paper 2 --> <div id="p2" class="paper"> <div class="front"> <div id="f2" class="front-content"> <h1>Front 2</h1> </div> </div> <div class="back"> <div id="b2" class="back-content"> <h1>Back 2</h1> </div> </div> </div> <!-- Paper 3 --> <div id="p3" class="paper"> <div class="front"> <div id="f3" class="front-content"> <h1>Front 3</h1> </div> </div> <div class="back"> <div id="b3" class="back-content"> <h1>Back 3</h1> </div> </div> </div> </div> <!-- Next Button --> <button id="next-btn"> <i class="fas fa-arrow-circle-right"></i> </button> </body> </html>
main.js is as follows:
// References to DOM Elements const prevBtn = document.querySelector("#prev-btn"); const nextBtn = document.querySelector("#next-btn"); const book = document.querySelector("#book"); const paper1 = document.querySelector("#p1"); const paper2 = document.querySelector("#p2"); const paper3 = document.querySelector("#p3"); // Event Listener prevBtn.addEventListener("click", goPrevPage); nextBtn.addEventListener("click", goNextPage); // Business Logic let currentLocation = 1; let numOfPapers = 3; let maxLocation = numOfPapers + 1; //start hide or show previous and next buttons if(currentState == 1){ prevBtn.style.display = "none"; nextBtn.style.display = "inline"; }else if(currentState == 4){ prevBtn.style.display = "inline"; nextBtn.style.display = "none"; }else{ prevBtn.style.display = "inline"; nextBtn.style.display = "inline"; } //end hide or show previous and next buttons function openBook() { book.style.transform = "translateX(50%)"; prevBtn.style.transform = "translateX(-180px)"; nextBtn.style.transform = "translateX(180px)"; } function closeBook(isAtBeginning) { if(isAtBeginning) { book.style.transform = "translateX(0%)"; } else { book.style.transform = "translateX(100%)"; } prevBtn.style.transform = "translateX(0px)"; nextBtn.style.transform = "translateX(0px)"; } function goNextPage() { if(currentLocation < maxLocation) { switch(currentLocation) { case 1: openBook(); paper1.classList.add("flipped"); paper1.style.zIndex = 1; break; case 2: paper2.classList.add("flipped"); paper2.style.zIndex = 2; break; case 3: paper3.classList.add("flipped"); paper3.style.zIndex = 3; closeBook(false); break; default: throw new Error("unkown state"); } currentLocation++; } } function goPrevPage() { if(currentLocation > 1) { switch(currentLocation) { case 2: closeBook(true); paper1.classList.remove("flipped"); paper1.style.zIndex = 3; break; case 3: paper2.classList.remove("flipped"); paper2.style.zIndex = 2; break; case 4: openBook(); paper3.classList.remove("flipped"); paper3.style.zIndex = 1; break; default: throw new Error("unkown state"); } currentLocation--; } }
My attempt is in the main.js file starting at line #19.
Any help would be greatly appreciated.
-
10 hours ago, LeonLatex said:
I have taken some frome here and another from there, "IN MY OWN SCRIPTS". So yes, much of it is cut and paste, but it's from my own scripts written by my self
That points me to suggest you may want to check your other scripts as well.
-
The $_POST[nfield] should be
$_POST['nfield']
-
When you start a topic stating you got errors perhaps showing those error messages so we can see them as well as the code pertaining to those error messages.
- 1
-
17 minutes ago, martini0 said:
$is_wholesale = get_user_meta( 'A_USER_ID', 'wholesale_customer', true ); -> I tried, no effect
Did you try that code as you show here or did you replace A_USER_ID with an actual ID such as 1 or 2?
-
I stand corrected. My apologies.
the code shown must be what is confusing me.
$prevbal="prevbal"; $latechg="latechg"; $secdep="secdep"; $damage="damage"; $courtcost="courtcost"; $nsf="nsf"; $amtdue="amtdue"; $amtpaid="amtpaid";
-
$due = $prevbal + $latechg + $secdep + $damage + $courtcost + $nsf; // Warning: A non-numeric value encountered x 5 line 21
is equal to saying
$due = "prevbal" + "latechg" + "secdep" + "damage" + "courtcost" + "nsf";
these are not numeric.
-
If your blockscan field is an indicator for the web adress why not use that the same as you are with the $checkSqlRow["ADDRESS"]?
-
well actually mac_gyver answered you the same thing. He was just trying to get you to see the point he was making which is the same as I pointed out. Always keep the original variable unless you have changed it in some way from it's initial creation.
-
you are confusing
customer_id = :id;
for
customer_id = :customer_id;
-
First thing I see is your benfield throughout your function needs the $ in front of it.
- 1
-
Are register.php, registerFinal.php and connect.php all located in same directory? and are the names spelled right for those 3 files?
Also in your registerFinal.php file change
require("connect.php");
to
require "connect.php";
HTTP 405 is an HTTP response status code. There are five classes of HTTP response status codes. They all inform a user whether a specific HTTP request has been successfully completed. The five core status codes include:
1xx status codes: Informational requests
2xx status codes: Successful requests
3xx status codes: Redirects
4xx status codes: Client errors
5xx status codes: Server errors
The 405 Method Not Allowed error message is a client error, which indicates that something on the client-side of things is the issue.
An HTTP 405 Error indicates that a web browser has requested access to one of your pages, and your web server has recognized the request. However, the server has rejected the specific HTTP method it's using. As a result, your web browser can't access the requested web page.
-
$_POST from your inputs works by input name which I see none of.
So your form should be like:
<form action="registerFinal.php" method="post"><!-- ten fragment inputow jest wysylany submitem do pliku registerFinal.php --> <tr class="logRegSiteTextBox"> <td>login: </td> <td><input type="text" name="loginREGfield" placeholder="tak" title="nie" required></td> </tr> <tr class="logRegSiteTextBox"> <td>e-mail: </td> <td><input type="text" name="emailREGfield" placeholder="tak" title="nie" required></td> </tr> <tr class="logRegSiteTextBox"> <td>hasło: </td> <td><input type="password" name="passwordREGfield" placeholder="tak" title="nie" required></td> </tr> <tr class="logRegSiteTextBox"> <td>powtórz hasło: </td> <td><input type="password" placeholder="tak" title="nie" required></td> </tr> <tr> <td></td> <td><input type="submit" value="Zarejestruj się" class="myButtonREG"></td> </tr> </form>
you also need a name in your powtórz hasło input if you are using it in $_POST.
-
Glad you got it sorted and thank you for reply.
-
1 hour ago, annmann said:
Either way, problem is solved now, thank you for the help everyone!!
Your solution would be nice to know for any others that may have the same issue.
-
21 hours ago, maxxd said:
cron.php is a standard file in WordPress installs, so if it's suddenly missing from the wp-includes directory then it got deliberately removed. I recommend re-installing WP and examining your logs for deletes or unusual/suspicious logins.
Have you tried what maxxd said?
-
That's what OP was showing .... that the required file isn't in the wp-includes folder.
-
2 hours ago, webdeveloper123 said:
At the moment you have screen shotted the wrong folder. You have screen shotted the public_html folder, the folder your looking for is within public_html where the screen shot with the red arrow is at
I thought the same thing due to the + sign next to that folder but at top of screen he is in the right folder.
-
always possible cron.php has been deleted. I would be looking everywhere for it.
-
Have you looked in the wp-includes folder as the error suggested?
Saving to mysql database not working!
in PHP Coding Help
Posted · Edited by dodgeitorelse3
<label
Needs closing >
Also $post['fname']
Should be
$_post['fname']