Jump to content

simcoweb

Members
  • Posts

    1,104
  • Joined

  • Last visited

Posts posted by simcoweb

  1. Hi, need another set of eyes. Getting error:

     

    Parse error: syntax error, unexpected T_STRING in /home2/wwwpawz/public_html/ajax.php on line 14

     

    For this code:

    <?
    $name = stripslashes($_POST['Name']);
    $email = stripslashes($_POST['Email']);
    $phone = stripslashes($_POST['Phone']);
    $address = stripslashes($_POST['Address']);
    $city = stripslashes($_POST['City']);
    $number = stripslashes($_POST['Number']);
    $pettypes = stripslashes($_POST['PetTypes']);
    $petnames = stripslashes($_POST['PetNames']);
    $departuredate = stripslashes($_POST['DepartureDate']);
    $returndate = stripslashes($_POST['ReturnDate']);
    $specialinstructions = stripslashes($_POST['SpecialInstructions']);
    if(mail("bsniff@gmail.com","Little Pawz Inquiry","
    ."Name: ".$name."\n"
    ."Email: ".$email."\n"
    ."Phone: ".$phone."\n"
    ."Address: ".$address."\n"
    ."City: ".$city."\n"
    ."Number of Pets: ".$number."\n"
    ."Pet Types: ".$pettypes."\n"
    ."Pet Names: ".$petnames."\n"
    ."Departure Date: ".$departuredate."\n"
    ."Return Date: ".$returndate."\n"
    ."Special Instructions: ".$specialinstructions."\n";
    
    (From $name, $email, $phone)","From: $email")){
    echo "$name $email $phone $specialinstructions";
    }
    
    
    echo "<h3>Your Email Order Was Successfully Sent!</h3><br />
    <i>Here is the information you submitted. Please review and resend if any items are incorrect.</i>
    <br /><br/>
    <b>Name:</b> $name<br /><b>Email:</b> $email<br /><b>Phone:</b> $phone<br /><b>Address:</b> $besttime<br/><b>City:</b> $city<br/>
    <b>Number of Pets:</b> $number<br/><b>Pet Types:</b> $pettypes<br/><b>Pet Names:</b> $petnames<br/><b>Departure Day:</b> $departuredate<br/><b>Return Day:</b> $returndate<br/>$shipping2<br/><b>Special Instructions:</b> $specialinstructions";
    ?>

  2. Thanks for your response and suggestion. Unfortunately it didn't work. :(

     

    I've never known SSI to somehow produce a line break. If I look at the page in FireFox and use the FireBug plugin to check the HTML/CSS it displays a gap in the code. See the screenshot i've attached, in the code box at the bottom you can see the gap between divs. If you've used FireBug you mouse over the CSS elements and it highlights the section in the page area above. When I mouse over that blank spot the 'wrapper' div highlights. Why? Who knows. There's no open or broken tags. This is a weird one.

     

    If I use a PHP include statement it looks fine. I don't want to have to convert all the pages to PHP, however.

     

    Ideas?

     

    [attachment deleted by admin]

  3. Not sure if I understand your request completely but here's a couple of things. The wrapper div CSS is:

     

    #wrapper {

    width: 960px;

    margin: auto;

    padding: 0;

    min-height: 100%;

    background-color: #fff;

    }

     

    The entire HTML/CSS layout for that page is:

     

    <!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" xml:lang="en" lang="en">
    
    <head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
    <title>Pavia Systems</title>
    <meta http-equiv="Content-Language" content="en-us" />
    
    <meta name="author" content="Niall Doherty" />
    
    <!-- Begin Stylesheets -->
    
    	<link rel="stylesheet" href="stylesheets/pavia-main.css" type="text/css" media="screen" />
    <!-- End Stylesheets -->
    
    </head>
    
    <body>
    <div id="wrapper">
    <div id="gradheader2">
    <a class="logo" href="http://www.paviasystems.com"><img src="images/trans-logo.png" alt="Pavia Systems" height="65" width="341"/></a>
    	<div class="searchbox">
    	<label>Search:</label>
    		<input type="text" value="enter keywords" name="search" id="search" style="height: 15px; width: 150px;"/> <img src="images/search.png" alt=""/> 
    	</div><!-- end of search box -->
    </div><!-- end of gradheader -->
    <!--#include virtual="pavia-menu.html" -->
    <div id="slider">
    	<div class="summary">
    			<h3>Are Your Crews <span class="roadready">RoadReady</span><span class="copyright">®</span> ?</h3>
    			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Sed volutpat ante id mauris laoreet vestibulum. 
    			<br/><br/><a class="slider" rel="external" href="#">Read full story ...</a>
    			</p>
    			</div>
    </div><!-- end of slider container -->
    <div id="clear"></div>
    <div id="content">
    
    	<div id="centermain">
    		<div id="mainleft">
    
    		<p><img src="images/biz-couple.jpg" height="100" width="100" alt="" class="imageLeft"/>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus lectus magna, consectetur eu eleifend sit amet, condimentum ac massa. Maecenas at diam eu est scelerisque facilisis id sit.
    		<br/><br/><a class="slider" rel="external" href="#">Read full story ...</a>
    		</p></div>
    		<div id="mainright">
    
    		<p>Click on the image below to view a sample animation from our online courses:</p>
    		<p align="center"><a href="#"><img src="images/video-sample.jpg" alt="" height="135" width="175"/></a></p>
    		</div>
    
    	</div><!-- end of center main -->
    
    	<div class="overview">
    		<fieldset>
    			<legend>Need To Attend Training?</legend>
    			<p>For registered members enter your username and password below to access your online courses.</p>
    			<form action="login.php"> 
    		<label for="username">Username:</label> <input type="text" value="" name="username" id="username"/><br/> <br/>
    		<label for="password">Password:</label> <input type="text" value="" name="password" id="password"/><br/>
    		<div style="text-align: center;"><input type="button" class="btn" value="Login" name="login"/></div>
    		</form>
    		<p><a class="reg" href="#">Create New Account</a> · <a class="reg" href="#">Forgot Password?</a>
    		</p>
    		</fieldset>
    
    	</div><!-- end of overview -->
    	<img src="images/courses-banner.jpg" alt="" width="800" height="40" style="margin-left: 20px; margin-bottom: 10px;"/>
    <div id="productswrapper">
    	<div id="productstop"><img src="images/book-contractor.jpg" alt="" height="128" width="128" style="float: left; margin-right: 20px;"/>
    	<span class="producttitle">Contractor</span><br/>
    		<span class="productstagline">Operator, Technician and Management Training</span>
    	</div>
    		<div id="productsmid">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus lectus magna, consectetur eu eleifend sit amet, condimentum ac massa. Maecenas at diam eu est scelerisque facilisis id sit amet ligula.
    		</div>
    		<div class="productsbottom">
    		<div class="productslink"><a rel="info" href="#">Information...</a></div>
    		</div>
    </div><!-- end of products wrapper -->
    
    <div id="productswrapper">
    	<div id="productstop"><img src="images/book-agency.jpg" alt="" height="128" width="128" style="float: left; margin-right: 20px;"/>
    	<span class="producttitle">Agency</span><br/>
    		<span class="productstagline">Inspector, Technician and Engineer Training</span>
    	</div>
    		<div id="productsmid">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus lectus magna, consectetur eu eleifend sit amet, condimentum ac massa. Maecenas at diam eu est scelerisque facilisis id sit amet ligula. 
    		</div>
    		<div class="productsbottom">
    		<div class="productslink"><a rel="info" href="#">Information...</a></div>
    		</div>
    </div><!-- end of products wrapper -->
    
    <div id="productswrapper">
    	<div id="productstop"><img src="images/book-equipment.jpg" alt="" height="128" width="128" style="float: left; margin-right: 20px;"/>
    	<span class="producttitle2">Equipment<br/>Manufacturer</span><br/>
    	<span class="productstagline">Customer, Sales and Support Training</span>
    	</div>
    		<div id="productsmid">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus lectus magna, consectetur eu eleifend sit amet, condimentum ac massa. Maecenas at diam eu est scelerisque facilisis id sit amet ligula. 
    		</div>
    		<div class="productsbottom">
    		<div class="productslink"><a rel="info" href="#">Information...</a></div>
    		</div>
    </div><!-- end of products wrapper -->
    <div id="clear"></div>
    </div><!-- end of content -->
    <div id="footer">
    	<div class="contactdiv">
    	<span class="questions">Questions? Call us:</span><br/>
    	<span class="phone">206.428.3094</span>
    	<br/>
    
    	</div>
    
    </div><!-- end of footer -->
    
    </div><!-- end of wrapper -->
    <div id="bottom">
    <span class="terms"><a href="#">Terms Of Use</a> | <a href="#">Privacy Policy</a></span>
    </div>
    </body>
    </html>

  4. I'm using SSI to insert a common menu into a site template. The menu HTML is a stand ul list stylized with CSS to create the horizontal navigation bar. Here's the problem.

     

    When I insert the menu via an SSI tag like so:

     

    <!--include virtual="menu.html" -->

     

    It also creates a space above the menu when it displays. Like a hard return. There's no visible code or <p> tag or anything else that would cause this. If I remove the SSI tag and replace it with the actual code for the menu then the space disappears.

     

    Here's the view without the SSI file:

     

    http://www.simcomedia.com/pavia/index9.html

     

    Here's the view WITH the SSI tag:

     

    http://www.simcomedia.com/pavia/index9ssi.html

     

    Notice the menu now has a gap above it. Same code as without the SSI but for some oddball reason it wants to move it down.

     

    Ideas anyone?

  5. I'm using this Ajax script to summon content into a container div within the same page as the hyperlinks/menu. What I need is to figure out how I can externally hyperlink to the page and have a specific content displayed in the container div upon page load.

     

    So, basically I have 6 links in page A that summon content via external .html files into a container div called 'mainright'. What I want to do is place a hyperlink in Page B or C that summons Page A but displays say the 3rd item from Page A's menu in the 'mainright' div on load.

     

    Here's my script:

     

    <script type="text/javascript">
    
    var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname
    var bustcacheparameter=""
    
    function ajaxpage(url, containerid){
    var page_request = false
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    } 
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else
    return false
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    if (bustcachevar) //if bust caching of external page
    bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    page_request.open('GET', url+bustcacheparameter, true)
    page_request.send(null)
    }
    
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }
    
    function loadobjs(){
    if (!document.getElementById)
    return
    for (i=0; i<arguments.length; i++){
    var file=arguments[i]
    var fileref=""
    if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
    if (file.indexOf(".js")!=-1){ //If object is a js file
    fileref=document.createElement('script')
    fileref.setAttribute("type","text/javascript");
    fileref.setAttribute("src", file);
    }
    else if (file.indexOf(".css")!=-1){ //If object is a css file
    fileref=document.createElement("link")
    fileref.setAttribute("rel", "stylesheet");
    fileref.setAttribute("type", "text/css");
    fileref.setAttribute("href", file);
    }
    }
    if (fileref!=""){
    document.getElementsByTagName("head").item(0).appendChild(fileref)
    loadedobjects+=file+" " //Remember this object as being already added to page
    }
    }
    }
    
    </script>

     

    I'm not well versed on Ajax/Javascript. Yet :)  So looking for some help in how this can be done. I'm assuming a function would be created to allow for something like:

     

    www.sitename.com/pageA.html?mainright=3

     

    or something like that, where the ?mainright=3 (or possibly it should be a reference to the menu class name) would summon the right content into the container div.

     

    Thanks in advance!

  6. Hi everyone. I've been wrestling over this for about a week. Any help would be great.

     

    I have a page called staff.html which has a vertical sub-menu in it listing the staff members. When a staff member's name is clicked on the content is loaded into a div to the right of the menu called #mainright. The Ajax code i'm using works flawlessly in bringing the content into the div. But, what I want to do is be able to link to the staff page and have that div populated with the staff member's content.

     

    To further clarify, If they are on the staff page no problem. But let's say in my main site menu I have a drop down that lists the members of the staff individually. When clicked upon it would go to the staff.html page and display Dr. Jones or Dr. Smith or which ever one I selected from the main menu.

     

    Right now the hyperlinks for the sub-menu look like this:

     

    <a class="stafflinks" href="javascript:ajaxpage('adults-and-adolescents.html', 'mainright');">Adults and Adolescents</a>

     

    That tells the ajax code what page to put into the designated div. Here's the ajax code i'm using:

     

    <script type="text/javascript">
    
    var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname
    var bustcacheparameter=""
    
    function ajaxpage(url, containerid){
    var page_request = false
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    } 
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else
    return false
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    if (bustcachevar) //if bust caching of external page
    bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    page_request.open('GET', url+bustcacheparameter, true)
    page_request.send(null)
    }
    
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }
    
    function loadobjs(){
    if (!document.getElementById)
    return
    for (i=0; i<arguments.length; i++){
    var file=arguments[i]
    var fileref=""
    if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
    if (file.indexOf(".js")!=-1){ //If object is a js file
    fileref=document.createElement('script')
    fileref.setAttribute("type","text/javascript");
    fileref.setAttribute("src", file);
    }
    else if (file.indexOf(".css")!=-1){ //If object is a css file
    fileref=document.createElement("link")
    fileref.setAttribute("rel", "stylesheet");
    fileref.setAttribute("type", "text/css");
    fileref.setAttribute("href", file);
    }
    }
    if (fileref!=""){
    document.getElementsByTagName("head").item(0).appendChild(fileref)
    loadedobjects+=file+" " //Remember this object as being already added to page
    }
    }
    }
    
    </script>
    

     

    Thanks in advance!

  7. Thanks to all for the replies!

     

    Zhadus, can you give me an example of what you're referring to? It would be marvelous if I didn't have to manually insert the links since the sheer number of links could exceed 100. If there's a way to write these to a file that is read and then cloaked... is that what you're referring to?

  8. I'm trying to write a simple 'cloaking' script that works like a 'jump' where I can use it instead of the actual affiliate link to prevent the typical link bypassers from simply mousing over and going directly. Here's what I have so far:

     

    <?php
    if($m == "") ($link = "http://www.templateresources.com"); // Default URL
    if($m == "Premium Flash Templates") ($link = "http://store.templatemonster.com/?aff=simco"); //Template Monster
    if($m == "Free CSS Templates") ($link = "http://www.templateworld.com/3091.html"); // Template World
    
    header("Location: $link"); // Jump to the hidden affiliate URL above
    exit();
    ?>
    

     

    Then using a hyperlink structure like this:

    jump.php?m=Free CSS Templates

     

    But when clicking on any of the links it goes to the default (1st one) instead of the designated one. Ideas?

  9. Ok, so basically I don't need to worry that the 'field' name 'department' has multiple choices, it will take the 'value' assigned to whatever choice they select and populate the $to variable with the front-end of the email and complete it with the $your_site content.

     

    For some reason I was thinking I had to deal with an array issue of some sort since it was a drop down selection with multiple choices under one group name. Guess that's not the case, eh?

     

    Thanks for your response!

  10. I'm inserting a form field utilizing a dropdown selector so the person can select which department they wish for the email to be directed to. Depending on their selection the form results would be emailed to the respective address.

     

    I am using this code to parse and send the form without the dropdown selection.

     

    <?
    @extract($_POST);
    $name = stripslashes($name);
    $email = stripslashes($email);
    $department = stripslashes($department);
    $message = stripslashes($message);
    
    if(mail("test@example.com","Email from $name","
    $message
    
    (From $name, $email)","From: $email")){
    echo "$name $email $message";
    }*/
    echo "Email Successfully Sent!<br />
    <br />
    Name: $name<br />Email: $email<br />Website: $website<br />Message: $message";
    ?>

     

    And the form code:

    <form id="my-form">
    	<table>
    	<tr><td>Name</td><td><input type="text" id="name" name="name" /></td></tr>
    	<tr><td>Email<br /><small>(will never be published)</small></td><td><input type="text" id="email" name="email" /></td></tr>
    	<tr><td>Department</td><td><select name="department">
    <optgroup label="Department">
    <option value="sales" name="sales">Sales</option>
    <option value="customer service" name="customer service">Customer Service</option>
    </optgroup></select></td></tr>
    	<tr><td valign="top">Message</td><td><textarea cols="40" rows="5" name="message" id="message"></textarea></td></tr>
    	<tr><td> </td><td><input type="button" value="Send" onclick="sendRequest();" />
    	<input type="button" id="resetbut" name="resetbut" value="Reset" onclick="resetForm();"  /></td></tr>
    	</table>
    </form>

     

    The key is that IF they select the Sales dept. then the email would be sent to sales@ and IF they select the Customer Service then it would go to customerservice@. Not sure how to code that properly to populate the $to slot in the mail(function). Just a bit of guidance, por favor :)

  11. First, thanks for the response! Sorry my reply is so late, have had a difficult 2 weeks as my computer crashed (HDD went kaput) and have been reinstalling all my software and gathering materials for work.

     

    Ok, that page DOES have a doc statement already in it. In fact, i've tried different doctype statements and get the same result. The fact that it shows properly in IE is a good thing since the client uses IE for their viewing.

     

    Usually FF is much easier to deal with. I'm thinking it's something in how i've set up the CSS that is wrong. Why would the background show up over the <div> above where it's designated?

  12. Ok, in FF the background for this <div> doesn't display within the div like it's supposed to. Instead it displays about 200 px above the div and over the top of what's in that location. In IE it shows fine where the background is perfectly laid behind the content of the div.

     

    Here's the URL. Be sure to look in both FF and IE cuz the problem only occurs in FF.

     

    www.thebeancoffeecompany.com

     

    Here's my CSS code:

     

    #teambean {
    width: 630px;
    height: 150px;
    background-image: url(images/teambean-bg.gif);
    background-repeat: no-repeat;
    padding: 5px 5px 5px 5px;
    position: relative;
    }
    

     

    You can check the source code of the page instead of me posting all that so you can see how it's set up. Probably hacked it all to death but usually the problems occur in IE, not FF. Thanks in advance for the assist! :)

  13. Jusssssst a bit rusty since i've been designing more than coding lately. Here's what I have:

     

    I'm parsing a form to insert data into mysql, no problem. Then, after insertion, I want it to redirect to another page. I'm using the header() function for this. But, I have an array() that will contain a message (tucked into a variable called $msg) that I want displayed on that following page. Here's my code:

     

    <?php
    
    /**
    * @author rockmetal
    * @copyright 2008
    * News insertion and display script
    */
    include('db_config.php');
    if(isset($_POST['submitted'])){
    $msg = array();
    // let us clean our input
    $title = stripslashes($_POST['title']);
    $today = date("F j,Y");
    $summary = stripslashes($_POST['summary']);
    $news = stripslashes($_POST['news']);
    
    // insert into database
    
    $query = "INSERT INTO news (title, today, summary, news) VALUES ('$title', '$today', '$summary', '$news')";
    $results = mysql_query($query) or die(mysql_error());
    $affrows = mysql_affected_rows($dbc);
    if($affrows == 1){
    $msg = "The news item was inserted successfully in the database";
    header('Location: addnews.php');
    } else {
    $msg = "Unfortunately there was a problem inserting the news item into the database. Please retry";
    header('Location: addnews.php');
    }
    }
    ?>

     

    It redirects fine but no $msg displayed. Here's the bit of code on the receiving page that is set to display the $msg:

     

    if(!empty($msg)){
    foreach($msg as $error){
    	echo "<span class='bodytext' color='red'>$error</span>\n";
    }
    }

     

    Should this message be passed in the header() function? Or, in a 'session' parameter? A little guidance, puhleeeeez...thanks! :)

  14. I’m having trouble with the icons showing in IE. This works great in FF, however. I’m wondering if IE needs a specific doc type statement or if there’s another reason why these won’t show? I'm using the CSS selectors which I snagged from a blog site and the icons were visible in IE. Here's my code. This provides an icon for every PDF file.

     

    a[href$=.pdf] {

    display:inline-block;

    padding-left: 32px;

    padding-top: 5px;

    background: transparent url(/images/pdf_icon.gif) no-repeat center left;

    }

     

    On this page: http://www.calcounties.com/buyer-seller.php

     

    The icons show in FF but not IE. Ideas on this?

  15. Basically you'd create a new class for your links and assign it to them like this where say you wanted the links to be white against that black background and a yellow hover/rollover:

     

    a:link.black {

      font-family: Arial, Helvetica, sans-serif;

      color: white;

      text-decoration: none;

      font-size: 10pt;

    }

    a:visited.black {

      font-family: Arial, Helvetica, sans-serif;

      text-decoration: none;

      color: #FFFFFF;

      font-size: 10pt;

    }

     

    a:hover.black {

      font-family: Arial, Helvetica, sans-serif;

        text-decoration: underline;

        font-size: 10pt;

        color: #FFFF00;

    }

    a:active.black {

      font-family: Arial, Helvetica, sans-serif;

      text-decoration: none;

      color: #FFFFFF;

            font-size:10pt;

    }

     

    Then with your links do this:

     

    <a href="nameofpage.htm" class="black">Link Name Here</a>

×
×
  • 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.