Click here to Skip to main content
15,443,430 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHi, can someone please help me with a task that I am struggling with. Pin
Member 1490081928-Jul-20 1:35
MemberMember 1490081928-Jul-20 1:35 
AnswerRe: Hi, can someone please help me with a task that I am struggling with. Pin
W Balboos, GHB1-Aug-20 11:05
mveW Balboos, GHB1-Aug-20 11:05 
GeneralRe: Hi, can someone please help me with a task that I am struggling with. Pin
Sarbjit Grewal3-Sep-20 18:32
professionalSarbjit Grewal3-Sep-20 18:32 
GeneralRe: Hi, can someone please help me with a task that I am struggling with. Pin
Mycroft Holmes4-Sep-20 12:20
professionalMycroft Holmes4-Sep-20 12:20 
AnswerRe: Hi, can someone please help me with a task that I am struggling with. Pin
Richard MacCutchan1-Aug-20 20:59
mveRichard MacCutchan1-Aug-20 20:59 
QuestionCan i use mailto for this? Pin
kingu39921-Jul-20 5:15
Memberkingu39921-Jul-20 5:15 
AnswerRe: Can i use mailto for this? Pin
Afzaal Ahmad Zeeshan1-Sep-20 9:10
mveAfzaal Ahmad Zeeshan1-Sep-20 9:10 
QuestionHow can I submit with 1 button and 1 form with 2 actions? Pin
amitb220-Jul-20 23:06
Memberamitb220-Jul-20 23:06 
I have 2 pages. 1st is the index.php that have 3 fields. 2 of them should saved to sql and its works fine and the 3rd one should pass the value to 2nd screen. I have JS file. I success doing these 2 operations successfuly but in seperated projects. When I am trying to make them together there are mistakes. I want to know How can I implement those 2 parts together please.

index.php

HTML
<pre><!DOCTYPE html>
 
<html>
<head>
    <title>PHP MySQL Insert Tutorial</title>
        <script src='https://code.jquery.com/jquery-2.1.3.min.js'></script>
</head>
 
<body>
    <form action='insert.php' method='post' id='myform' >
    <p>
    <input type='text' name='username' placeholder='user name' id='username' />
    </p>
 
    <p>
    <input type='text' name='password' placeholder='password' id='password' />
    </p>
    
    <p>
    <input id = "minus" type="text" name="main" value="<?php echo $num1; ?>" autocomplete="off">
    </p>
            
    <button id='insert'>Insert</button>
    
    <p id='result'></p>
    </form>
</body>
</html>



2nd.php

PHP
<?php
session_start();
if(isset($_POST['Submit']))
{
    $num_2    = "";
    $pass_num = $_POST['main'];
}
?>

<h2>minus</h2>
<br>
<form method="post" action="index.php">

<input type="text" name="state" value="<?php echo $num_2;?>" autocomplete="off">
<br>
<input type="hidden" name="rrr" value="<?php echo $pass_num;?>" autocomplete="off">
<br>
<br>
<input name="Submit" type="submit" value="Submit">
</form>



jS

JavaScript
$('#myform').submit(function(){
    return false;
});
 
$('#insert').click(function(){
    $.post(     
        $('#myform').attr('action'),
        $('#myform :input').serializeArray(),
        function(result){
            $('#result').php(result);
        }
    );
    });


modified 21-Jul-20 7:04am.

AnswerRe: How can I submit with 1 button and 1 form with 2 actions? Pin
W Balboos, GHB30-Jul-20 7:06
mveW Balboos, GHB30-Jul-20 7:06 
QuestionAsp.Net Core Web API Pin
Kevin Marois15-Jul-20 11:43
professionalKevin Marois15-Jul-20 11:43 
AnswerRe: Asp.Net Core Web API Pin
Richard Deeming15-Jul-20 23:29
mveRichard Deeming15-Jul-20 23:29 
Questionnot close sqlitedb in php is ok? Pin
Member 144909644-Jul-20 21:05
MemberMember 144909644-Jul-20 21:05 
AnswerRe: not close sqlitedb in php is ok? Pin
Richard MacCutchan4-Jul-20 21:11
mveRichard MacCutchan4-Jul-20 21:11 
GeneralRe: not close sqlitedb in php is ok? Pin
Member 144909644-Jul-20 21:16
MemberMember 144909644-Jul-20 21:16 
GeneralRe: not close sqlitedb in php is ok? Pin
Richard MacCutchan4-Jul-20 21:44
mveRichard MacCutchan4-Jul-20 21:44 
Questionweb development: php, MSQLI Pin
baalfire4-Jul-20 1:16
Memberbaalfire4-Jul-20 1:16 
AnswerRe: web development: php, MSQLI Pin
Richard MacCutchan4-Jul-20 3:36
mveRichard MacCutchan4-Jul-20 3:36 
AnswerRe: web development: php, MSQLI Pin
ellegonzalez26-Dec-20 5:45
Memberellegonzalez26-Dec-20 5:45 
Questionrestore real ip to access.log of xampp apache server registered in cloudflare Pin
Member 144909643-Jul-20 21:12
MemberMember 144909643-Jul-20 21:12 
Questionwhat would you recommend me to use graphs in PHP+MySQL? Pin
Joan M18-Jun-20 9:49
professionalJoan M18-Jun-20 9:49 
Questionnode js express redirect from http to https Pin
Oscar K.13-Jun-20 1:45
MemberOscar K.13-Jun-20 1:45 
QuestionPlotting points on interactive map Pin
StampedePress9-Jun-20 5:07
MemberStampedePress9-Jun-20 5:07 
AnswerRe: Plotting points on interactive map Pin
Saim Irfan2-Jul-20 7:58
MemberSaim Irfan2-Jul-20 7:58 
Questionweb development Pin
moustafa arabi6-Jun-20 3:39
Membermoustafa arabi6-Jun-20 3:39 
AnswerRe: web development Pin
Mycroft Holmes6-Jun-20 12:07
professionalMycroft Holmes6-Jun-20 12:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.