|
-
Jan 20th, 2007, 01:01 AM
#1
Thread Starter
New Member
Passing sql data to a 2nd php file
I have a php script running fine which allows an "admin" to insert/change their email address and stores it in the SQL database. My problem is that I am using a 2nd php script which is just a simple "contact me" form which emails the admin the form results.
I want the admin email (recipiant) for the "contact me" form to be the email address found in the database. Within the contact me form I have the variable:
This script connects with the database just fine, I just dont know what code to insert in order for the email address in the database to be used along with this script. Any suggestions would be greatly appreciated.
-
Jan 20th, 2007, 01:57 AM
#2
Re: Passing sql data to a 2nd php file
honestly, after reading what you said, I have absolutely no clue what you're trying to do at all.. so I'm going to try to piece it together:
your title says you want to pass some SQL data to a second PHP file. that's fine, all you need to do is insert the data with an ID and then load the second page with a POST, GET, COOKIE or SESSION variable containing that ID. then, you just have to select that data from the database where the ID in the database is equal to the ID in the variable and print out the data or use it for whatever.
-
Jan 20th, 2007, 08:57 AM
#3
Thread Starter
New Member
Re: Passing sql data to a 2nd php file
For example, in the database the admin email address is saved as "adminemailaddress". I want the contact me form to email the form results to "adminemailaddress". I don't want the email address to be displayed on the page like an echo command would do, I just want the script to see what the email address is within the database without displaying anything on the page.
-
Jan 20th, 2007, 09:01 AM
#4
Re: Passing sql data to a 2nd php file
-
Jan 20th, 2007, 09:18 AM
#5
Thread Starter
New Member
Re: Passing sql data to a 2nd php file
 Originally Posted by sitefever
I have a php script running fine which allows an "admin" to insert/change their email address and stores it in the SQL database. My problem is that I am using a 2nd php script which is just a simple "contact me" form which emails the admin the form results.
I want the admin email (recipiant) for the "contact me" form to be the email address found in the database. Within the contact me form I have the variable:
This script connects with the database just fine, I just dont know what code to insert in order for the email address in the database to be used along with this script. Any suggestions would be greatly appreciated.
After much headache, here was the solution:
VB Code:
$nasaadresa = "{$arow['adminemailaddress']}"; //please replace this with your address
Works fine.
-
Jan 20th, 2007, 09:20 AM
#6
Re: Passing sql data to a 2nd php file
Oh of course, I should have guessed. Such an obvious solution, how foolish of me.
-
Jan 20th, 2007, 09:31 AM
#7
Thread Starter
New Member
Re: Passing sql data to a 2nd php file
I appreciate your assistance. Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|