The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Php removes all code below it on live page..., Can anyone help?
Pluribus
post Apr 12 2013, 02:15 PM
Post #1


Member
***

Group: Members
Posts: 81
Joined: 6-February 09
Member No.: 7,737



Hi Everyone

I have a php page written in plain html with a simple php contact form within it. My problem is the html below the contact form will not work, although the code is there.

I am also getting erroneous validation errors. I have posted the entire page code below but, before I get screamed at...(!), I have commented the various problems and their corresponding line numbers. The rest of the code is there for clarity only. The alignment is slightly out with my tabs in the code but that's only because I added the line numbers.

Incorrect (?) validation errors:
1. Line 112 "Unclosed element section". This is closed on line 169...
2. Line 113 "Unclosed element div". This is closed on line 168...
3. Line 114 "Unclosed element div". This is closed on line 167...
4. Line 75 "Unclosed element div". This is closed on line 181...
5. Line 76 "Unclosed element div". This is closed on line 180...
6. Line 183 "End of file seen and there were open elements". All open elements have been closed though...

Php contact form starts line 138 and finishes line 165

None of the code from line 166 is being displayed on the live page. It ends abruptly at the end of the contact form.

Oh, and for some reason the submit button on the form is not showing either. I presume this will be fixed automatically when the layout problem is fixed...

If anyone can assist I would appreciate it!

Thanks

Ian

CODE

1<!DOCTYPE html>
2<html lang="en">
3    <head>
4        <title>Title Here</title>
5        <meta name="description" content="Description Here"/>        
6        <meta name="keywords" content="Keywords Here"/>
7        <meta charset="utf-8">
8        <link rel="icon" href="images/favicon.ico" type="image/x-icon">
9       <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
10      <link rel="stylesheet" type="text/css" media="screen" href="css/style.css">
11        <link rel="stylesheet" type="text/css" media="screen" href="css/tms.css">
12        <link rel="stylesheet" type="text/css" media="screen" href="css/prettyPhoto.css">
13        <link rel="stylesheet" type="text/css" media="screen" href="css/tabs.css">
14        <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
15      <script type="text/javascript" src="js/superfish.js"></script>
16        <script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
17        <script type="text/javascript" src="js/tms-0.4.x.js"></script>
18        <script type="text/javascript" src="js/easyTooltip.js"></script>
19        <script type="text/javascript" src="js/xbMarquee.js"></script>
20        <script type="text/javascript" src="js/tabs.js"></script>
21        <script type="text/javascript" src="js/jquery.cycle.all.js"></script>
22        <script type="text/javascript" src="js/jquery.prettyPhoto.js"></script>
23        <script type="text/javascript" src="js/hover-image.js"></script>
24        <script type="text/javascript" src="js/flashobject.js"></script>
25        <script>
26            $(window).load(function(){
27            $('.slider')._TMS({
28            prevBu:false,
29            nextBu:false,
30            playBu:false,
31            duration:8000,
32            easing:'easeOutQuad',
33            preset:'zoomer',
34            pagination:true,//'.pagination',true,'<ul></ul>'
35            pagNums:false,
36            slideshow:8000,
37            numStatus:false,
38            banners:'fade',// fromLeft, fromRight, fromTop, fromBottom
39            waitBannerAnimation:false,
40            progressBar:false
41            })
42            $('.cicle_news1')  
43            .cycle({
44            fx:     'fade',
45            speed:  'fast',
46            timeout: 0,
47            pager:  '#nav1'
48            });
49            $('.cicle_news2')  
50            .cycle({
51            fx:     'fade',
52            speed:  'fast',
53            timeout: 0,
54            pager:  '#nav2'
55            });
56            })
57            $(function(){
58            $(".social a").easyTooltip();
59            $('#tabs').tabs();
60            })
61        </script>
62        <!--[if lt IE 8]>
63        <div style=' clear: both; text-align:center; position: relative;'>
64            <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
65                <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." />
66            </a>
67        </div>
68        <![endif]-->
69        <!--[if lt IE 9]>
70        <script type="text/javascript" src="js/html5.js"></script>
71        <link rel="stylesheet" type="text/css" media="screen" href="css/ie.css">
72        <![endif]-->
73    </head>
74<body>
75        <div class="glow">
76            <div class="main main_bg">
77            <!--==============================header=================================-->
78                <header>
79                    <h1><a class="logo" href="index.asp">Maverick Magazine</a></h1>
80                  <div class="social">
81                        <a href="#" title="Twitter"><img src="images/soc1.png" width="30" height="60" alt=""></a>
82                      <a href="#" title="Facebook"><img src="images/soc2.png" width="30" height="60" alt=""></a>
83                    </div>
84                  <form id="search">
85                        <input type="text">
86                          <a onclick="document.getElementById('search').submit()">search</a>
87                    </form>
88              </header>
89                <nav>
90                    <ul class="sf-menu">
91                        <li><a href="index.asp">Home</a>
92                            <ul>
93                                <li class="extra_last"><a href="latest.asp">Latest Issue</a></li>
94                            </ul>
95                        </li>
96                        <li><a href="subscribe.asp">Subscribe</a>
97                          <ul>
98                                <li class="extra_last"><a href="backissues.asp">Back Issues</a></li>
99                            </ul>
100                        </li>
101                        <li><a href="#">Reviews</a>
102                            <ul>
103                                <li><a href="cdreviews.asp">CD Reviews</a></li>
104                                <li class="extra_last"><a href="livereviews.asp">Live Reviews</a></li>
105                            </ul>
106                     </li>
107                        <li><a href="features.asp">Features</a></li>
108                        <li><a href="events.asp">Events</a></li>
109                        <li class="current"><a href="contact.html">contacts</a></li>
110                    </ul>
111                    <div class="clear"></div>
112                </nav>
113                <!--==============================content================================-->
114                <section id="content">
115                    <div class="container_12">
116                        <div class="wrapper">
117                            <article class="grid_5">
118                                <div class="pad_box1">
119                                    <h2 class="ind4">Find Us</h2>
120                                        <div class="map_wrapper">
121                                            <span class="img_wrap">
122                                                <iframe width="335" height="230" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="#"></iframe>
123
124                                                <br />
125                                             <small><a href="#" style="color:#0000FF;text-align:left">View Larger Map</a></small>
126                                            </span>
127                                        </div>
128                                        <dl class="adress">
129                                        <dt class="font17">address line1, <br>address line2<br></dt>
130                                        <dd> </dd>
131                                        <dd><span>Telephone:</span> +44 (0)1234 567890</dd>
132                                        <dd><span>FAX:</span> +44 (0)1234 567890</dd>
133                                        <dd><span>E-mail:</span> <a href="mailto:email@email.com">email@email.com</a><br><br>
134                                         <strong>Other text required here <a href="#">link here</a></strong>
135      <a href="#"></a>
136                                     </dd>
137                                    </dl>
138                                </div>
139                            </article>
140                            <article class="grid_7">
141                                <h2 class="ind4">Get In Touch</h2>
142                                    <form method="post" id="contact-form" name="captcha_form" action="mailform.php">
143                                        <div style="padding-bottom: 1em;">
144                                            <input type="text" name="name" id="name" value="Name" />
145                                        </div>
146                                        <div style="padding-bottom: 1em;">
147                                            <input type="text" name="email" id="email" value="Email" />
148                                        </div>
149                                        <div style="padding-bottom: 1em;">
150                                            <input type="text" name="phone" id="phone" value="Phone" />
151                                        </div>
152                                        <div style="padding-bottom: 1em; vertical-align:middle;">
153                                            <select name="emailaddress" class="grid_8contact" id="emailaddress">
154                                                <option value="0">Please Select</option>
155                                                <option value="1">Sales</option>
156                                                <option value="2">Advertising</option>
157                                                <option value="3">Editorial</option>
158                                                <option value="4">General</option>
159                                                <option value="5">Website</option>
160                                            </select>
161                                        </div>
162                                        <?php $subject = "Website Contact Form Submission"; ?>
163                                        <div style="padding-bottom: 1em;"><br />
164                                            <textarea name="message" id="message" rows="10" cols="60"><?php echo "</tex" . "tarea>"; ?><br />
165                                        </div>
166                                        <div style="padding-bottom: 1em;">
167                                            <input name="submit" type="submit" value="Submit" />
168                                        </div>
169                                    </form>
170                                </article>
171                            </div>
172                        </div>
173                    </section>
174                    <!--==============================footer=================================-->
175                    <footer>
176                        <ul class="f_menu">
177                            <li><a href="about.asp">about us</a></li>
178                            <li><a href="mediapack.asp">media pack</a></li>
179                            <li><a href="advertise.asp">advertise</a></li>
180                            <li><a href="legal.asp">legal</a></li>                
181                        </ul>
182                        <div class="privacy">Copyright link here<a href="privacy.asp">Privacy Policy </a></div>
183                    </footer>
184                </div>
185            </div>
186        </body>
187</html>


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 12 2013, 02:45 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



The only PHP code I found in the sample is this:

CODE
162                                        <?php $subject = "Website Contact Form Submission"; ?>
163                                        <div style="padding-bottom: 1em;"><br />
164                                            <textarea name="message" id="message" rows="10" cols="60"><?php echo "</tex" . "tarea>"; ?><br />
165                                        </div>

What's the purpose of printing out the TEXTAREA end tag with PHP? If PHP isn't enabled it will break the page structure.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 12 2013, 03:06 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



After removing the line numbers (please don't include that in code samples) and replacing the PHP with HTML (please don't include PHP unless the question is about PHP) the W3C validator only complains about the following errors:

QUOTE
Validation Output: 4 Errors
Line 122, Column 153: The frameborder attribute on the iframe element is obsolete. Use CSS instead.
…ameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="#"></iframe>


Line 122, Column 153: The scrolling attribute on the iframe element is obsolete. Use CSS instead.
…ameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="#"></iframe>


Line 122, Column 153: The marginheight attribute on the iframe element is obsolete. Use CSS instead.
…ameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="#"></iframe>


Line 122, Column 153: The marginwidth attribute on the iframe element is obsolete. Use CSS instead.
…ameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="#"></iframe>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Pluribus
post Apr 13 2013, 12:55 PM
Post #4


Member
***

Group: Members
Posts: 81
Joined: 6-February 09
Member No.: 7,737



QUOTE(Christian J @ Apr 12 2013, 02:45 PM) *

The only PHP code I found in the sample is this:

CODE
162                                        <?php $subject = "Website Contact Form Submission"; ?>
163                                        <div style="padding-bottom: 1em;"><br />
164                                            <textarea name="message" id="message" rows="10" cols="60"><?php echo "</tex" . "tarea>"; ?><br />
165                                        </div>

What's the purpose of printing out the TEXTAREA end tag with PHP? If PHP isn't enabled it will break the page structure.


Hi Christian

The php here comes from a php script. I don't know php at all so I had to look for a premade script. As for why it does what it does, I have no idea... sorry. I was just following the instructions that came with the script.

Ian
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Pluribus
post Apr 13 2013, 01:01 PM
Post #5


Member
***

Group: Members
Posts: 81
Joined: 6-February 09
Member No.: 7,737



Sorry, forgot to add that the <iframe> came from google maps (embedding a map on the page) Its a direct copy/paste of what Google gives me.

Ian
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 13 2013, 02:12 PM
Post #6


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



My guess is that your web server doesn't parse the PHP in your code example, which means the HTML structure breaks.

In any case the PHP snippets seem completely unnecessary:

CODE
<?php $subject = "Website Contact Form Submission"; ?>

The above defines a variable, but it's not used anywhere in the code sample you posted.

CODE
<?php echo "</tex" . "tarea>"; ?>

The above is just silly, all it does is print out a </textarea> end tag that might as well have been made with ordinary HTML.

This post has been edited by Christian J: Apr 13 2013, 02:16 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 13 2013, 02:15 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Why do you use the script in the first place? What is it supposed to do?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 05:10 PM