chuddyuk Posted April 11, 2006 Share Posted April 11, 2006 i have a script i have been having problems password protecting, it dosnt need to be a really secure login at all.Here is the code:[code]<html> <head><title>Questionnaire</title></head> <body><?php// Set Emails$to = 'chuddyuk@gmail.com' . ', '; // note the comma// $to .= 'mamorris62@hotmail.com';//Set Subject Of Email$subject ="Synergy Questionnaire Response";// Handle POST method set ALL :( variables if ($_POST) { $today = date("d-m-Y"); $name = $_POST['name']; $company = $_POST['company']; $department = $_POST['department']; $comments = $_POST['comments']; $qone = $_POST['qone']; $qtwo = $_POST['qtwo']; $qthree = $_POST['qthree']; $qfour= $_POST['qfour']; $qfive = $_POST['qfive']; $qsix = $_POST['qsix']; $qseven = $_POST['qseven']; $qeight = $_POST['qeight']; $qnine = $_POST['qnine']; $qten = $_POST['qten']; $qeleven = $_POST['qeleven']; $qtwelve = $_POST['qtwelve']; $qthirteen = $_POST['qthirteen']; $qfourteen = $_POST['qfourteen']; $qfifteen = $_POST['qfifteen']; $qsixteen = $_POST['qsixteen']; $qseventeen = $_POST['qseventeen']; $qeightteen = $_POST['qeightteen']; $qnineteen = $_POST['qnineteen']; $qtwenty = $_POST['qtwenty']; $qtwentyone = $_POST['qtwentyone']; $qtwentytwo = $_POST['qtwentytwo']; $qtwentythree = $_POST['qtwentythree']; $qtwentyfour = $_POST['qtwentyfour']; $qtwentyfive = $_POST['qtwentyfive']; $qtwentysix = $_POST['qtwentysix']; $qtwentyseven = $_POST['qtwentyseven']; $qtwentyeight = $_POST['qtwentyeight']; $qtwentynine = $_POST['qtwentynine']; $qthirty = $_POST['qthirty']; $qthirtyone = $_POST['qthirtyone']; $qthirtytwo = $_POST['qthirtytwo']; $qthirtythree = $_POST['qthirtythree']; $qthirtyfour = $_POST['qthirtyfour']; $qthirtyfive = $_POST['qthirtyfive']; $qthirtysix = $_POST['qthirtysix']; $qthirtyseven = $_POST['qthirtyseven']; $qthirtyeight = $_POST['qthirtyeight']; $qthirtynine = $_POST['qthirtynine']; $qfourty = $_POST['qfourty']; $qfourtyone = $_POST['qfourtyone']; $qfourtytwo = $_POST['qfourtytwo']; $qfourtythree = $_POST['qfourtythree']; $qfourtyfour = $_POST['qfourtyfour']; $qfourtyfive = $_POST['qfourtyfive']; $qfourtysix = $_POST['qfourtysix']; $qfourtyseven = $_POST['qfourtyseven']; $qfourtyeight = $_POST['qfourtyeight']; $qfourtynine = $_POST['qfourtynine']; $qfifty = $_POST['qfifty']; $qfiftyone = $_POST['qfiftyone']; $qfiftytwo = $_POST['qfiftytwo']; $qfiftythree = $_POST['qfiftythree']; // message (how its appears in the email)$message = "<h1>Questionnaire Results</h1><p> Name: $name<br> Company : $company<br> Department: $department<br> Date Submitted: $today</p><hr><br>Parts 1-6 use the scale below:<table width=600 border=1> <tr> <td bgcolor=#00CCFF><div align=center><strong>1</strong></div></td> <td bgcolor=#0099FF><div align=center><strong>2</strong></div></td> <td bgcolor=#0066FF><div align=center><strong>3</strong></div></td> <td bgcolor=#0033FF><div align=center><strong>4</strong></div></td> <td bgcolor=#0000FF><div align=center><strong>5</strong></div></td> <td bgcolor=#0000CC><div align=center><strong>6</strong></div></td> </tr> <tr> <td><div align=center>Very definitely not a source of pressure</div></td> <td><div align=center>Mostly not a source of pressure</div></td> <td><div align=center>Generally is not a source of pressure</div></td> <td><div align=center>Generally is a source of pressure</div></td> <td><div align=center>Mostly is a source of pressure</div></td> <td><div align=center>Most definitely a source of pressure</div></td> </tr></table><h3>(1)Relationships</h3><br>1) Relationships with colleagues in my immediate workgroup: $qone<br>2) Relationships with colleagues in other parts of the organisation: $qtwo<br>3) Relationships with people outside the organisation (e.g. customers): $qthree<br>4) Relationships with my immediate supervisor: $qfour<br><br><h3>(2)Work Demands</h3><br>1)The amount of work I have to do: $qfive<br>2) The pace at which I need to work: $qsix<br>3) Attending meetings: $qseven<br>4) Dealing with correspondence (e.g. telephone calls, letter writing or emails): $qeight<br>5) Getting things done on time (e.g. meeting deadlines): $qnine<br>6) The environmental conditions in which I work: $qten<br><br><h3>(3)Culture and Change</h3><br>1) Lack of consultation when any organisational changes or planned changes are taking place: $qeleven<br>2) The systems and procedures in place to get things done in my job: $qtwelve<br>3) The amount of change that affects the way I do my work: $qthirteen<br>4) The way change is managed in my workgroup: $qfourteen<br>5) The processes I have to work with (e.g. systems and standards): $qfifteen<br>6) The way people interact with each other to get the job done (e.g. teamwork): $qsixteen<br><br><h3>(4)Role</h3><br>1) My role and responsibilities within the organisation: $qseventeen<br>2) Opportunities to advance within the organisation: $qeightteen<br>3) Opportunities to develop my job related skills: <b>$qnineteen</b><br>4) The amount of positive challenges in my current role (e.g. incentives): $qtwenty<br><br><h3>(5)Control</h3><br>1) Level of control over my work (e.g. workload, self autonomy): $qtwentyone<br>2) Opportunity to use my own discretion: $qtwentytwo<br>3) My training needs: $qtwentythree<br>4) Resources to perform my job: $qtwentyfour<br>5) Control to schedule my workload (e.g. sequencing): $qtwentyfive<br>6) The flexibility to manage my time at work: $qtwentysix<br><br><h3>(6)Personal Factor</h3><br>1) Coping with home life responsibilities: $qtwentyseven<br>2) My work-base knowledge and skills: $qtwentyeight<br>3) Commuting between work and from home: $qtwentynine<br>4) Lack of respect from my immediate Manager: $qthirty<br>5) Lack of respect from colleagues: $qthirtyone<br>6) Level of experience to perform my job effectively: $qthirtytwo<br><hr><br>Parts 7 and 8 use the scale below:<table width=600 border=1> <tr> <td width=10% bgcolor=#00CCFF><div align=center><strong>1</strong></div></td> <td width=10% bgcolor=#0099FF><div align=center><strong>2</strong></div></td> <td width=10% bgcolor=#0066FF><div align=center><strong>3</strong></div></td> <td width=10% bgcolor=#0033FF><div align=center><strong>4</strong></div></td> <td width=10% bgcolor=#0000FF><div align=center><strong>5</strong></div></td> <td width=10% bgcolor=#0000CC><div align=center><strong>6</strong></div></td> </tr> <tr> <td><div align=center>Very strongly disagree</div></td> <td><div align=center>Strongly disagree</div></td> <td><div align=center>Disagree</div></td> <td><div align=center>Agree</div></td> <td><div align=center>Strongly agree</div></td> <td><div align=center>Very Strongly agree</div></td> </tr></table><br><h3>(7)Support</h3><br>1) I am able to seek help and advice when required from my Manager/Supervisor: $qthirtythree<br>2) I am able to seek help and advice from my colleagues when /if required: $qthirtyfour<br>3) Objectives from my immediate Manager are clear: $qthirtyfive<br>4) I am given adequate feedback from my Manager/Supervisor: $qthirtysix<br>5) My work is recognised and acknowledged by my Manager/Supervisor: $qthirtyseven<br>6) I feel confident to freely contact my immediate Manager for support: $qthirtyeight<br><br><h3>(8)Connection With The Organisation</h3><br>1) I am proud to work for this organisation: $qthirtynine<br>2) I would recommend this organisation as an employer to my friends and family: $qfourty<br>3) My work adds value to the organisation: $qfourtyone<br>4) There is a clear link between my work and the organisation’s objectives: $qfourtytwo<br><hr><br>Parts 9-11 use the scale below:<table width=600 border=1> <tr> <td width=10% bgcolor=#00CCFF><div align=center><strong>1</strong></div></td> <td width=10% bgcolor=#0099FF><div align=center><strong>2</strong></div></td> <td width=10% bgcolor=#0066FF><div align=center><strong>3</strong></div></td> <td width=10% bgcolor=#0033FF><div align=center><strong>4</strong></div></td> <td width=10% bgcolor=#0000FF><div align=center><strong>5</strong></div></td> <td width=10% bgcolor=#0000CC><div align=center><strong>6</strong></div></td> </tr> <tr> <td><div align=center>Never</div></td> <td><div align=center>Very Rarely</div></td> <td><div align=center>Occasionally</div></td> <td><div align=center>Often</div></td> <td><div align=center>Very Often</div></td> <td><div align=center>All The Time</div></td> </tr></table><br><h3>(9)Work Life Balance</h3><br>1) I effectively manage the demands of my work, personal and family life: $qfourtythree<br>2) I find myself doing job related work in my own time (e.g. at home): $qfourtyfour<br>3) I have the flexibility to meet my work, personal and family commitments: $qfourtyfive<br>4) The organisation is committed to helping me to balance my work and home life: $qfourtysix<br><br><h3>(10)Engagement With Work</h3><br>1) I am satisfied with the enjoyment I get from work: $qfourtyseven<br>2) I feel inspired about my work: $qfourtyeight<br>3) I feel motivated to do my best at work: $qfourtynine<br>4) I have the necessary resources to do my job effectively: $qfifty<br><br><h3>(11)Effects Of Pressure</h3><br>1) I feel physically or emotionally drained at the end of my working day: $qfiftyone<br>2) I think about looking for another job: $qfiftytwo<br><hr><br>Part 12 uses the scale below:<table width=600 border=1> <tr> <td width=10% bgcolor=#00CCFF><div align=center><strong>1</strong></div></td> <td width=10% bgcolor=#0099FF><div align=center><strong>2</strong></div></td> <td width=10% bgcolor=#0066FF><div align=center><strong>3</strong></div></td> <td width=10% bgcolor=#0033FF><div align=center><strong>4</strong></div></td> <td width=10% bgcolor=#0000FF><div align=center><strong>5</strong></div></td> </tr> <tr> <td><div align=center>Bored</div></td> <td><div align=center>Comfortable</div></td> <td><div align=center>Stretched</div></td> <td><div align=center>Strained</div></td> <td><div align=center>Overwhelmed</div></td> </tr></table><br><h3>(12)Workplace Perceptions</h3><br>1) How do you generally feel towards your role?: $qfiftytwo<br><br><h3>Comments</h3><p>$comments</p>";// Set Email To HTML$headers = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";$headers .= 'From: Aname <Name@Asite.com>' . "\r\n";// Send Email! mail($to, $subject, $message, $headers);// Confirmation To Userecho "<center><h2>Thankyou very much for your time in completing this questionnaire</h2><img src=synergy_gleam_logo.jpg alt=Logo width=327 height=102 /></center>"; } else {// include the questionnaireinclude "htmlform.php"; } ?> </body></html>[/code]wen i add a login script, and put in the user/pass, and submit all that appears is my thankyou page and not the questionnaire. does any know how to make it show the questions and not the thankyou page. or does anyone know how to add http auth using php to this, because i tried that and it wouldnt workthanks in advanceandrew Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted April 11, 2006 Author Share Posted April 11, 2006 This is doin my head in really badly. anyone got any ideas at all? please!!!!!!!! Quote Link to comment Share on other sites More sharing options...
trq Posted April 11, 2006 Share Posted April 11, 2006 [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]wen i add a login script,[/quote]What login script? Try posting relevent code when you ask questions, were not mind readers. Quote Link to comment Share on other sites More sharing options...
chuddyuk Posted April 11, 2006 Author Share Posted April 11, 2006 ok - sorry here is wat im trying amonst other things[code] <? $username = "andrew"; $password = "andrew"; if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {?> <h1>Login</h1><form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br/><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p></form><?php }else { echo"page stufff here?";?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.