Jump to content

TNGuy03

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by TNGuy03

  1. Thank you. I think the same thing, but the client was assuring me their server was setup for PHP. At any rate, I've asked them to verify with ... <?php phpinfo(); ?> We'll see how they respond. Thanks again for your input. Regards, Dan
  2. http://spencetechsolutions.com/eswack/booking.php is working fine (Linux) http://eswack.com/ray/booking.php is working incorrectly (IIS)
  3. No, not at all. I was hoping someone could take a look at the output of the page on the two different servers and - based on the code provided - tell me why the success message is displaying upon page load when pulled from the IIS server and not from the Linux server.
  4. Try this (replace red text with whatever is appropriate for your site): <?php $name = $_REQUEST['name']; $email = $_REQUEST['email']; $comments = stripslashes($_REQUEST['comments']); $webmaster = 'you @ email.com'; $subject = 'Your Email Subject'; mail($webmaster, $subject, $comments, "From: $name <$email>"); header("Location: success.php"); ?>
  5. I have been working on a website for a client and everything has been functional on my Linux server; however, today he loaded the files onto his IIS server and we are encountering some problems. The user completes a form and clicks submit. The information is passed through PHP and the user is directed back to the form if successful. Below is the script used on the form page upon successful form submission. The problem is that - when the form page is accessed from the IIS server - the PHP script almost appears to be ignored. To see the page operating correctly (Linux) go to http://spencetechsolutions.com/eswack. To see the page operating incorrectly (IIS) go to http://www.eswack.com/ray/index.htm. Looking for any advise to help resolve this. <?php $mode=$_GET['mode']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Chiropractic Plus - Colorado's Premier Chiropractic Provider</title> <script type="text/javascript"> var win=null; function opWin() { if(win==null || win.closed) { win=window.open("", "Insurance", "width=500, height=150"); win.document.write("<html><head><title>Verify Insurance<\/title><\/head>"); win.document.write("<body><center>Do you want us to verify your insurance?<br><br>"); win.document.write("<input type='button' value='Yes' onclick='window.location=\"verify.htm\";'><\/input> "); win.document.write("<input type='button' value='No' onclick='window.close();opener.location=\"index.htm\";'><\/input><\/center><\/body><\/html>"); } win.focus(); } </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <SCRIPT TYPE="text/javascript"> function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=400,height=250,scrollbars=yes'); return false; } </SCRIPT> <script language="JavaScript" src="calendar2.js"></script> </head> <body onLoad="<?php if($mode==a){echo "opWin()";}?>"> <table width="366" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="13"><img src="images/topleft.gif" width="13" height="21"></td> <td background="images/topspace.gif" colspan="7"><img src="images/topspace.gif" width="35" height="21"></td> <td width="12"><img src="images/topright.gif" width="12" height="21"></td> </tr> <tr> <td background="images/leftside.gif" rowspan="6"><img src="images/leftside.gif" width="13" height="30"></td> <td width="240" rowspan="5" valign="top"><img src="images/left_home2.gif" width="240" height="714" border="0" usemap="#Maptop"></td> <td width="17"><img src="images/1rays_head.jpg" width="79" height="46"></td> <td width="17" style="height: 46px"><a href="index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Home','','images/navimages/2home_roll.jpg',1)"><img src="images/navimages/2home.jpg" alt="Chiropractic Plus Home Page" name="Home" width="91" height="46" border="0"></a></td> <td width="17"><a href="services.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Services','','images/navimages/3services_roll.jpg',1)"><img src="images/navimages/3services.jpg" alt="Chiropractic Plus Services" name="Services" width="88" height="46" border="0"></a></td> <td width="17"><a href="staff.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Staff','','images/navimages/4staff_roll.jpg',1)"><img src="images/navimages/4staff.jpg" alt="Chiropractic Plus Staff" name="Staff" width="88" height="46" border="0"></a></td> <td width="17"><a href="contact.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Contact','','images/navimages/5contact_roll.jpg',1)"><img src="images/navimages/5contact.jpg" alt="Contact Chiropractic Plus" name="Contact" width="88" height="46" border="0"></a></td> <td width="16"><a href="research.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Research','','images/navimages/6research_roll.jpg',1)"><img src="images/navimages/6research.jpg" alt="Research Chiropractic Resources" name="Research" width="106" height="46" border="0"></a></td> <td background="images/rigthside.gif" rowspan="6"><img src="images/rigthside.gif" width="12" height="31"></td> </tr> <tr> <td colspan="6"> <img src="images/header.jpg" width="540" height="120" border="0" usemap="#header"></td> </tr> <tr> <td colspan="6"><table width="369" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/subs_left.jpg" width="499" height="50" usemap="#subs_left_Map" border="0"></td> <td><a href="subscribe.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('SubscriptionButt','','images/subs_butt_roll.jpg',1)"><img src="images/subs_butt.jpg" alt="Subscribe to Chiropractic Plus Newletters" name="SubscriptionButt" width="41" height="50" border="0"></a></td> </tr> </table></td> </tr> <tr> <td height="10"></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td colspan="6"> <table width="540" height="490" border="0" cellspacing="0" cellpadding="0" id="table1"> <tr> <td width="286" height="21"> <img border="0" src="images/hdr_appointment.gif" width="355" height="18"></td> <td width="35"> </td> <td width="219" align="center"> </td> </tr> <tr valign="top"> <td height="466" colspan="3"> <form name="schedule" method="POST" action="add_appt.php"> <input type="hidden" name="require" value="Name,Address1,City,State,Zip,Phone,Email,Date,Time,Reminder"> <div align="center"> <table border="0" width="500" id="table2" cellspacing="1" cellpadding="0"> <tr> <?php if($mode==a){ echo" <td width=\"502\" align=\"center\" colspan=\"3\"> <p align=\"center\"><font color=\"green\"><b>Your appointment request was successfully submitted!</b></font></td>"; } ?> </tr> Thanks, Dan
  6. Figured it out...it was a placement issue. I've moved the code for the embedded media into the 'while' loop and it is working well.
  7. If you have an 'id' field for the records in your db table which is auto incremented, be sure to pass 'NULL' for that field.
  8. Glyde, The print_r($row) shows the same results that I confirmed with display in the table. The filename of the video clip I want to display (abc.wmv) is what is returned by the showFile function above. Now I want to take that filename ($row[n] from my query) and use it in the embedded media player. The player is loading but if I look at the HTML source from the browser the file name (abc.wmv aka $row[n]) is missing from the source code. Is this an issue with where I am placing the code for the embedded player? Regards
  9. Glyde, Yeah...I'm new to PHP - painfully obvious. Thanks for the tip. I am now able to see the result of the query, but one of the results is a file name, which I am now trying to put into an embedded media player for viewing in the user's web browser. While I am now seeing the results successfully as text, I cannot get the filename $row[n] to appear in the embedded media script. <?php require "cont/access.php"; $media=$_GET[id]; //Show the categories in an HTML <table> function showFile($result) { //Find out how many rows are available $rowsFound=@mysql_num_rows($result); //Start a table with column headers print "\n<table border=1 align=center>\n<tr>\n" . "\n\t<th align=center><font size=2>Folder</font></th>" . "\n\t<th align=center><font size=2>File</font></th>" . "\n</tr>"; //Until there are no rows in the result set, fetch a row into the $row array and ... while($row=@mysql_fetch_assoc($result)) { // ... start a TABLE row ... print "\n<tr>"; // ... and print out each of the attributes in that row as a separate TD (Table Data). print "\n\t<td align=right><font size=2> $row[f] </font></td>"; print "\n\t<td align=right><font size=2> $row[n] </font></td>"; //Finish the row print "\n</tr>"; } //Then, finish the table print "\n</table>\n"; //Report how many rows were found print "<center><br><font size=1><i>Top {$rowsFound} Audio Files (Real Time)</i></font><br></center>"; } $query="SELECT folder as f, f_name as n FROM Pages WHERE page_id = '{$media}' GROUP BY n"; //Connect to the MySQL server if(!($connection=@mysql_connect($hostName, $userName, $password))) die("Cannot connect"); if(!(mysql_select_db($databaseName, $connection))) showerror(); //Run the query on the connection if(!($result=@mysql_query($query, $connection))) showerror(); //Display the results showFile($result); echo " <OBJECT ID=MediaPlayer1 width=400 height=300 classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 standby=Loading Microsoft® Windows® Media Player components... type=application/x-oleobject> <PARAM NAME=AutoStart VALUE=True> <PARAM NAME=FileName VALUE=/video/{$row[n]}> <PARAM NAME=ShowControls VALUE=True> <PARAM NAME=EnableContextMenu Value=False> <PARAM NAME=ShowStatusBar VALUE=True> <EMBED type=application/x-mplayer2 pluginspage=http://www.microsoft.com/Windows/MediaPlayer/ SRC=/video/{$row[n]} name=MediaPlayer1 width=400 height=300 autostart=1 showcontrols=1 enablecontextmenu=0 showstatusbar=1> </EMBED> </OBJECT>"; ?>
  10. I am trying to pull my file name from a database using the following code, grabbing the record id from the URL. I have confirmed that the id is held under $media for $query; however, I can't seem to get any results from the query itself, and no apparent query/connection errors. <?php require "cont/access.php"; $media = "$_GET[id]"; function showVideo($result) { print "\n<table border=1 align=center>\n<tr>\n" . "\n\t<th align=center><font size=2>Folder</font></th>" . "\n\t<th align=center><font size=2>File</font></th>" . "\n</tr>"; while($row=@mysql_fetch_assoc($result)) { // ... start a TABLE row ... print "\n<tr>"; // ... and print out each of the attributes in that row as a separate TD (Table Data). print "\n\t<td align=right><font size=2> $row[f] </font></td>"; print "\n\t<td align=right><font size=2> $row[n] </font></td>"; //Finish the row print "\n</tr>"; } //Then, finish the table print "\n</table>\n"; } showVideo($result); $query = "SELECT folder as f, f_name as n FROM Pages WHERE page_id = '$media' GROUP BY n"; ?>
  11. Thank you, jitesh. As I expected a simple fix and I am happy to have it resolved. Regards, Dan
  12. I'm hoping someone can help me here. I had this script working for a couple days and was fiddling around with it, which now has me unable to write the form data to my db table. The email confirmations are still being sent without any problems but the data isn't being stored. I'm sure it's something simple, but I'm still new to this and just can't see it. <?php $email = "webmaster@liketolaugh.com"; $browser = $HTTP_USER_AGENT; $sub = $_POST['subject']; $require = $_POST['require']; if(!empty($_POST['Submit'])) { if(!($connection=@mysql_connect($hostName, $userName, $password))) die("Cannot connect"); $first = mysqlclean($_POST, "first", 8, $connection); $sex = mysqlclean($_POST, "sex", 6, $connection); $age = mysqlclean($_POST, "age", 12, $connection); $browse = mysqlclean($_POST, "browser", 30, $connection); $modem = mysqlclean($_POST, "modem", 15, $connection); $frequent = mysqlclean($_POST, "frequent", 25, $connection); $reason = mysqlclean($_POST, "reason", 50, $connection); $return = mysqlclean($_POST, "return", 18, $connection); $rec = mysqlclean($_POST, "recommend", 18, $connection); $viewer = mysqlclean($_POST, "email", 50, $connection); $ip = $_SERVER['REMOTE_ADDR']; if(!mysql_select_db($databaseName, $connection)) showerror(); $query = "INSERT INTO u_survey VALUES (NULL, '{$first}', '{$sex}', '{$age}', '{$browse}', '{$modem}', '{$frequent}', '{$reason}', '{$return}', '{$rec}', '{$ip}')"; if(!(@mysql_query($query, $connection))) echo 'The survey response could not be recorded in the database'; //START OF THANKS MESSAGE $thanks = " <p align='left'><br> <b>Thank you for completing the Like to Laugh site survey!<br><br></b> We are always looking for ways to improve our site to make the experiences of our visitors - individuals like you - as enjoyable as possible. Thank you again for taking your time to complete this survey. It is greatly appreciated.<br></p>"; //END OF THANKS MESSAGE $dcheck = explode(",",$require); while(list($check) = each($dcheck)) { if(!$$dcheck[$check]) { $error .= "You did not enter this field: <b>$dcheck[$check]</b><br>"; } } if ((!ereg(".+\@.+\..+", $viewer)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $viewer))){ $error .= "<br>Wrong e-mail.<br>Your e-mail address <b>$viewer</b> is not valid. Please re-enter your e-mail address."; } if($error) { echo $error; echo '<br><br><a href="#" onClick="history.go(-1)">Please try again</a>'; } else { //START OF INCOMING MESSAGE (this message goes to your inbox) $message = " Someone has completed the Like to Laugh Site Survey! Q: Is this the first time you have visited our site? A: $first Please tell us about yourself: Q: What is your sex? A: $sex Q: What is your age? A: $age Q: Which web browser do you use? A: $browse Q: What is your modem access speed to the Internet? A: $modem Q: How often do you visit our site? A: $frequent Q: Why did you visit our site today? A: $reason Q: How likely are you to return to this website? A: $return Q: How likely are you to recommend this website? A: $rec ----------------------------- Browser: $browser IP: $ip "; //END OF INCOMING MESSAGE (this message goes to your inbox) $subject = "Like to Laugh Site Survey Response"; //subject OF YOUR INBOX MESSAGE sent to you $subject2 = "Thank You for Your Survey Response!"; //subject of OUTGOING MESSAGE - edit this //OUTGOING MESSAGE TEXT $message2 = "Thank you for completing the Like to Laugh site survey! We are always looking for ways to improve our site to make the experiences of our visitors - individuals like you - as enjoyable as possible. Thank you again for taking your time to complete this survey. It is greatly appreciated. "; //END OF outgoing MESSAGE mail($email,"$subject","$message","From: $Name <$viewer>"); mail($viewer,"$subject2","$message2","From: <$email>"); echo "$thanks"; } } else { echo ' <form method="POST" action="'.$PHP_SELF.'" name="TestForm"> <input type="hidden" name="require" value="first,sex,age,browser,modem,frequent,return,recommend,email"> <input type="hidden" name="subject" value="Like to Laugh Visitor Survey"> <div align="center"> <table border="0" width="100%" id="table1"> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> <font size="2"><b>Welcome to Like to Laugh\'s Online Visitor Survey!</b></font><p> <font size="2">This survey will take less than one minute of your time to complete. Please take this small amount of time to help Like to Laugh learn more about the individuals visiting our site so that we can make your future experiences with us even better. Your help and contribution to current and future site improvements is greatly appreciated.</font></td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">Is this the first time you have visited our site?</font></b></td> </tr> <tr> <td colspan="9"> <select size="1" name="first" tabindex="1"> <option selected>Choose One</option> <option>Yes</option> <option>No</option> <option>Not Sure</option> </select></td> </tr> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> </td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">Please tell us about yourself.</font></b></td> </tr> <tr> <td colspan="9"><i><font size="2">Are you</font></i></td> </tr> <tr> <td colspan="9"> <select size="1" name="sex" tabindex="2"> <option selected>Choose One</option> <option>Female</option> <option>Male</option> </select></td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><i><font size="2">What is your age?</font></i></td> </tr> <tr> <td colspan="9"> <select size="1" name="age" tabindex="3"> <option selected>Choose One</option> <option>Under 13</option> <option>13-17</option> <option>18-24</option> <option>25-34</option> <option>35-49</option> <option>50-64</option> <option>65 or older</option> </select></td> </tr> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> </td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">Which web browser do you use?</font></b></td> </tr> <tr> <td colspan="9"> <select size="1" name="browser" tabindex="4"> <option selected>Choose One</option> <option>Netscape 4.0 or more</option> <option>Netscape 3.0 or less</option> <option>Internet Explorer 4.0 or more</option> <option>Internet Explorer 3.0 or less</option> <option>AOL</option> <option>Other</option> </select></td> </tr> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> </td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">What is your modem access speed to the Internet?</font></b></td> </tr> <tr> <td colspan="9"> <select size="1" name="modem" tabindex="5"> <option selected>Choose One</option> <option>33.6 or less</option> <option>56K</option> <option>Cable/ISDN</option> <option>DSL</option> <option>T1</option> <option>Other</option> </select></td> </tr> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> </td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">How often do you visit our site?</font></b></td> </tr> <tr> <td colspan="9"> <select size="1" name="frequent" tabindex="6"> <option selected>Choose One</option> <option>Daily</option> <option>3-4 times per week</option> <option>Once per week</option> <option>2-3 times per month</option> <option>Once per month</option> <option>Less than monthly</option> <option>Other</option> </select></td> </tr> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> </td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">Why did you visit our site today?</font></b></td> </tr> <tr> <td colspan="9"> <select size="1" name="reason" tabindex="7"> <option selected>Choose One</option> <option>Looking for videos</option> <option>Looking for audio clips</option> <option>To play games</option> <option>Looking for pics & toons</option> <option>Looking for jokes</option> <option>Looking for pranks</option> <option>Looking for insults</option> <option>To use LTL Messaging</option> <option>To inquire about advertising</option> <option>To find company contact information</option> <option>To request general company information</option> <option>Other</option> </select></td> </tr> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> </td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">How likely are you to:</font></b></td> </tr> <tr> <td><i><font size="2">Return to this website?</font></i></td> </tr> <tr> <td colspan="9"> <select size="1" name="return" tabindex="8"> <option selected>Choose One</option> <option>Very Likely</option> <option>Somewhat Likely</option> <option>Somewhat Unlikely</option> <option>Not Likely</option> </select></td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td><i><font size="2">Recommend this website?</font></i></td> </tr> <tr> <td colspan="9"> <select size="1" name="recommend" tabindex="9"> <option selected>Choose One</option> <option>Very Likely</option> <option>Somewhat Likely</option> <option>Somewhat Unlikely</option> <option>Not Likely</option> </select></td> </tr> <tr> <td colspan="9" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px"> </td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"><b><font size="2">Your email address:</font></b></td> </tr> <tr> <td colspan="9"> <font face="Verdana,Arial,Helvetica,sans-serif"> <input type="text" name="email" size="40" tabindex="10"></font></td> </tr> <tr> <td colspan="9"> </td> </tr> <tr> <td colspan="9"> <font face="Verdana,Arial,Helvetica,sans-serif"><input type="submit" class="buttonflat" value="Submit" name="Submit"><input type="reset" class="buttonflat" value="Reset" name="Reset"></font></td> </tr> </table> </div> </form>'; } ?> Thanks! Dan
×
×
  • 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.