OOP
-
Posts
146 -
Joined
-
Last visited
Posts posted by OOP
-
-
Hi there,
The action attribute specifies where to send the form-data when a form is submitted so you need to replace the '#' with your target file. Now, I don't know what you are doing in your PHP file but the global array $_POST will have the value of all of your form inputs fields which can be used in order to process your contact form. For example, in order to get the value of the input field "fullname" you can do something like this
$fullName = $_POST['fullname];
Not to forget to say that you must not trust any inputs and must clean all before using in your script
Hope this is easy to understand
-
Why?
Barand, because he is using the $_POST super global array in his script and not the $_GET
-
Hey, I hope that what you were looking for
-
You need to execute the query against your database using the mysql_query($query). You are not doing anything in your code and that is why your information is not getting inserted in the database. One more thing, the form method should be "post" instead of "get"
-
I tried to open the page but it does not work for me!!!
-
lluvatar+
What is your database character set? I am pretty sure it has something to do with that and the encoding you are using when displaying the page.
Regards
-
I believe this has something to do with character set used in your database, if I am not mistaken
-
You may also want to validate both email and password fields, I mean the format, as extra security measures.
-
That is my problem, Christian . Being too kind
-
Hi kdigital,
It would be helpful if you can post your code, or at least the portion you are talking about, so that we can provide the required help.
-
I tried you code on my PC and it works fine except that it shows the thanks message twice. Once before the form, and the other after the form upon successful form submission. I have modified the code a bit, you may try it.
<html> <head> </head> <body> <?php if (isset($_POST['submit'])) { if ( empty($_POST['email']) || !preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$_POST['email'])) { $msg = 'please provide a valid email'; } else { $email = $_POST['email']; $recipient = "myemail@myemail.com"; $subject = "Contact Form Email Subject"; $message = "your email message"; $mailheader = "From: $email \n"; mail($recipient, $subject, $message, $mailheader) or die("Error!"); $msg = "<font color='green' size='3'>Thank You for your message.</font>"; } } ?> <form method="POST"> <p align="center"> Enter your valid email id: <br> <input type="text" name="email"> <br> <input type="submit" name="submit" value="Subscribe now!"> </form> <?php echo $msg; ?> </body> </html>
-
Hi there,
I beleive the "language" attribute in script tag is obsolete in HTML5, remove it and that should solve your issue.
-
Okay, I just spent few minutes trying to rewrite your code. Please find the attached modified scripts.
Should you need any further clarification, please let me know
Best regards
-
You are most welcome my friend, any time
-
Hi there,
you can simply change your statement to the below:
if (!isset($_SESSION['user_level']) || ( ($_SESSION['user_level'] != 'A') AND ($_SESSION['user_level'] != 'B')) ) { //redirect to the restricted page notice }
That should work
-
Hi there,
In order to remove the smarty engine code, just remove the below lines from the file index.php
// This line is needed in order to include the smarty engine class[/color]
require("comm/Smarty.class.php");
// In here, you are creating a new smarty engine object and asking it
// to display the books list using the template "index.tpl"
$smarty = new Smarty;
$smarty->assign("book",$book);
$smarty->display('index.tpl');
But you need to edit the code inside "index.tpl" and remove any reference to smarty inside it, I mean use pure PHP to display the book list.
I hope that answers your question
-
Now after you mentioned the "sid", maybe you are talking about cookies values, if any, which are sent by the browser to the server whenever you send a new HTTP request
-
Okay,
Is your product code random? or does it have to start with character? can you specify the format you want to validate?
-
The regex I have provided above will match any alphanumeric? This is what you want, right?
change it to this and it will not accept empty string
"^[a-zA-Z0-9]+$"
-
Hi there,
Do you mean that you have a variable in one page and you want to display it in another page?
regards
-
Hi there
You can use this
"^[a-zA-Z0-9]*$"
-
You can use the count and a join sql statement to achieve that
-
Hi there,
There is nothing wrong with your validation code but you don't need to the use the header() to redirect the same page again. In the form action attribute, you can put the value "reg.php" as your script that will handle the validation.
if(!isset($_POST['submit'])){ <form action="reg.php" method="post"> the rest of the fields here <input type="submit" name="submit" /> </form> }else{ if ($_POST['email1'] !== $_POST['email2']) { $error='email_no_matchname'; } else { . . . . }
regards
-
Hi there,
Where is the part of your script in which you fill out the form from the cookies? Also, I don't think this is a good idea? What are you trying to achieve by auto filling the form?
regards
Hiding login form and its div after user logged in
in PHP Coding Help
Posted
Hi edgarasm,
Is your HTML code complete? I am a bit confused as I can see three open form tags each pointing to different php script. One more thing, it is not secure to use user provided inputs directly in your SQL statement.