Jump to content

luke1438

New Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

luke1438's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I know nothing of PHP coding and have bought a php membership program called aMember. All I am trying to do is get each member's name to display on the top of each page. The company says they use something called Am Lite in conjunction with their php code to call up the member name. they gave me the folling instructions: Here is example of usage <?php // it should be first line on your page require_once '/home/myusername/public_html/amember/library/Am/Lite.php'; ?> ...your code... <?php if (Am_Lite::getInstance()->isLoggedIn()) : ?> Welcome <?= htmlspecialchars(Am_Lite::getInstance()->getName() ) ?>! <?php endif; ?> ....your code... I have tried various variations of arranging the code on a php page - see attached - and nothing seems to work. I get the following errors: Warning: require_once(/public_html/amember/library/Am/Lite.php): failed to open stream: No such file or directory in /home/tradeco/public_html/ts_main_1920/login_name_test.php on line 5 Fatal error: require_once(): Failed opening required '/public_html/amember/library/Am/Lite.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tradeco/public_html/ts_main_1920/login_name_test.php on line 5 Any help and or guidance would be greatly appreciated. Thanks in advance Luke login_name_test.php
  2. I am attempting to create a form that records peoples names and e-mails for a subscription to my newsletter. I don't think my MySQL database is correct because when I export it there are no headings. The form I created does not seem to be validating the entries. And, I have no clue if my .php form is correct. Up until a week ago I did not even know what .php was and the only exposure I had to SQL was the oversite of an accounting package conversion; I had 3 different SQL programmers that handled it all. I just want to collect peoples names and e-mail addresses so I can send out my newsletter; I do not know anywhere to go to hire someone. And I do not know if anyone would; it is such a small project. Below is a copy of my Table "notify", my code for both my form and my .php. I would greatly appreciate any guidence, help or suggestions. MySQL table: Field Type Collation Attributes Null Default Extra Action no tinyint(10) No auto_increment suffix varchar(5) ascii_general_ci No first varchar(30) ascii_general_ci No last varchar(30) ascii_general_ci No email varchar(50) ascii_general_ci No terms char(2) ascii_general_ci No date datetime No 0000-00-00 00:00:00 Form Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Notification Submission Form</title> <style type="text/css"> <!-- body { background-color: #FFCC33; } .style2 {color: #000000} .style3 {color: #FFCC33; font-weight: bold; } --> </style> <script src="../../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="../../SpryAssets/SpryValidationCheckbox.js" type="text/javascript"></script> <link href="../../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style5 { font-size: small; font-weight: bold; } --> </style> <link href="../../SpryAssets/SpryValidationCheckbox.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="507" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="10"> </td> <td width="466"><div align="justify"><span class="style3"><span class="style2">Please fill out the form below and you will receive an e-mail when the next edition of GLOBAL ECONOMIST REVIEW is ready for download. Your name and e-mail address will not be shared with anyone and will not be sold; this is secure server. This information is strictly for the purpose of sending a notification and addressing you properly in the e-mail.</span>.</span></div></td> <td width="11"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><form id="form1" name="suffix" method="post" action="notify_process.php"> <label> <select name="suffix" size="1" id="suffix"> <option value="2">Mr.</option> <option value="3">Mrs.</option> <option value="4">Miss</option> <option value="5">Ms.</option> <option value="1">Dr.</option> </select> <strong>SUFFIX</strong></label> </form> </td><td> </td> </tr> <tr> <td> </td> <td><form id="form2" name="first" method="post" action="notify_process.php"> <label> <input type="text" name="first" id="first" /> <strong>FIRST</strong></label> </form> </td> <td> </td> </tr> <tr> <td> </td> <td><form id="form3" name="last" method="post" action="notify_process.php"> <span id="sprytextfield1"> <label> <input type="text" name="last" id="last" /> <strong>LAST</strong></label> <span class="textfieldRequiredMsg">(Required)*</span></span> </form> </td> <td> </td> </tr> <tr> <td> </td> <td><form id="form4" name="email" method="post" action="notify_process.php"> <span id="sprytextfield2"> <label> <input type="text" name="email" id="email" /> <strong>E-MAIL ADDRESS</strong></label> <span class="textfieldRequiredMsg">(Required)</span><span class="textfieldInvalidFormatMsg">*</span></span> </form> </td> <td> </td> </tr> <tr> <td> </td> <td><form id="form5" name="confirm_email" method="post" action="notify_process.php"> <span id="sprytextfield3"> <label> <input type="text" name="confirm_email" id="confirm_email" /> <strong>CONFIRM E-MAIL</strong></label> <span class="textfieldRequiredMsg">(Required)</span><span class="textfieldInvalidFormatMsg">*</span></span> </form> </td> <td> </td> </tr> <tr> <td> </td> <td><form id="form6" name="terms" method="post" action="notify_process.php"> <span id="sprycheckbox1"> <label> <input type="checkbox" name="terms" id="terms" /> <a href="http://www.globaleconomistreview.com/Terms Conditions and Disclosures.pdf"><strong>TERMS, CONDITIONS AND DISCLOSURES</strong></a></label> <span class="checkboxRequiredMsg">(Required)*</span></span> </form> </td> <td> </td> </tr> <tr> <td> </td> <td><form id="form7" name="submit" method="post" action="notify_process.php"> <label> <input type="submit" name="submit" id="submit" value="Submit" /> <strong>SUBMIT</strong></label> </form> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><span class="style5">All fields must be filled in completly</span></td> <td> </td> </tr> <tr> <td> </td> <td><span class="style5">If you are experiencing issues with this form please contact us for help</span></td> <td> </td> </tr> <tr> <td> </td> <td><p class="style5">E-Mail: <a href="mailto: info@globaleconomistreview.com">info@globaleconomistreview.com</a> or call us at 646-873-6093</p></td> <td> </td> </tr> </table> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1"); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "email"); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "email"); var sprycheckbox1 = new Spry.Widget.ValidationCheckbox("sprycheckbox1"); //--> </script> </body> </html> .php Form: <?php //Connect To Database $hostname='hostserver'; $username='*******'; $password='******'; $dbname='tim6843'; $usertable='notify'; $suffix='suffix'; $first='first'; $last='last'; $email='email'; $terms='terms'; mysql_connect($hostname,$username,$password); mysql_select_db($dbname) OR DIE ('ERROR! - Could NOT Connect to DataBase'); $query="INSERT INTO notify (suffix, first, last, e-mail, terms) VALUES ('$suffix', '$first', '$last', '$email', '$terms')"; mysql_select_db($dbname) OR DIE ('ERROR!'); $query = "SELECT * FROM `notify' WHERE 'email'='$email'"; $result = mysql_query($query)or die(mysql_error()); if($result) { while($row=mysql_fetch_array($result)){ echo "Thank you, however it appears you are already registered"; } } ?> <html> <style type="text/css"> <!-- body { background-color: #FFCC33; } --> </style></head> <body> <p><strong>THANK YOU </strong></p> <p><strong>For registering to recieve a notification of the next Global Economist Review</strong></p> </body> </html>
  3. Let's get everything out in the open; 6 days ago I did not know what .php was. I am a finance person trying to start my own website. I catch on quickly, but sometimes not quick enough. I have attached a Word file with the code I am using to create a subscription form to a newsletter. The site is hosted at Godaddy and unfortunately they provide no help. I have read and searched the internet to answer my questions, thus I have put together the attached code. The problem is I fill out the form on the internet and it does not end up in the database. I have gone back and changed many parts of the code many times but I still get nothing. I would greatly appreciate any help or suggestions; I have obviously missed something important. To see the page in action you can go to the site http://www.globaleconomistreview.com/current_edition.html and click on the link "Sign Up For Notification of Next Edition" Thank you Luke [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.