I am using iframe to display other's webpage in my webpage in that other's page user give's his data and submit it on other's webpage, after that it gives some result, How can i get the data from the other's page, i am using PHP.
I am pretty new to php and i am trying my hands on something little but i"m getting a persistent error.
I am trying to insert a record into the database but i keep getting the error saying the record wasn't inserted.
i checked the databse and there's really nothing there.
Below is the php code. Please let me know the error and guide me through the changes.
// Define database credentials
$host = 'localhost';
$user = 'admin';
$password = '12345';
$database = 'staff_db';
// Create db connection
$conn = mysql_connect($host,$user,$password) or die('Error: Could not connect to database - '.mysql_error());
// Once connected, we can select a database
mysql_select_db($database,$conn) or die('Error in selecting the database: '.mysql_error());
// Grab user input and sanitize
$title = mysql_real_escape_string(filter_var(trim($_POST['Title']), FILTER_SANITIZE_STRING));
$fname = mysql_real_escape_string(filter_var(trim($_POST['FirstName']), FILTER_SANITIZE_STRING));
$mdname = mysql_real_escape_string(filter_var(trim($_POST['MiddleName']), FILTER_SANITIZE_STRING));
$lname = mysql_real_escape_string(filter_var(trim($_POST['LastName']), FILTER_SANITIZE_STRING));
$res_add = mysql_real_escape_string(filter_var(trim($_POST['Resid_Add']), FILTER_SANITIZE_STRING));
if(! $res_tel = mysql_real_escape_string(filter_var(trim($_POST['Resid_Tel']), FILTER_SANITIZE_NUMBER_INT)))
echo'Please enter a valid telephone number.';
if(! $mobile = mysql_real_escape_string(filter_var(trim($_POST['Mobile']), FILTER_SANITIZE_NUMBER_INT)))
echo'Please enter a valid mobile number.';
//$frmstaff_status = mysql_real_escape_string(filter_var(trim($_POST['frmStaff_Status']), FILTER_SANITIZE_STRING));
// Validate the user email
if(! $email = filter_var(trim($_POST['Email']), FILTER_VALIDATE_EMAIL))
echo'Please enter a valid email.';
$sql = 'INSERT INTO `$database`.`Emp_Details` (
VALUES (".$title." , ".$fname." , ".$mdname.", ".$lname.", ".$res_add.", ".$res_tel.", ".$mobile.", ".$email.")';
echo'User information saved successfully.';
echo'Error: We encountered an error while inserting the new record.';
I would like to get the sum of all the fields in columns. where columns are dynamic even the rows are dynamic.
Hi here in my table the user can add column's dynamically, so i won't be knowing the columns name to raw code initially as $row['SUM(price)']. Hence I need a query which can pull by itself all the column values
Hello masters of web developing. I have an average experience in C# and I like to know that how much does it take to be a great developer in PHP by considering that I put my time on this 24/7. Why I didn't choose ASP.NET is that I think it is much time consuming than learning PHP and I like to work with current famous CMSes like Wordpress and Drupal.
// First we execute our common code to connection to the database and start the session
// At the top of the page we check to see whether the user is logged in or not
// If they are not, we redirect them to the login page.
// Remember that this die statement is absolutely critical. Without it,
// people can view your members-only content without logging in.
die("Redirecting to login.php");
?><html><body><linkrel="icon"type="image/gif"href="favicon.gif"/><?php include("header.php"); ?><divid="main-box"><ul><liclass="buttons"><?php
TEXT BOX WITH A LINE FROM **TEXT.txt** SHOULD APPEAR HERE AFTER USER CLICKS BUTTONS
<input type="button" name="account" value="Get Your Account" onclick="#" />
I want it so when the user clicks the button, a text box appears and displays ONE line from the text file and when they view it, it deletes it from the text file.
So after the user clicks the button it displays "Eddie" line to them and then deletes it after the user sees it so that the next line "Apples" would then become the first line.
If you don't understand my question then please let me know and I will try to explain further. Thank you.
I have a table fetched using ajax, according to the choice made from my dropdown menu. In the table I have some input fields. I need to save my inputs in the table while submitting it.
If I check the source code of the page I cannot find the table fields to post using $_post since ajax is used. I am really new to ajax. Can anybody please tell me how I can submit these table input values in PHP?
In one page you use:
header('Location: ' . $url);
Suppose $url = 'www.example.com/abcd.php?action=register';
And in the "abcd.php" page just do a $_GET['action'] to get the action!
And then you do something, in this case you show a div to register!
Hope I can help,
From your posting in a thread below, you are at the beginner level in the learning phase. It will take you quite a while before you become competent. I would suggest you grab hold of this book and work through it doing some of the exercises.
Beginning PHP and MySQL: From Novice to Professional by W. Jason Gilmore
You could also visit the nettuts website, search for beginning php, and view their video tutorials.
When you feel you have reached some maturity in this PHP/MySQL subject, go look at, for example, SourceForge[^] who have a number of Open Source projects under some level of development.
Go to this page here and it gives a full rundown of how-to for differing applications. XAMPP or WAMP products are very good. I have tried XAMPP and it installs very easily and sets up very well. Easy to use and learn. It installs mysql, php, apache etc for you all at once as I assume WAMP does also. To answer one of your posts, either product provides a whole package for you to begin.
now i want send emails with ssl authentication and after build a customized client for sending mails and viewing reiceived mails. i searched for that and i found some interresting things, and i understood that they used some third party packages, like phpmailer, curl and pear's mail which need to be installed and modify the php.ini file for ssl library, allowing to send via external servers like gmail which is very nice thing and i know that i can use it with my subdomain server as well.
the problem is that i don't have access to the php.ini file, and even if i can, i don't want do that because i know that i have already everything installed with my registration, and the proof was the two test e-mails.
what i can't know is which package my registeration is using. i give some config infos of my subdomain that i got from phpinfo() to help you :
i have the incoming and outgoing servers with their corresponding ports for both secured and non secured mail services (servers used for ssl and non-ssl are different).
PHP Version 5.3.3
Registered Stream Socket Transports : tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
mail.add_x_header On On
zend.enable_gc On On
cURL support enabled
Protocols tftp, ftp, telnet, dict, ldap, ldaps, http, file, https, ftps, scp, sftp
SSL Support enabled
Kerberos Support enabled
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.0.0-fips 29 Mar 2010
OpenSSL Header Version OpenSSL 1.0.0-fips 29 Mar 2010
Sockets Support enabled
in some tutos, they say that php4 and later (which the case here) comes with built-in pear mail package, but i dont know how to verify that. i think it is an issue, no ?!!!!
so i tried a code (How to Send Email from a PHP Script Using SMTP Authentication By Heinz Tschabitscher) but it gives me a require_once error, because this :
it told me that the file deosn't exist in the include path or something like that.
sorry if my message is very long but i want make it clear and easy for anyone want help me.
thank you for your effort.
Last Visit: 31-Dec-99 18:00 Last Update: 18-Apr-14 2:17