jabirmoolur Posted November 14, 2012 Share Posted November 14, 2012 * i want to display alert message in my page where actual the form is located... * i have 2 pages 1--> user interace page with registration form 2--> a php page called by ajax callback function to add a form data to database without redirecting from my first page now the problem is i want to display jqery alert or simple javascript alert on my first page(where actual the form) based on the result of second php page eg:Thank u mr $name for registration.your registration id is $regid or eg:this username alreday exists... this is my simple ajax call back script ---------------------------------------------- <script> // wait for the DOM to be loaded $(document).ready(function() { // bind 'myForm' and provide a simple callback function $('#myform').ajaxForm(function() { }); }); </script> the second page just cathces form data and generates random registartion id eg: $first_name = $_POST["first_name"]; $last_name = $_POST["last_name"]; $memberid = rand(1000000000,9999999999); please any one help me soon to come out o this big struck... thank you...... Quote Link to comment https://forums.phpfreaks.com/topic/270679-code-behind-response/ Share on other sites More sharing options...
Manixat Posted November 14, 2012 Share Posted November 14, 2012 (edited) there are a few ways to do this, you can either use the original jquery callback function after the ajax request has either been completed or failed, or you can just use plain simple javascript in your second page and return it in a insignificant place on the first page. Also you should not use that kind of id assigning, sooner or later ids will start to repeat. Instead use the built-in auto increment in MySQL Edited November 14, 2012 by Manixat Quote Link to comment https://forums.phpfreaks.com/topic/270679-code-behind-response/#findComment-1392327 Share on other sites More sharing options...
jabirmoolur Posted November 16, 2012 Author Share Posted November 16, 2012 can u please ellobarate how caan i do <original jquery callback function after the ajax request has either been completed or failed?> Quote Link to comment https://forums.phpfreaks.com/topic/270679-code-behind-response/#findComment-1393009 Share on other sites More sharing options...
txmedic03 Posted November 20, 2012 Share Posted November 20, 2012 UUID supposedly generates a unique ID in MYSQL for a random customer ID if your goal is to give your user some sort of crazy random identifier for your users, but a primary unique identifier that auto increments is the best practice for identifying separate rows in your table. The auto_increment means that for each new entry it will receive an id of [the last id insert] + 1. You can also use that as your customer ID or try UUID to generate an additional identifier for your customers, but don't eliminate the primary unique id from the table. Quote Link to comment https://forums.phpfreaks.com/topic/270679-code-behind-response/#findComment-1393765 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.