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

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved