Yes I did both of those things! The actual form that it needs to work off of is at http://mideasthonors.org/addmember.php so I cannot change that form! But the php coding is in the addMember.php page you instructed me to use. I also uploaded the table into SQL.
Need help with scripting to store data on MySQL
Collapse
X
-
-
if thats the form that is being used and not the one i gave you then you need to change the names within the $_POST to correspond with the field names from the form i.e.
name
address_1
address_2
city
state
zip
website
contact_name
contact_positio n
contact_phone
contact_email
there is no need so change any variable names you just change what is in the postvar i.e.
$_POST['changeMe']Comment
-
Do I also need to change everything in the sql as well?? Everything is still the same that is on the page that you gave me except the error: error_reporting (E_ALL); at the top. Its just that they need to enter their information from mideasthonors.o rg/addmember.php instead of addmembererror. php. Does that make sense??? I mean the same form is on both pages, just at the top it states that information was not filled in accurately.Comment
-
hi all, I've got a problem with a script...
I need, through a vbscript, to move a 3parth win32 application to 0,0 (x,y) coordination of my desktop.
I know there is the "SetWindowP os" function in user32.dll API, maybe that what I need, but:
BOOL SetWindowPos(
HWND hWnd,
HWND hWndInsertAfter ,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);
I don't have the parameters to pass, I do not have the handle to that window and I don't know how to get the others...
I can call it by:
"run32.exe user32dll,SetWi ndowPos hwnd,hWndInsert After,x,y,cx,cy ,wFlags"
I found my window by this trick but is not useful to me:
set wsh=wscript.cre ateobject("wscr ipt.shell")
do
w = wsh.appactivate ("Found New Hardware Wizard")
if w then 'FOUND IT
loop while t<10000
And...
after that I have to add a vertical and an horizontal scroll bar...
Too much for me...
Could you please help me?
Is that the right way to do it?
Any comment will be appreciate.
Thanks,Last edited by Frinavale; Jul 30 '09, 01:48 PM. Reason: Link removed. Please do not post links that are not relevant to aiding in solving the problem.Comment
-
no....as the sql i made for you works with the variables that were set from each $_POST all that needs to be changed is the names within the $_POST vars as they still append to those variables set to use in the sql queryComment
-
Everything is still the same that is on the page that you gave me except the error: error_reporting (E_ALL); at the top. Its just that they need to enter their information from mideasthonors.o rg/addmember.php instead of addmembererror. php. Does that make sense??? I mean the same form is on both pages, just at the top it states that information was not filled in accurately.Comment
-
yes it makes sense and as i said you need to change the names within the $_POST so they match the addmember.php form. they need to look like these
Code:$_POST['name'] $_POST['address_1'] $_POST['address_2'] $_POST['city'] $_POST['state'] $_POST['zip'] $_POST['website'] $_POST['contact_name'] $_POST['contact_position'] $_POST['contact_phone'] $_POST['contact_email']
Code:<form method="post" action="addmember.php" style="width: 169px"> * <table> <tr> <td colspan=2><h2 class="style29">Institution Information</h2></td> </tr> <tr> <td class='style30'><p class="style31"><label for='name'>Institution*</label></p></td> <td class="style30"><input type="text" name="name" size=45 maxlength=100 value="" /></td> </tr> <tr> <td class='style30'><p class="style31"><label for='address_1'>Address*</label></p></td> <td class="style30"><input type="text" name="address_1" size=45 maxlength=100 value="" /></td> </tr> <tr> <td class="style30"> </td> <td class="style30"><input type="text" name="address_2" size=45 maxlength=100 value="" /></td> </tr> <tr> <td class='style30'><p class="style31"><label for='city'>City*</label></p></td> <td class="style30"><input type="text" name="city" size=45 maxlength=50 value="" /></td> </tr> <tr> <td class='style30'><p class="style31"><label for='state'>State*</label> <td class="style30"> <select name='state'> <?php $states = array("Illinois", "Indiana", "Kentucky", "Michigan", "Ohio", "Pennsylvania", "Tennessee", "West Viriginia"); foreach($states as $a => $value){ echo "<option name=".$value ." value=".$value .">$value</option>"; } ?> </select> </td> </tr> <tr> <td class='style30'><p class="style31"><label for='zip'>ZIP Code*</label></p></td> <td class="style30"><input type="text" name="zip" size=10 maxlength=10 value="" /></td> </tr> <tr> <td class='style30'><p class="style31"><label for='website'>Website*</label></p></td> <td class="style30"><input type="text" name="website" value="http://www." size=45 maxlength=100 value="" /></td> </tr> <tr> <td colspan=2><h2 class="style29">Contact Information</h2></td> </tr> <tr> <td class='style30'><p class="style31"><label for='contact_name'>Contact Name*</label></p></td> <td class="style30"><input type="text" name="contact_name" size=45 maxlength=100 value="" /></td> </tr> <tr> <td class='style30'><p class="style31"><label for='contact_position'>Position</label></p></td> <td class="style30"><input type="text" name="contact_position" size=45 maxlength=100 value="" /></td> </tr> <tr> <td class='style30'><p class="style31"><label for='contact_phone'>Phone Number*</label></p></td> <td class="style30"><input type="text" name="contact_phone" size=14 maxlength=14 value="" /></td> </tr> <tr> <td class='style30'><p class="style31"><label for='contact_email'>Email Address*</label></p></td> <td class="style30"><input type="text" name="contact_email" size=45 maxlength=100 value="" /></td> </tr> <tr> <td class="style30"> </td> <td class="style30"><input type="submit" name ="Add Member" value="Add Member" /></td> </tr> </table> </form>
Comment
-
OK! So I changed the posts to match what I have on the form...and still no luck!
I am not sure if the for instance this would be part of the problem "phone_numb er" what is the underscored line for??? And do I need to do anything for the member ID number since it is a hidden number that should be assigned randomly???
Here is what I have for the addmember_db.ph p:
[code=php]
<?php
include ("admintasks-dbcon.php");
mysql_connect($ hostname,$usern ame, $password) OR DIE ('Unable to connect to database! Please try again later.');
mysql_select_db ($dbname);
$query = "SELECT * FROM add_member WHERE memberID = '{memberID}'";
$result = mysql_query( $sql ) or die( mysql_error );
if ( mysql_num_rows( $res ) > 0 )
{
$query="
SELECT add_member SET
name = $_POST ['name'];
address 1 = $_POST ['address_1'];
address 2 = $_POST ['address_2'];
City= $_POST ['city'];
State = $_POST ['state'];
Zip Code = $_POST ['zip'];
Website = $_POST ['website'];
Contact Name = $_POST ['contact_name'];
Position = $_POST ['position'];
Phone Number = $_POST ['phone_number'];
Email Address = $_POST ['email_address'];)
WHERE memberID ='{$memberID}'" ;
}
else{
$query="
INSERT INTO add_member (
'Member ID',
'Name',
'Address 1',
'Address 2',
'City',
'State',
'Zip Code',
'Website',
'Contact Name',
'Position',
'Phone Number',
'Email Address')
VALUES
'{$_POST['memberID']}',
'{$_POST['name']}',
'{$_POST['address_1']}',
'{$_POST['address_2']}',
'{$_POST['city']}',
'{$_POST['state']}',
'{$_POST['zip']}',
'{$_POST['website']}',
'{$_POST['contact_name']}',
'{$_POST['position']}',
'{$_POST['phone_number']}',
'{$_POST['email_address']}')";
$result=mysql_q uery($query) or die("Error in query:".mysql_e rror());
if ( mysql_num_rows( $result ) > 0 )
echo mysql_affected_ rows()." row inserted into the database effectively.";
mysql_close();
}
session_start() ;
$_SESSION["Name"] = $_POST['name'];
header("locatio n:thankyouforbe comingamember.p hp");
?>
[/code]
and the result of filling in the form and clicking the add member button is: "mysql_erro r"Comment
-
that whole piece of coding is incorrect.....y ou have gone back to your original model instead of using what i fixed for you and just changing the names in the $_POST vars.......Comment
-
OK I see what you are saying. I redid the coding and I am getting a header error now!
[code=php]
<?
include ("admintasks-dbcon.php");
$memberID = $_POST['memberID'];
$institutionNam e = $_POST['institutionNam e'];
$address1 = $_POST['address_1'];
$address2 = $_POST['address_2'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipCode = $_POST['zipCode'];
$website = $_POST['website'];
$contactName = $_POST['contactName'];
$position = $_POST['position'];
$phoneNumber = $_POST['phone'];
$email = $_POST['email'];
// OPEN CONNECTION --->
mysql_connect($ hostname,$usern ame,$password);
@mysql_select_d b($dbname) or die( "Unable to select database");
$sql = "SELECT * FROM addMember WHERE email = '{$email}'";
$res = mysql_query( $sql ) or die( mysql_error );
if ( mysql_num_rows( $res ) > 0 )
{
session_start() ;
$_SESSION["contactNam e"] = $contactName;
header("locatio n:alreadyMember .php");
}
else{
$query="INSERT addMember (
memberID,
institution,
address1,
address2,
city,
state,
zip,
website,
contactName,
position,
phoneNumber,
email)
VALUES ( '".$memberID."' ,
'".$institution ."',
'".$address1."' ,
'".$address2."' ,
'".$city."',
'".$state."' ,
'".$zipCode. "',
'".$website. "',
'".$contactName ."',
'".$position."' ,
'".$phoneNumber ."',
'".$email."' )";
$result=mysql_q uery($query) or die("Error in query:".mysql_e rror());
session_start() ;
$_SESSION["contactNam e"] = $contactName;
header("locatio n:thankyouforbe comingamember.p hp");
}
mysql_close();
// CLOSE CONNECTION --->
?>
[/code]
This is the error I am getting:
Warning: session_start() [function.sessio n-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/m/i/d/mideasthonors/html/addmember_db.ph p:1) in /home/content/m/i/d/mideasthonors/html/addmember_db.ph p on line 29
Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/addmember_db.ph p:1) in /home/content/m/i/d/mideasthonors/html/addmember_db.ph p on line 31
_______________ _______________ _______________ _______________ __
I know this is frustrating, but I really do appreciate all your help. I am just confused on what the issues are. Like I initially said I am still very new to php and have come up with what I originally had on my own, so I am sorry if I do not understand everything to a "T"...I was a PSCI major for my BA and am now a Public Admin. major for my masters, php is NOT my thing. But I have to make this website work for my graduate assistantship, so once again I apologize for not understanding everything you guys are laying out for me. It may be very easy for you to understand but is quite difficult for me. I do not want to copy and paste what you gave me, I would like to figure it out on my own, but at the same time I feel like I am in a realm that I do not understand when I get responses from each of you....at any rate thank you all for your help.Comment
-
there seems an output to be sent. I suspect the UTF-8 BOM (Byte Order Mark). you need to open the file in an editor, which can show you hidden characters. it should be right at the beginning of the first line.
once the session error is fixed, the header error should disappear.Comment
-
I opened the file in Notepad++ and there was nothing before <? so I am not sure what else I am looking for. I have attached the file in notepad.Attached FilesComment
-
I get the header error. I changed the variables in the _POST and added the dollar signs prior to each variable so they are identified. That is exactly what the other person informed me to do!Comment
-
Comment
Comment