Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Does this AnyDice function accurately calculate the number of ogres you make unconcious with three 4th-level castings of Sleep?

Making a sword in the stone, in a medieval world without magic

Identifying the interval from A♭ to D♯

Why is Vishnu's skin colour mentioned as both white and blue in the Vishnu-sahasranaama?

SQL Server Primary Login Restrictions

Have researchers managed to "reverse time"? If so, what does that mean for physics?

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Check this translation of Amores 1.3.26

Why did it take so long to abandon sail after steamships were demonstrated?

Plot a function of two variables equal 0

2D counterpart of std::array in C++17

Could the Saturn V actually have launched astronauts around Venus?

Why is "das Weib" grammatically neuter?

How to make healing in an exploration game interesting

Life insurance that covers only simultaneous/dual deaths

Ban on all campaign finance?

Pinhole Camera with Instant Film

What is IP squat space

About parabolic Kazhdan Lusztig polynomials

Variant calling without matched normal sample

Why do Australian milk farmers need to protest supermarkets' milk price?

Rejected in 4th interview round citing insufficient years of experience

Make a transparent 448*448 image

Upper bound for the number of solutions of a Diophantine equation



Save data to MySQL database using ExtJS and PHP [closed]



2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?










-6















here is my code on which i have working



<?php
// Include the database configuration file
include 'Config.php';
echo "working";
$statusMsg = '';

// File upload path
$targetDir = "uploads/";
$fileName = basename($_FILES["file"]["name"]);
$targetFilePath = $targetDir . $fileName;
$fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION);

if(isset($_POST["submit"]) && !empty($_FILES["file"]["name"]))
// Allow certain file formats
$allowTypes = array('jpg','png','jpeg','gif','pdf');
if(in_array($fileType, $allowTypes))
// Upload file to server
if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath))
// Insert image file name into database
$insert = $db->query("INSERT into images (file_name, uploaded_on) VALUES ('".$fileName."', NOW())");




}


?>


<script type = "text/javascript">
Ext.onReady(function()
Ext.create('Ext.form.Panel',
id: 'newForm',
renderTo: 'formId',

items: [
xtype: 'filefield',
fieldLabel: 'File',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select File...'
],
buttons: [
text: 'Upload',
handler: function ()

var form = this.up('form').getForm();
if (form.isValid())
form.submit(
url: 'upload.php',
waitMsg: 'Uploading your file...',
success: function (f, a)

Ext.Msg.alert('Success');
,
failure: function (f, a)
Ext.Msg.alert('Failure');

);


]zz
);
);
</script>


How to save data in MySQL database using ExtJS, PHP and MySQL?
my problem is when i upload a file using this code it always shows failure message
i dont know how to solve it
can anybody know the solution
i use cdn for extjs linking










share|improve this question















closed as too broad by aynber, Shadow, tadman, halfer, gnat Mar 6 at 21:32


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 4





    🐴 This is an “I want a pony” question which makes it too broad and outside the focus of Stack Overflow. If you can make an attempt and then show us your code we can understand what you’re trying to do on a technical level. Even a small amount of code, however incomplete, can give us context and illustrate your intentions. If you really don't know where to start and need guidance or support consider mentoring and coaching services like Codementor, Savvy, or airpair.

    – tadman
    Mar 6 at 18:33











  • There are quite a few tutorials out there to get you started. If you have a specific question about a certain aspect of php, extjs, or MySQL, then come back and ask that separately.

    – Shadow
    Mar 6 at 18:34






  • 2





    @tadman: yes please, I want a pony too! Can I? Can I? When will she be delivered? Can I buy some sugar cubes beforehand?

    – halfer
    Mar 6 at 20:17











  • i have update my question so pls can you answer for the same.

    – Maxx nagar
    Mar 7 at 8:06











  • What debugging have you done? Have you checked your PHP logs?

    – halfer
    Mar 8 at 18:57















-6















here is my code on which i have working



<?php
// Include the database configuration file
include 'Config.php';
echo "working";
$statusMsg = '';

// File upload path
$targetDir = "uploads/";
$fileName = basename($_FILES["file"]["name"]);
$targetFilePath = $targetDir . $fileName;
$fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION);

if(isset($_POST["submit"]) && !empty($_FILES["file"]["name"]))
// Allow certain file formats
$allowTypes = array('jpg','png','jpeg','gif','pdf');
if(in_array($fileType, $allowTypes))
// Upload file to server
if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath))
// Insert image file name into database
$insert = $db->query("INSERT into images (file_name, uploaded_on) VALUES ('".$fileName."', NOW())");




}


?>


<script type = "text/javascript">
Ext.onReady(function()
Ext.create('Ext.form.Panel',
id: 'newForm',
renderTo: 'formId',

items: [
xtype: 'filefield',
fieldLabel: 'File',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select File...'
],
buttons: [
text: 'Upload',
handler: function ()

var form = this.up('form').getForm();
if (form.isValid())
form.submit(
url: 'upload.php',
waitMsg: 'Uploading your file...',
success: function (f, a)

Ext.Msg.alert('Success');
,
failure: function (f, a)
Ext.Msg.alert('Failure');

);


]zz
);
);
</script>


How to save data in MySQL database using ExtJS, PHP and MySQL?
my problem is when i upload a file using this code it always shows failure message
i dont know how to solve it
can anybody know the solution
i use cdn for extjs linking










share|improve this question















closed as too broad by aynber, Shadow, tadman, halfer, gnat Mar 6 at 21:32


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 4





    🐴 This is an “I want a pony” question which makes it too broad and outside the focus of Stack Overflow. If you can make an attempt and then show us your code we can understand what you’re trying to do on a technical level. Even a small amount of code, however incomplete, can give us context and illustrate your intentions. If you really don't know where to start and need guidance or support consider mentoring and coaching services like Codementor, Savvy, or airpair.

    – tadman
    Mar 6 at 18:33











  • There are quite a few tutorials out there to get you started. If you have a specific question about a certain aspect of php, extjs, or MySQL, then come back and ask that separately.

    – Shadow
    Mar 6 at 18:34






  • 2





    @tadman: yes please, I want a pony too! Can I? Can I? When will she be delivered? Can I buy some sugar cubes beforehand?

    – halfer
    Mar 6 at 20:17











  • i have update my question so pls can you answer for the same.

    – Maxx nagar
    Mar 7 at 8:06











  • What debugging have you done? Have you checked your PHP logs?

    – halfer
    Mar 8 at 18:57













-6












-6








-6


0






here is my code on which i have working



<?php
// Include the database configuration file
include 'Config.php';
echo "working";
$statusMsg = '';

// File upload path
$targetDir = "uploads/";
$fileName = basename($_FILES["file"]["name"]);
$targetFilePath = $targetDir . $fileName;
$fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION);

if(isset($_POST["submit"]) && !empty($_FILES["file"]["name"]))
// Allow certain file formats
$allowTypes = array('jpg','png','jpeg','gif','pdf');
if(in_array($fileType, $allowTypes))
// Upload file to server
if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath))
// Insert image file name into database
$insert = $db->query("INSERT into images (file_name, uploaded_on) VALUES ('".$fileName."', NOW())");




}


?>


<script type = "text/javascript">
Ext.onReady(function()
Ext.create('Ext.form.Panel',
id: 'newForm',
renderTo: 'formId',

items: [
xtype: 'filefield',
fieldLabel: 'File',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select File...'
],
buttons: [
text: 'Upload',
handler: function ()

var form = this.up('form').getForm();
if (form.isValid())
form.submit(
url: 'upload.php',
waitMsg: 'Uploading your file...',
success: function (f, a)

Ext.Msg.alert('Success');
,
failure: function (f, a)
Ext.Msg.alert('Failure');

);


]zz
);
);
</script>


How to save data in MySQL database using ExtJS, PHP and MySQL?
my problem is when i upload a file using this code it always shows failure message
i dont know how to solve it
can anybody know the solution
i use cdn for extjs linking










share|improve this question
















here is my code on which i have working



<?php
// Include the database configuration file
include 'Config.php';
echo "working";
$statusMsg = '';

// File upload path
$targetDir = "uploads/";
$fileName = basename($_FILES["file"]["name"]);
$targetFilePath = $targetDir . $fileName;
$fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION);

if(isset($_POST["submit"]) && !empty($_FILES["file"]["name"]))
// Allow certain file formats
$allowTypes = array('jpg','png','jpeg','gif','pdf');
if(in_array($fileType, $allowTypes))
// Upload file to server
if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath))
// Insert image file name into database
$insert = $db->query("INSERT into images (file_name, uploaded_on) VALUES ('".$fileName."', NOW())");




}


?>


<script type = "text/javascript">
Ext.onReady(function()
Ext.create('Ext.form.Panel',
id: 'newForm',
renderTo: 'formId',

items: [
xtype: 'filefield',
fieldLabel: 'File',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
buttonText: 'Select File...'
],
buttons: [
text: 'Upload',
handler: function ()

var form = this.up('form').getForm();
if (form.isValid())
form.submit(
url: 'upload.php',
waitMsg: 'Uploading your file...',
success: function (f, a)

Ext.Msg.alert('Success');
,
failure: function (f, a)
Ext.Msg.alert('Failure');

);


]zz
);
);
</script>


How to save data in MySQL database using ExtJS, PHP and MySQL?
my problem is when i upload a file using this code it always shows failure message
i dont know how to solve it
can anybody know the solution
i use cdn for extjs linking







php mysql extjs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 7:58







Maxx nagar

















asked Mar 6 at 18:25









Maxx nagarMaxx nagar

12




12




closed as too broad by aynber, Shadow, tadman, halfer, gnat Mar 6 at 21:32


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as too broad by aynber, Shadow, tadman, halfer, gnat Mar 6 at 21:32


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 4





    🐴 This is an “I want a pony” question which makes it too broad and outside the focus of Stack Overflow. If you can make an attempt and then show us your code we can understand what you’re trying to do on a technical level. Even a small amount of code, however incomplete, can give us context and illustrate your intentions. If you really don't know where to start and need guidance or support consider mentoring and coaching services like Codementor, Savvy, or airpair.

    – tadman
    Mar 6 at 18:33











  • There are quite a few tutorials out there to get you started. If you have a specific question about a certain aspect of php, extjs, or MySQL, then come back and ask that separately.

    – Shadow
    Mar 6 at 18:34






  • 2





    @tadman: yes please, I want a pony too! Can I? Can I? When will she be delivered? Can I buy some sugar cubes beforehand?

    – halfer
    Mar 6 at 20:17











  • i have update my question so pls can you answer for the same.

    – Maxx nagar
    Mar 7 at 8:06











  • What debugging have you done? Have you checked your PHP logs?

    – halfer
    Mar 8 at 18:57












  • 4





    🐴 This is an “I want a pony” question which makes it too broad and outside the focus of Stack Overflow. If you can make an attempt and then show us your code we can understand what you’re trying to do on a technical level. Even a small amount of code, however incomplete, can give us context and illustrate your intentions. If you really don't know where to start and need guidance or support consider mentoring and coaching services like Codementor, Savvy, or airpair.

    – tadman
    Mar 6 at 18:33











  • There are quite a few tutorials out there to get you started. If you have a specific question about a certain aspect of php, extjs, or MySQL, then come back and ask that separately.

    – Shadow
    Mar 6 at 18:34






  • 2





    @tadman: yes please, I want a pony too! Can I? Can I? When will she be delivered? Can I buy some sugar cubes beforehand?

    – halfer
    Mar 6 at 20:17











  • i have update my question so pls can you answer for the same.

    – Maxx nagar
    Mar 7 at 8:06











  • What debugging have you done? Have you checked your PHP logs?

    – halfer
    Mar 8 at 18:57







4




4





🐴 This is an “I want a pony” question which makes it too broad and outside the focus of Stack Overflow. If you can make an attempt and then show us your code we can understand what you’re trying to do on a technical level. Even a small amount of code, however incomplete, can give us context and illustrate your intentions. If you really don't know where to start and need guidance or support consider mentoring and coaching services like Codementor, Savvy, or airpair.

– tadman
Mar 6 at 18:33





🐴 This is an “I want a pony” question which makes it too broad and outside the focus of Stack Overflow. If you can make an attempt and then show us your code we can understand what you’re trying to do on a technical level. Even a small amount of code, however incomplete, can give us context and illustrate your intentions. If you really don't know where to start and need guidance or support consider mentoring and coaching services like Codementor, Savvy, or airpair.

– tadman
Mar 6 at 18:33













There are quite a few tutorials out there to get you started. If you have a specific question about a certain aspect of php, extjs, or MySQL, then come back and ask that separately.

– Shadow
Mar 6 at 18:34





There are quite a few tutorials out there to get you started. If you have a specific question about a certain aspect of php, extjs, or MySQL, then come back and ask that separately.

– Shadow
Mar 6 at 18:34




2




2





@tadman: yes please, I want a pony too! Can I? Can I? When will she be delivered? Can I buy some sugar cubes beforehand?

– halfer
Mar 6 at 20:17





@tadman: yes please, I want a pony too! Can I? Can I? When will she be delivered? Can I buy some sugar cubes beforehand?

– halfer
Mar 6 at 20:17













i have update my question so pls can you answer for the same.

– Maxx nagar
Mar 7 at 8:06





i have update my question so pls can you answer for the same.

– Maxx nagar
Mar 7 at 8:06













What debugging have you done? Have you checked your PHP logs?

– halfer
Mar 8 at 18:57





What debugging have you done? Have you checked your PHP logs?

– halfer
Mar 8 at 18:57












0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Google colab Transport endpoint is not connectedHow do I connect to a MySQL Database in Python?Google Colab is very slow compared to my PCGoogle Colab script throws “Transport endpoint is not connected”Presentation mode for Google Colab notebooksGoogle Colab: cell has not been executed in this session?Google Colab and tensorflow: How to hypertune and save a modelIs it possible to connect jupyter running on my laptop with google colabDisplaying all output with linebreaks in Google ColabUsing extensions in Google colabGoogle Colab Error: Buffered data was truncated after reaching the output size limit

IntelliJ IDEA underlines variables when using += in JAVA2019 Community Moderator ElectionHow can I permanently enable line numbers in IntelliJ?Is Java “pass-by-reference” or “pass-by-value”?When to use LinkedList over ArrayList in Java?How do I generate random integers within a specific range in Java?What is the scope of variables in JavaScript?How to determine if variable is 'undefined' or 'null'?How do I convert a String to an int in Java?IntelliJ inspection gives “Cannot resolve symbol” but still compiles codeCreating a memory leak with JavaHow to see JavaDoc in IntelliJ IDEA?

Лубенський полк