Jump to content

TamiJo

Members
  • Posts

    2
  • Joined

  • Last visited

TamiJo's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Given that I'm communicating with a central database, I can't exactly expect the user to download that just to use the website. Looks like I'll have to go back to the old method. Thanks, anyway.
  2. Hi there. I have a local app that I have made using http and php code. I want to get this online, and want to do the stuff my php code is doing in JS instead. (Partly as a way to help me learn JS.) I currently have a form on a page `advanced.html` that submits to `search.php`. advanced.html is essentially just a form, Search.php has things like ``$as= $_GET([`as`])`` in order to set variables, then does things with them to contact a database with an SQL query and uses those results for different outputs. (0 results redirects to an error page, 1 result directs to the page for that specific result, multiple results uses the aforementioned 'as' variable to output either in a list or grid format.) Under my new system I am attempting to change the form to submit to `search.js`, where I will simply replace the php code with js. (Plus some additional changes to redirect to a html page for displaying the results, probably? I've not got that far.) I have three questions: 1) What equivalent would I use to `$_GET`? I have used W3 school's tutorial on JavaScript and am not finding anything that helps with form handling at all. I see the User Inputs section, but that doesn't seem like it is for this kind of thing. 2) Do I need to use a different system entirely? Doing away with submitting to search.js and simply having the js code on the advanced.html page and then directing the user to the appropriate page from there? 3) PHP has a built in function `mysqli_connect()`. Can this be replicated in js? I am still fairly new to programming, so apologies if my questions are obvious or nonsensical. I can try to provide extra context etc. if it would help. I have provided my original (working) advanced.php and search.php file below. search COPY.php advanced COPY.php
×
×
  • Create New...