Jump to content

Search the Community

Showing results for tags 'javascipt'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 4 results

  1. Good day. I am new to php, did learn quit a few things with php, but now I am stuck. (don't hurt the newbie) 1. in phpmysql I have a table with one of the columns (LIVE) in it that I want to show a live price in. At the moment I the column is set as varchar(30) do not know if this is correct. In my html table I want to add 3 or more if/else in, so when I update my html it must show 0.03234523 (depending on the price) I do not want all the rows to show this information I am getting the info from a js file, but cannot get it to work. (I did add the script in so it see my sss.js file. Here is the full script of javascript (it is at the moment just for one, will add the other two later when we can fix this), and the php script from my php file. What am I dong wrong and how can I fixed it. let ws_binance = new WebSocket('wss://stream.binance.com:9443/ws'); let html_element_binance = document.getElementById('show_price_binance'); let last_price_binance = null; ws_binance.onopen = function () { ws_binance.send(JSON.stringify ({ 'method': 'SUBSCRIBE', 'params': ['shibusdt@trade'], 'id': 1 })) }; ws_binance.onmessage = function (event) { let current_price_binance = JSON.parse(event.data); let price_binance = parseFloat(current_price_binance.p).toFixed(8); html_element_binance.innerText = price_binance; if ((price_binance < last_price_binance) && (isNaN(price_binance) == false)) { html_element_binance.innerText = '↓' + price_binance; html_element_binance.style.color = 'red'; } else if ((price_binance > last_price_binance) && (isNaN(price_binance) == false)) { html_element_binance.innerText = '↑' + price_binance; html_element_binance.style.color = 'lime'; } else if ((price_binance == last_price_binance) && (isNaN(price_binance) == false)) { html_element_binance.innerText = price_binance; html_element_binance.style.color = 'purple'; } last_price_binance = price_binance; }; <td> <?php $checkSqlRow["CCOINGECKO_LIVE"] = strtolower($checkSqlRow["COINGECKO_LIVE"]); if($checkSqlRow["COINGECKO_LIVE"] == 'trx') { echo "id='show_price_binance'"; } ?> </td>
  2. Hi - I want to add to a php form a button which will open a pop-up window with records (names of people) and associated radio buttons. On click on respective name's radio button and SUBMIT, parent form textbox is populated. (list of names will be dynamically be selected fro MySQL table). Any suggestions? Many thanks! IB.
  3. So I have this problem with AJAX. I want to pass the value from the selected dropdown with ajax so that when user selected one of the value in dropdown list(from Oracle DB) it pulls the corresponding value and send it inside the page for processing. So the database schema is like this, HEAD_MARK QTY CUTTING ASSEMBLY WELDING DRILLING FINSHING --------------- ---------- ---------- ---------- ---------- ---------- --------- TEST-2 222 0 0 0 0 0 INI TEST 999 0 0 0 0 0 TEST_RUN1 11 2 2 2 2 2 and my Demo.php is like this. It pulls the Head_mark value from the database and direcly passing the value to process the, 1. Show the corresponding quantity 2. Use the quantity to compare the cutting. Lets say cutting value in the db today is 2 and the quantity is 10. So in the input tag, min="2" and max="10". And user can input new value and update it to the database according to the selected input <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> function OnSelectionChange (select) { var selectedOption = select.options[select.selectedIndex]; //some ajax checkpoint for checking value //alert ("The selected option is " + selectedOption.value); jQuery.ajax({ url: location.href, data: {'hm':selectedOption.value, 'ajax':1}, type: "POST", success: function( data ) { jQuery("#lbl_qty").html(data);//PRINT QTY TO THE SCREEN } }); //some ajax checkpoint //alert('after ajax'); } $(function(){ //insert record $('#insert').click(function(){ var jcutting = $('#fcutting').val(); var jassembly = $('#fassembly').val(); var jwelding = $('#fwelding').val(); var jdrilling = $('#fdrilling').val(); var jfinishing = $('#ffinishing').val(); //syntax - $.post('filename', {data}, function(response){}); $.post('../update_bar/data.php', {action: "insert", cutting:jcutting, assembly:jassembly, welding:jwelding, drilling:jdrilling, finishing:jfinishing}, function(res){ $('#result').html(res); });}); //show records $('#show').click(function(){ $.post('data.php',{action: "show"},function(res){ $('#result').html(res); }); }); }); </script> </head> <body> <?php // DROPDOWN VALUES TO PULL COMPONENT FROM THE DB $result = oci_parse($conn, 'SELECT HEAD_MARK FROM FABRICATION'); oci_execute($result); echo '<SELECT name="headmark" id="headmark" onchange="OnSelectionChange(this.value)">'.'<br>'; echo '<OPTION VALUE=" ">'."".'</OPTION>'; while($row = oci_fetch_array($result,OCI_ASSOC)){ $HM = $row ['HEAD_MARK']; echo "<OPTION VALUE='$HM'>$HM</OPTION>"; } echo '</SELECT>'; ?> <?php // IT DIRECTLY SHOWS THE QUANTITY FOR THE GIVEN HEADMARK WHEN USER SELECT ONE OF THE HEADMARK FROM THE DROPDOWN // BUT IT SHOWS Notice: Undefined index: hm in C:\xampp\htdocs\WeltesInformationCenter\update_bar\demo.php on line 95 $qty_query_result = oci_parse($conn, "SELECT QTY FROM FABRICATION WHERE HEAD_MARK = '{$_POST["hm"]}'"); oci_execute($qty_query_result); oci_bind_by_name($qty_query_result, 'QTY', $quantity); echo 'QUANTITY :'.$quantity; ?> <!-- MAX PLACEHOLDER SHOULD BE GATHERED FROM THE QUANTITY FROM THE CORRESPONDING COMPONENT--> Cutting: <input type="number" min="0" id="fcutting" /> Assembly: <input type="number" min="0" id="fassembly" /> Welding: <input type="number" min="0" id="fwelding" /> Drilling: <input type="number" min="0" id="fdrilling" /> Finishing: <input type="number" min="0" id="ffinishing" /> <button id="insert">Insert</button> <h2>Show Records</h2> <button id="show">Show</button> <p>Result:</p> <div id="result"></div> </body> </html> And the Data.php looks like this <?php //if insert key is pressed then do insertion if($_POST['action'] == 'insert'){ $cutting = $_POST['cutting']; $assembly = $_POST['assembly']; $welding = $_POST['welding']; $drilling = $_POST['drilling']; $finishing = $_POST['finishing']; $sql = "UPDATE FABRICATION SET CUTTING = '$cutting', ASSEMBLY = '$assembly', WELDING = '$welding', DRILLING = '$drilling', FINISHING = '$finishing' WHERE HEAD_MARK = '{$_POST["hm"]}''"; $query = oci_parse($conn, $sql); $query_exec = oci_execute($query); if($query_exec){ oci_commit($query_exec); echo "Record Inserted."; }else { echo "Something Wrong!"; } } //if show key is pressed then show records if($_POST['action'] == 'show'){ $sql = "select * from FABRICATION WHERE HEAD_MARK = 'TEST_RUN1'"; $query = oci_parse($conn, $sql); $query_exec = oci_execute($query); echo "<table border='1'>"; while($row = oci_fetch_assoc($query)){ echo "<tr><td>$row[HEAD_MARK]</td><td>$row[CUTTING]</td><td>$row[ASSEMBLY]</td><td>$row[WELDING] </td><td>$row[DRILLING]</td><td>$row[FINISHING]</td></tr>"; } echo "</table>"; } ?> So basically I dont know how to pass the head_mark value to the function in Data.php. The error is like this, Notice: Undefined index: hm in C:\xampp\htdocs\WeltesInformationCenter\update_bar\data.php on line 35 Warning: oci_parse(): ORA-01756: quoted string not properly terminated in C:\xampp\htdocs\WeltesInformationCenter\update_bar\data.php on line 36 Warning: oci_execute() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\WeltesInformationCenter\update_bar\data.php on line 37 Something Wrong! PLease any kind of help would be appreciated
  4. Is there some way to make it to where a user is only allowed to the site if they have donated to the site ? otherwise they get a page where it askes to donate to the site and then they can access the content in the back ? I would like to do this in PHP
×
×
  • 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.