
vijdev
Members-
Posts
109 -
Joined
-
Last visited
Never
Everything posted by vijdev
-
if you just refresh by browser button, after taking user confirmation for "resend data"..or some fancy mssg depending on the browser. and it must dislpay existing DB values and not update anything...
-
am in the same boat..no ajax and no JS!
-
ok, now i understand. sure, so thats not a problem.. try on these lines: if (isset($_POST['submit'] && $_POST['submit']=='Update') { if (POST inputs validated) { update table; set the table variables to the new variable value; } } query DB and assign the variables its values..(this will be new values if above section updates the table, else existing DB values; either way this will feed your table display.) display table with variable values;
-
thanks rwwd and PFMaBiSmAd. both your answers were great to help me!
-
you are not clear!, or sorry atleast i dont understand what u need!
-
are all of the following same, or some same or all different: $variable="" $variable=0 $variable=NULL and which of the above will satisfy if(empty($variable)) { blah!; }
-
can you please point me to some material?
-
looks like i've been mistaken... 1.then, the max method is also not correct, if you have 20 deleted items between 1->100, and the latest(101) also deleted, the max will say 100, but in reality you have only 80 2. what are the chances that your next auto-inc value gets overtaken in a few micro-seconds?
-
Can someone help me to generate SEO friendly URLs? I dont want my URLs to be presented like: www.example.com/listprod.php?categ=1&subcateg=7 I want it to dynamically do the following: www.example.com/listprod/cameras/slr
-
this will work only if you are not going to delete any rows - depends on your application. am assuming your field is an aut-inc field that you are trying to play with.. suppose your last was 100, and then a transaction deleted 100, then you get answer as 99, based on the current methods suggested...which truly is not the ultimately correct answer..u still need to account for the 100th value.. now if you need this to predict truly the next auto-inc, use below: http://blog.jamiedoris.com/geek/560/ <? $tablename = "tablename"; $next_increment = 0; $qShowStatus = "SHOW TABLE STATUS LIKE '$tablename'"; $qShowStatusResult = mysql_query($qShowStatus) or die ( "Query failed: " . mysql_error() . "<br/>" . $qShowStatus ); $row = mysql_fetch_assoc($qShowStatusResult); $next_increment = $row['Auto_increment']; echo "next increment number: [$next_increment]"; ?>
-
1.well, to rigidly control the inputs, you must use regular expressions to validate, which u already seem to be using..so check for the exact thing u need,,,...i use expresso to validate and play on regex.. 2.once it validates, only then, assign it to the session to take it forward..else mk that session variable="" and remember to unset the session variable when u begin a new iteration....because sessions are fluid, in a sense that the value wont change until u reset or re-assign or close browser... let me know...
-
ok, i managed with a foreach, and realized previously the foreach was executed even if the array was empty!!! fixed with an isset! thanks guys!
-
since you are moving variables from one page to another, the only way is to do it using POST, GET or storing in a session, or storing in a cookie and then taking it to next page. in this case i would prefer a session storage and call it in the second page, once it has been validated by the first page.after validation, assign the validated variable to a session like: $_SESSION['name']=$name you must decide which of the 4 methods you want, POST may not really work, coz you are not submitting or clicking a form button, GET is unsafe, and if you have long stuff, may be unwieldy, cookies-if disabled by user you need to break your head, session is the easiest option in my opinion.
-
I am validating a form, and if there are errors in the input, the error array is filled with appropriate mssg and the "sticky" form with right values is shown back, and errors on top. Example: first name, last name, email, date of birth. each field is validated,and if for example first name does not pass,i will nullify the value and populate error array like below: $_SESSSION['error']['fname']="Please check the format of the name,can contain only alphabets!" $_SESSSION['error']['email']="Please check the format of email!" When I slap back the form, last name has passed, and so will have the previously entered value, but first name and email will be empty, and i need to know how to display the 2 errors on top of the form. It uses post method, and posts to itself.
-
how to regenerate? how to detect am regenerating for a valid requets?
-
when PHPSESSID is stored in a cookie(or URL), and if some hacker gets hold of this wrongfully, can he create a pseudo-authentication, now that he has a sessionid? and then proceed with what a genuine login can do?... how to solve this?
-
its my own domain, and for certain reasons am bound from telling what it its. it is hosted on a shared hosting,the mail belongs to the same domain as is the mail server. it is not gmail. i am only looking on some elaborate information on what is meant by "authentication". if a mail server requires authentication, how does one do it?
-
now does this authentication come from: 1.the mail class setup 2.or something to do in the form script 3.or in php.ini and what kind of authentication would it be?...is it the password thats used to access [email protected] inbox?
-
can someone pls tell me why doesnt the below code work? i get an error: SMTP server response: 504 Authenticate first (#5.5.0) i have set the smtp server name in my php.ini ####################php.ini############# [mail function] ; For Win32 only. SMTP =mail.xyz.com smtp_port = 25 ; For Win32 only. sendmail_from [email protected] ###############code########################## <?php if (isset ($_POST['submit'])) { $name=$_POST['name']; $message=$_POST['text']." ".$_POST['text']; $to=$_POST['email']; $headers="From: [email protected]"; $subject="Test Mail"; mail ( $to , $subject , $message, $headers); } ?> <html> <head> <title>Say My Name</title> </head> <body> <form action="mailvij.php" method="post"> <table> <tr> <td>Name</td> <td><input type="text" name="name"></td> </tr> <tr> <td>Email</td> <td><input type="text" name="email" ></td> </tr> <tr> <td>Text</td> <td><textarea name="text" rows=5 cols=10></textarea></td> </tr> <tr> <td colspan="2" style="text-align: center;"> <input type="submit" name="submit" value="Submit" /></td> </tr> </table> </form> </body> </html>