I keep getting a
"Parse error: syntax error, unexpected ':', expecting ')' in /home/jobkill/public_html/process.php on line 8"
when processing inputs from a page that redirects here. I dont know what to fix,
Here's the code:
<?
$aff = $_GET['aff'] ;
$click_id = $_GET['click_id'] ;
$zipcode = #$_GET['zip'];
$state = #$_GET['custom_state'];
$subid = $_GET['subid'] ;
$urls = array(
“http://consumerheadlinesdaily.com/debt/direct_2de89f.php?
cdb=23&zip=<?print $zipcode?>”,
“http://consumerheadlinesdaily.com/debt/direct_2de89f.php?
cdb=80&zip=<?print $zipcode?>”,
“http://consumerheadlinesdaily.com/debt/direct_2de89f.php?
cdb=46&zip=<?print $zipcode?>”,
“http://consumerheadlinesdaily.com/debt/direct_2de89f.php?
cdb=37&zip=<?print $zipcode?>”,
“http://consumerheadlinesdaily.com/debt/direct_2de89f.php?
cdb=55&zip=<?print $zipcode?>”,
“http://consumerheadlinesdaily.com/debt/direct_2de89f.php?
cdb=71&zip=<?print $zipcode?>”);
$url = $urls[array_rand($urls)];
echo “<meta http-equiv=\"refresh\" content=3; url='$url'>”;
?>
<html>
<HEAD>
<LINK href="./index_files/style2.css" rel="stylesheet" type="text/css">
<STYLE>
#middlename
{
display:none;
visibility:hidden;
}
</STYLE>
<SCRIPT type="text/javascript" src="./index_files/scripts.js"></SCRIPT>
<SCRIPT type="text/javascript"
src="./index_files/functions.js"></SCRIPT>
<script language="JavaScript"
src="http://j.maxmind.com/app/geoip.js"></script>
</HEAD><BODY>
<DIV id="form_complete">
<!-- OPEN MAIN TABLE -->
<TABLE width="100%" height="850" border="0" align="center"
cellpadding="0" cellspacing="0" class="tablebg2">
<TBODY>
<TR>
<TD valign="top" align="center">
<!-- OPEN PLACEMENT TABLE -->
<table width="1010" height="500" border="0" cellspacing="0"
cellpadding="0">
<tr><td height="220" colspan="3"> </td></tr>
<tr>
<td width="51%"><div align="center"><img
src="index_files/blank.gif" border="0" width="425" height="344"
/></div></td>
<td
width="10%">  
; </td
>
<td width="39%" align="left">
<br /><br /><br />
<div id="super-container0">
<div id="wrapper">
<span style="color:#000000;font-weight:bold;font-
size:24px;color:#898;">Now Searching...</span><br /><span
style="color:#000000;font-weight:bold;font-size:32px;"><script
language="Javascript">document.write(geoip_city());</script>, <script
language="Javascript">document.write(geoip_region());</script></span>
<!-- <h2>for <span style="color:#000000;font-weight:bold">30-
34</span> Year Old <span style="color:#000000;font-
weight:bold">Male</span> Drivers</h2> -->
<div id="block"></div>
<div id="progress-bar"><img src="index_files/progress.gif"></div>
</div>
</div>
</DIV>
</td>
</tr>
<tr>
<td height="350" colspan="3"> </td>
</tr>
<tr>
<td colspan="3">
<DIV class="Privacy" style="width: 1000px; margin: 0 auto;">
<P style="font-family:Arial, Helvetica, sans-serif; font-
size:11px; margin: 0px; padding: 0px;">All personal information and
email addresses are kept confidential. By
submitting your expression of interest you are consenting to receive
telephone calls from our participating partners even if you have been
previously listed on a state or federal Do-Not-Call List.
</P><P style="width: 1000px; text-align: center; margin-top: 0px;
padding-top: 0px;"><A href="#" onclick="MM_openBrWindow
('privacy.htm','','scrollbars=yes,width=500,height=
400')" target="_blank" style="font-family:Arial, Helvetica, sans-
serif; font-size:10px; color:#03C">Privacy Policy</A></P>
</DIV></td>
</tr>
</table> <!-- CLOSE PLACEMENT TABLE -->
</TD></TR></TABLE> <!-- CLOSE MAIN TABLE -->
<DIV id="processing" style="display:none">
<br /><br /><br /><br />
<CENTER><img src="./index_files/logo2.gif" /><br /><br />
<H2>Searching for a specialist now ...<BR>Thank you for giving us an
opportunity to assist you today.</H2><STRONG>(Please do not Refresh
page as that will result in an error in the system.)</STRONG><BR>
<IMG src="./index_files/ajax-loader.gif" width="220" height="19"
alt="Processing">
</CENTER>
</DIV>
</BODY></html>
The problem in your code are the quotes.
This character:
“
Is not recognised as a quotation in PHP, you need to use
'
Or
"
Here is the updated code
<?
$aff = $_GET['aff'] ;
$click_id = $_GET['click_id'] ;
$subid = $_GET['subid'];
$zipcode = '';
if (isset($_GET['zip']) {
$zipcode = $_GET['zip'];
}
$state = '';
if (isset($_GET['custom_state']) {
$state = $_GET['custom_state'];
}
$urls = array(
'http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=23&zip=' . $zipcode,
'http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=80&zip=' . $zipcode,
'http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=46&zip=' . $zipcode,
'http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=37&zip=' . $zipcode,
'http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=55&zip=' . $zipcode,
'http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=71&zip=' . $zipcode);
$url = $urls[array_rand($urls)];
?>
<html>
<head>
<meta http-equiv="refresh" content=3; url='<? echo $url ?>'>
<link href="./index_files/style2.css" rel="stylesheet" type="text/css">
<style>
#middlename
{
display:none;
visibility:hidden;
}
</style>
<script type="text/javascript" src="./index_files/scripts.js"></script>
<script type="text/javascript" src="./index_files/functions.js"></script>
<script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>
</head>
<body>
<div id="form_complete">
<!-- OPEN MAIN TABLE -->
<table width="100%" height="850" border="0" align="center" cellpadding="0" cellspacing="0" class="tablebg2">
<tbody>
<tr>
<td valign="top" align="center">
<!-- OPEN PLACEMENT TABLE -->
<table width="1010" height="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="220" colspan="3"> </td>
</tr>
<tr>
<td width="51%">
<div align="center">
<img src="index_files/blank.gif" border="0" width="425" height="344" />
</div>
</td>
<td width="10%">
</td>
<td width="39%" align="left">
<br /><br /><br />
<div id="super-container0">
<div id="wrapper">
<span style="color:#000000;font-weight:bold;font-size:24px;color:#898;">Now Searching...</span><br />
<span style="color:#000000;font-weight:bold;font-size:32px;">
<script type="text/javascript">document.write(geoip_city());</script>,
<script type="text/javascript">document.write(geoip_region());</script>
</span>
<!-- <h2>for <span style="color:#000000;font-weight:bold">30-34</span> Year Old
<span style="color:#000000;font-weight:bold">Male</span> Drivers</h2> -->
<div id="block"></div>
<div id="progress-bar"><img src="index_files/progress.gif"></div>
</div>
</div>
</td>
</tr>
<tr>
<td height="350" colspan="3"> </td>
</tr>
<tr>
<td colspan="3">
<div class="Privacy" style="width: 1000px; margin: 0 auto;">
<p style="font-family:Arial, Helvetica, sans-serif; font-size:11px; margin: 0px; padding: 0px;">All personal information and
email addresses are kept confidential. By submitting your expression of interest you are consenting to receive
telephone calls from our participating partners even if you have been
previously listed on a state or federal Do-Not-Call List.</p>
<p style="width: 1000px; text-align: center; margin-top: 0px; padding-top: 0px;">Privacy Policy</p>
</div>
</td>
</tr>
</table> <!-- CLOSE PLACEMENT TABLE -->
</td>
</tr>
</tbody>
</table> <!-- CLOSE MAIN TABLE -->
</div>
<div id="processing" style="display:none">
<br /><br /><br /><br />
<center>
<img src="./index_files/logo2.gif" /><br /><br />
<H2>Searching for a specialist now ...<BR>Thank you for giving us an opportunity to assist you today.</h2>
<strong>(Please do not Refresh page as that will result in an error in the system.)</strong><br>
<img src="./index_files/ajax-loader.gif" width="220" height="19" alt="Processing">
</center>
</div>
</body>
</html>
I have also...
Fixed a couple of HTML errors, with missing closing tags or bad nesting
Rather than using error suppression in PHP (#$_GET['mightnotexist']) I have performed an isset($_GET['mightnotexist']) check
I have normalised the script tags
But I haven't...
Removed the tables being used for layout
Moved the inline styles into the stylesheet
UPDATE:
added whole code, tested and working
replace <?print $zipcode?> with $zipcode
i.e. “http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=23&zip=<?print $zipcode?>”,
into “http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=23&zip=$zipcode”,
and replace quotation marks (“”) to normal ones ("")
basically your code should look like this:
<?php
$aff = $_GET['aff'] ;
$click_id = $_GET['click_id'] ;
$zipcode = #$_GET['zip'];
$state = #$_GET['custom_state'];
$subid = $_GET['subid'] ;
$urls = array(
"http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=23&zip=$zipcode",
"http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=80&zip=$zipcode",
"http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=46&zip=$zipcode",
"http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=37&zip=$zipcode",
"http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=55&zip=$zipcode",
"http://consumerheadlinesdaily.com/debt/direct_2de89f.php?cdb=71&zip=$zipcode");
$url = $urls[array_rand($urls)];
?>
<html>
<HEAD>
<LINK href="./index_files/style2.css" rel="stylesheet" type="text/css">
<STYLE>
#middlename
{
display:none;
visibility:hidden;
}
</STYLE>
<SCRIPT type="text/javascript" src="./index_files/scripts.js"></SCRIPT>
<SCRIPT type="text/javascript"
src="./index_files/functions.js"></SCRIPT>
<script language="JavaScript"
src="http://j.maxmind.com/app/geoip.js"></script>
<meta http-equiv="refresh" content="3;url=<?php echo $url; ?>">
</HEAD><BODY>
<DIV id="form_complete">
<!-- OPEN MAIN TABLE -->
<TABLE width="100%" height="850" border="0" align="center"
cellpadding="0" cellspacing="0" class="tablebg2">
<TBODY>
<TR>
<TD valign="top" align="center">
<!-- OPEN PLACEMENT TABLE -->
<table width="1010" height="500" border="0" cellspacing="0"
cellpadding="0">
<tr><td height="220" colspan="3"> </td></tr>
<tr>
<td width="51%"><div align="center"><img
src="index_files/blank.gif" border="0" width="425" height="344"
/></div></td>
<td
width="10%">  
; </td
>
<td width="39%" align="left">
<br /><br /><br />
<div id="super-container0">
<div id="wrapper">
<span style="color:#000000;font-weight:bold;font-
size:24px;color:#898;">Now Searching...</span><br /><span
style="color:#000000;font-weight:bold;font-size:32px;"><script
language="Javascript">document.write(geoip_city());</script>, <script
language="Javascript">document.write(geoip_region());</script></span>
<!-- <h2>for <span style="color:#000000;font-weight:bold">30-
34</span> Year Old <span style="color:#000000;font-
weight:bold">Male</span> Drivers</h2> -->
<div id="block"></div>
<div id="progress-bar"><img src="index_files/progress.gif"></div>
</div>
</div>
</DIV>
</td>
</tr>
<tr>
<td height="350" colspan="3"> </td>
</tr>
<tr>
<td colspan="3">
<DIV class="Privacy" style="width: 1000px; margin: 0 auto;">
<P style="font-family:Arial, Helvetica, sans-serif; font-
size:11px; margin: 0px; padding: 0px;">All personal information and
email addresses are kept confidential. By
submitting your expression of interest you are consenting to receive
telephone calls from our participating partners even if you have been
previously listed on a state or federal Do-Not-Call List.
</P><P style="width: 1000px; text-align: center; margin-top: 0px;
padding-top: 0px;"><A href="#" onclick="MM_openBrWindow
('privacy.htm','','scrollbars=yes,width=500,height=
400')" target="_blank" style="font-family:Arial, Helvetica, sans-
serif; font-size:10px; color:#03C">Privacy Policy</A></P>
</DIV></td>
</tr>
</table> <!-- CLOSE PLACEMENT TABLE -->
</TD></TR></TABLE> <!-- CLOSE MAIN TABLE -->
<DIV id="processing" style="display:none">
<br /><br /><br /><br />
<CENTER><img src="./index_files/logo2.gif" /><br /><br />
<H2>Searching for a specialist now ...<BR>Thank you for giving us an
opportunity to assist you today.</H2><STRONG>(Please do not Refresh
page as that will result in an error in the system.)</STRONG><BR>
<IMG src="./index_files/ajax-loader.gif" width="220" height="19"
alt="Processing">
</CENTER>
</DIV>
</BODY></html>
replace "refresh" in your echo with \"refresh\"
and
<?print $zipcode?>
in array with
$zipcode
Update:
Checked your code and was able to reproduce your error. You're not using double quotes but some other obscure quotes that is not supported by PHP.
Proper double quotes are literally ". You can learn about the details in the PHP manual.
You probably made an error while copy and pasting code from somewhere else in the internet that was changing code's quote's on the fly for styling and display reason.
Take care. The other problems in your code still stand (see other answers as well).
Try
echo "<meta http-equiv=\"refresh\" content=\"3; url='$url'\">";
instead of the similar but different line in your screenshot (it's no text, so I can't quote it and highlight the places you made errors in there, so sorry 'bout that).
This does not create the syntax error you're asking about however.
Related
I have set up a site and added a contact form into it. Php mailer work correctly but when the mail text arrives to me there is no empty between the letters. All of them is adjoining. I want to list titles one under to other mailer.php. The code is like this
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->SetLanguage("tr", "phpmailer/language");
$mail->CharSet ="utf-8";
$mail->Username = "sample";
$mail->Password = "sample";
$mail->SetFrom("sample#sample.com", "Baslik");
$mail->AddAddress("sample#sample.com");
$mail->Subject = "Siteden Gönderildi";
include("iletisim.html");
$mail->Body = $frmName= $_POST["frmName"].
$frmCity= $_POST["frmCity"] .
$adressatiri= $_POST["adressatiri"].
$adressatiri2= $_POST["adressatiri2"].
$email= $_POST["email"] .
$frmTelephone= $_POST["frmTelephone"] .
$frmPhoneType= $_POST["frmPhoneType"] .
$frmContactBy= $_POST["frmContactBy"] .
$frmBestTime= $_POST["frmBestTime"] .
$frmMessage= $_POST["frmMessage"];
if(!$mail->Send()){
echo "Mailer Error: ".$mail->ErrorInfo;
} else {
echo "Mesajınız Gonderilmistir";
}
?>
and contact.html file is like this. If you can help me i will be very happy. Because i didnt solve this problem throughout one
<!doctype html>
<html>
<head>
<link rel="Shortcut Icon" href="image/favicon.ico" type="image/x-icon">
<meta charset="utf-8">
<title>Sena DOĞAN Kişisel Web Sitesi</title>
<style type="text/css">
body, p, table, th, td, div {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
th {
background-color:#0080C0;
color:white;
font-weight:bold;
font-size:18px;
border: 1px solid #0080C0;
}
input.text, textarea {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
width: 99%;
}
.text:focus, textarea:focus {
background-color: #FFFACC;
border: 1px solid #000000;
}
#mydiv {
margin-left: auto ;
margin-right: auto ;
width: 500px;
text-align: left;
}
td.colone {
text-align: right;
vertical-align: top;
padding-top:6px;
width:20%;
}
td.coltwo {
color:red;
text-align: center;
vertical-align: top;
padding-top:9px;
}
td.colthree {
width:80%
}
table.border {
border: 1px solid #0080C0;
border-collapse: collapse;
}
</style>
<link href="banner.css" rel="stylesheet" type="text/css">
}
</head>
<body>
<div class="container"> <img src="image/Sena banner.png" width="999" height="258" alt="KTU"/>
<div id="navbar">
<ul style="">
<li style="">Ana Sayfa</li>
<li> Hakkında</li>
<li> Projeler</li>
<li>Deneyim</li>
<li> Galeri</li>
<li> İletişim</li>
<br>
<br>
<br></ul>
<br/>
<form method="POST" action="mailer.php" enctype="multipart/form-data">
<input type="hidden" value="samplecontactus.html" name="referer">
<table class="border" width="500" cellpadding="3" cellspacing="0">
<tr>
<th colspan="3" align="center">İletişim İçin Lütfen Aşağıdaki Kutuları Doldurun</th>
</tr>
<tr>
<td colspan="3"><div style="height:5px;"></div></td>
</tr>
<tr>
<td class="colone">Ad Soyad</td>
<td class="coltwo">*</td>
<td class="colthree"><input class="text" type="text" name="frmName" style="width:98%;"></td>
</tr>
<tr>
<td class="colone">Şehir</td>
<td class="coltwo"> </td>
<td class="colthree"><input class="text" type="text" name="frmCity" style="width:98%;"></td>
</tr>
<tr>
<td class="colone">Adres</td>
<td class="coltwo"> </td>
<td class="colthree"><input class="text" type="text" name="adressatiri" style="width:98%;"></td>
</tr>
<tr>
<td class="colone">Adres-2</td>
<td class="coltwo"> </td>
<td class="colthree"><input class="text" type="text" name="adressatiri2" style="width:98%;"></td>
</tr>
<tr>
<td class="colone">E-posta</td>
<td class="coltwo">*</td>
<td class="colthree"><input class="text" type="text" name="email" style="width:98%;"></td>
</tr>
<tr>
<td class="colone">Telefon</td>
<td class="coltwo"> </td>
<td class="colthree">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="200"><input class="text" type="text" name="frmTelephone" style="width:200px;"></td>
<td>
<select size="1" name="frmPhoneType">
<option value="Home">Ev</option>
<option value="Worx">İş</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="colone">Görüşme Şekli</td>
<td class="coltwo"> </td>
<td class="colthree">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="1">
<select size="1" name="frmContactBy">
<option value="Telefon">Telefon</option>
<option value="Email">E-Posta</option>
</select>
</td>
<td>
<select size="1" name="frmBestTime">
<option value="Morning">Gündüz</option>
<option value="Afternoon">Öğle</option>
<option value="Evening">Akşam</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="colone">Mesaj</td>
<td class="coltwo">*</td>
<td class="colthree"><textarea class="text" name="frmMessage" style="width:98%;height:100px;"></textarea></td>
</tr>
<tr>
<td class="colone" colspan="2"> </td>
<td class="colthree"><input type="submit" value="Gönder" name="submit"><input type="reset" value="Reset" name="reset"></td>
</tr>
<tr>
<td colspan="3"><div style="height:5px;"></div></td>
</tr>
</table>
</form>
</div>
<h2><span style="color: #ED0F13"><center>
</center>
</span></h2>
<blockquote>
<p> </p>
<p><span class="copyright" style="text-align: center"><span class="copyright"><center class="copyright">Copyright © 2018 DOĞAN Web Tasarım™</center><span class="copyright"><span class="copyright"></span></span>
</center>
</span></span></p>
</blockquote>
<p><span class="imagefloatleft">
<article id="123"> </article>
</span>
<span class="imagefloatleft">
<article id="text"> </article>
</span>
<span class="imagefloatleft">
<article id="text"> </article>
</span>
<span class="imagefloatleft">
<article id="text"> </article>
</span>
<span class="imagefloatleft">
<article id="text"> </article>
</span>
<span class="imagefloatleft">
<article id="text"> </article>
</span><span class="imagefloatleft">
<article id="text"> </article>
</span><span class="imagefloatleft">
<article id="text"></article>
</span></p>
</div>
</body>
</html>
It's because HTML collapses white space. The easiest way to fix this is to convert real line breaks into HTML break tags in your message body:
$mail->Body = nl2br($mail->Body);
As a result of my researches I have found a solution like this
<a><span style='font-weight: bold;'>İsim:</span> ".$_POST["frmName"]."</a><br>
<a><span style='font-weight: bold;'>Şehir:</span> ".$_POST["frmCity"]."</a><br>
<a><span style='font-weight: bold;'>Adres 1:</span> ".$_POST["adressatiri"]."</a><br>
<a><span style='font-weight: bold;'>Adres 2:</span> ".$_POST["adressatiri2"]."</a><br>
<a><span style='font-weight: bold;'>E-posta:</span> ".$_POST["email"]."</a><br>
<a><span style='font-weight: bold;'>Telefon:</span> ".$_POST["frmTelephone"]."</a><br>
<a><span style='font-weight: bold;'>Telefon Tipi:</span> ".$_POST["frmPhoneType"]."</a><br>
<a><span style='font-weight: bold;'>Görüşme Şekli:</span> ".$_POST["frmContactBy"]."</a><br>
<a><span style='font-weight: bold;'>En uygun zaman:</span> ".$_POST["frmBestTime"]."</a><br>
<a><span style='font-weight: bold;'>Mesaj:</span> ".$_POST["frmMessage"]."</a>
okay, so my head is going to explode right now, i'm searching 5 hours non stop for my problem..
i want the menu2.html which is inside a table, to appear on the end of the page, After the end of the Content!
i tried a lot, like:
1-position: absolute; bottom: 0;
2-position: absolute; left: 100px; top: 150px; etc etc...
But this is not what im looking for!
I could put the menu2 after the content only by editing the top:150 But there are a lot of pages with different contents, so the menu2 doesn't suit in the other pages!
I hope you can help me.
This Is My PHP file:
<style type="text/css">
.menu2 {
background-image: url('<?=$profpic;?>');
background-attachment:fixed;
background: yellow;
}
</style>
<title>Hello</title>
</head>
<body>
<table width="100%" height="58%" border="0" cellspacing="0" cellpadding="2" class="heading">
<tr>
<td>
<?php include('menu.html');?>
</td>
</tr>
<tr>
<td><img src="pictures/logo.png" width="1335" height="300"></td>
</tr>
</table>
<table width="85%" height="1%" border="1" cellspacing="0" cellpadding="2">
<tr>
<td>
<?php include('menu2.php');?>
</td>
</tr>
</table>
<?php
$profpic = "pictures/bg.jpg";
?>
</body>
</html>
It's not clear to me what you are trying to do here, but I'll take a shot at helping you. First of all, you can't have multiple <html>, <head>, and <body> tags on the same page. Only one set of these are allowed. Secondly, change the file type of menu2 to php instead of html if you want to include it there.
<style type="text/css">
.menu2 {
background-image: url('<?=$profpic;?>');
background-attachment:fixed;
position: absolute;
background: yellow;
}
</style>
<title>Hello</title>
</head>
<body>
<table width="100%" height="58%" border="0" cellspacing="0" cellpadding="2" class="heading">
<tr>
<td>
<?php include('menu.html');?>
</td>
</tr>
<tr>
<td><img src="pictures/logo.png" width="1335" height="300"></td>
</tr>
</table>
<table width="85%" height="1%" border="1" cellspacing="0" cellpadding="2">
<tr>
<td>
<?php include('menu2.php');?>
</td>
</tr>
</table>
<?php
$profpic = "pictures/bg.jpg";
?>
</body>
</html>
menu2.php
<div class="menu2">
//menu2 contents
</div>
I have a basic form that submits the form data to the same page and do a simple search in a MySQL db. The php for this in before the <html> tag
<body>
<div data-role="page">
<div role="main" class="ui-content">
enter code here
<table style="width:750px;">
<form enctype="multipart/form-data" action="player_documents_m.php" method="get" data-ajax="false">
<tr style="height:35px;">
<td style="width:250px; vertical-align:top; text-align:left;">
<label for="name">Player Name: </label>
</td>
<td style="text-align:left; vertical-align:middle; text-align:center;">
<input type="text" name="name" id="name" class="inputs" size="45" value="<?php echo $my_name; ?>" maxlength="255"/>
</td>
</tr>
<tr style="height:35px;">
<td style="text-align:left; vertical-align:bottom; text-align:right;" colspan="2">
<input type="submit" name="search" id="search" value="Search Player" />
</td>
</tr>
</form>
</table>
The above works in JqueryMobile
Then the results are added dynamically with html content but this does not work in JqueryMobile but taking out all JQueryMobile related stuff and leave a normal php page everything works.
Below the table tag above I add my php to add the founded search results.
<?php
for($j = 0; $j < $i; $j++)
{
$photo = "images/" . $db_new . "/players/" . $player[$j]["player_id"] . ".jpeg";
echo "<br />";
?>
<!-- Search Results -->
<div class="singleResult" onclick="javascript: window.location.replace('load_documents.php?identification=<?php echo $player[$j]["player_id"]; ?>');">
<table border="1" style="width:100%; border: solid thin; padding:0; border-spacing:0;">
<tr>
<!-- Image 1st Column -->
<td rowspan="2" colspan="1" style="width:10%; vertical-align:top; text-align:left;">
<img src="<?php echo $photo; ?>" style="width:150px; height:180px;" />
</td>
<td class="labels">Name:
<p class="results"><?php echo $player[$j]["player_name"]; ?></p>
</td>
</tr>
</table>
</div>
<!-- End Of Search Results -->
<?php
}
?>
</div>
</div>
</body>
Now the above only works normally and not in JqueryMobile. can some please explain to me what I am doing wrong / need to add, or anything helpful please.
Thanks
I've been editing my MyBB portal.php, and up until recently it was displaying fine. I had added a custom welcome block above the recent posts, and it was displaying fine.
Today I went in to tidy up the code, adding new lines (enter) and indents to make the code more legible. Now, after doing this something went badly wrong. Instead of showing the full MyBB page styles, all it shows is the tags like {$header}. Here's the code:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
</head>
<body>
{$header}
<table width="100%" cellspacing="0" cellpadding="{$theme['tablespace']}" border="0" align="center">
<tr><td valign="top" width="200">
{$welcome}
{$pms}
{$search}
{$stats}
{$whosonline}
{$latestthreads}
</td>
<td> </td>
<td valign="top">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="trow1">
<span class="smalltext">
<!--Main Welcome Panel-->
<p style="text-align: center;">
<img alt="" src="http://axelcraft.net/images/welcome.png" style="width: 1024px;" /></p>
<p style="text-align: center;">
<span style="color:#696969;"><span style="font-size: 24px;"><em><span style="font-family: hutrmold;">Get ready for a whole new minecraft experience.</span></em></span></span></p>
<!--Slideshow-->
<center>
<iframe src="http://axelcraft.net/images/slides/slideshow.html" width="800" height="320" scrolling="no" frameBorder="0" style="overflow:hidden;"></iframe>
</center>
<!--End Slideshow-->
<p style="text-align: center;">
<span style="font-size:20px;">
<span style="font-family: 'trebuchet ms', helvetica, sans-serif;">
Thanks for visiting AxelCraft! Start by <span style="color:#385947;"><span style="">signing up</span></span> to get the latest news and updates on the server as well as to register for <span style="color:#385947;">contests</span> and <span style="color:#385947;">events</span>!
</span>
</span>
</p>
<!--End Welcome Panel-->
</span>
</td>
</tr>
</table>
<br />
{$announcements}
</td>
</tr>
</table>
{$footer}
</body>
</html>
Now, when you navigate to portal.php, it only shows the {$} tags along with the html paragraph. It's supposed to be showing sidebars and headers left and right like MyBB does. See what I mean here.
Compare that to the normal forum page here.
I can't figure out what's wrong or why it's not displaying properly.
I could be wrong but are you missing an '>' here
<tr><td
<table width="100%" cellspacing="0" cellpadding="{$theme['tablespace']}" border="0" align="center">
<tr><td valign="top" width="200">
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
Can anyone find what is wrong with this code? i have Parse error: syntax error, unexpected end of file in C:\Program Files\EasyPHP-12.1\www\index.php on line 229
wondering if you can help me with this i'm so confused...
<?php include("./ayarlar.php");
if(isset($_GET['uygulama']) && $_GET['uygulama']=="cikis"){
$_SESSION['uyeKontrol']="";
$_SESSION['uyeTanimlama']="";
$_SESSION['uyeAdi']="";
header( 'Location: ./' );
}
?>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script id="jquery.core" src="uygulamalar/jquery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="uygulamalar/menu.js"></script>
<link href="tasarim/icon.png" rel="shortcut icon">
<title><?=$sitebaslik?></title>
<style type="text/css">
ul.listemiz{width:985px;list-style:none;float:left; padding:10px 0px 0px 23px;}
ul.listemiz li{width: 220px; height:211px; float: left; background:url(tasarim/list.png);padding:6px 18px 0px 0px;}
</style>
<style type="text/css">
ul.gorsel{width:1100px;list-style:none;float:left; margin:0px 0px 0px 0px;padding:0px 0px 0px 0px;}
ul.gorsel li{width: 230px; height:143px; float: left; background:url(tasarim/tm.png);padding:6px 12px 0px 0px;}
</style>
<link rel="stylesheet" href="Standard/css/global.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js"></script>
<script src="Standard/js/slides.min.jquery.js"></script>
<script>
$(function(){
$('#slides').slides({
preload: true,
preloadImage: 'Standard/img/loading.gif',
play: 5000,
pause: 2500,
hoverPause: true
});
});
</script>
</head>
<body style="background-attachment: scroll; background-color:#E6E6E6">
<div class="temel">
<?php include("./site01.php");?>
<div id="sayfaicerigi"><div align="center"><br />
<table border="0" width="980" height="310" cellspacing="0" cellpadding="0">
<tr>
<td width="302" valign="top" align="left">
<?php if(isset($_SESSION['uyeKontrol']) && $_SESSION['uyeKontrol']!=""){?>
<table border="0" width="295" cellspacing="0" cellpadding="0" height="103" background="img/<?=$menu102?>.png">
<tr>
<td valign="top" align="center"></td>
</tr>
<tr>
<td valign="center" align="center" height="40">
<a href="hesabim">
<img border="0" src="img/<?=$menu108?>.png" width="120" height="32"></a>
<img border="0" src="img/<?=$menu109?>.png" width="120" height="32"></td>
</tr>
<tr>
<td valign="top" align="center" height="33">
<font face="Tahoma" color="#FFFFFF" style="font-size: 11pt">Hoş geldin: <?=$_SESSION['uyeAdi']?>
</font>
</td>
</tr>
</table>
<p><img border="0" src="img/EMLK.png" width="295" height="103"></p>
<?}else{?>
<table border="0" width="295" cellspacing="0" cellpadding="0" height="103" background="img/<?=$menu102?>.png">
<tr>
<td valign="top" align="center"></td>
</tr>
<tr>
<td valign="center" align="center" height="40">
<a href="kurumsal-giris">
<img border="0" src="img/<?=$menu104?>.png" width="120" height="32"></a>
<img border="0" src="img/<?=$menu103?>.png" width="120" height="32"></td>
</tr>
<tr>
<td valign="top" align="center" height="33">
<a href="uye">
<img border="0" src="img/uyecik.png" width="244" height="23"></a></td>
</tr>
</table>
<p><img border="0" src="img/EMLK.png" width="295" height="103"></p>
<?php }?>
</td><td width="13"></td>
<td width="665" valign="top" align="left">
<div style="position: absolute; width: 100px; height: 100px; z-index: 501" id="katman2">
<img src="Standard/img/new-ribbon.png" width="112" height="112" alt="New Ribbon" id="ribbon">
<div id="slides">
<div class="slides_container">
<?php
$mansetler = mysql_query("SELECT * FROM emlak order by id desc LIMIT 0,7");
while($manset = mysql_fetch_array($mansetler))
{
$mansetlerCO = mysql_query("SELECT * FROM resimler where emlak='".$manset['id']."'");
if($mansetCO = mysql_fetch_array($mansetlerCO))
{
}
?>
<a href="<?=$manset['id']?>_<?=duzgundur(StrToLower($manset['emlak']))?>.html" title="" >
<div style="position: absolute; width: 595px; height: 60px; top:220px; z-index: 102; background:#C0C0C0; color:#fff; overflow:hidden; z-index:200; opacity:.8; filter:alpha(opacity=80)" id="katman3" ><br> <b><font color="#000000" face="Tahoma" style="font-size: 12pt"><?=substr($manset['emlak'],0,60)?>.. - Fiyat: <?=$manset['fiyat']?> TL</font></b></div>
<img src="<?=$mansetCO['resim']?>" width="600" height="270" alt=""></a>
<?php }?>
</div>
<img src="Standard/img/arrow-prev.png" width="24" height="43" alt="Arrow Prev">
<img src="Standard/img/arrow-next.png" width="24" height="43" alt="Arrow Next">
</div>
<img src="Standard/img/example-frame.png" width="739" height="341" alt="Example Frame" id="frame">
</div>
</td>
</tr>
</table></div>
<table border="0" width="980" height="33" style="border-bottom:1px solid #dcdbdb;">
<tr>
<td valign="center" align="left" width="35">
<img border="0" src="tasarim/icon.png" width="24" height="24"></td>
<td valign="center" align="left" width="293">
<?=$menu3?></td>
<td valign="center" align="left" width="638">
<p align="right"><?=$menu100?> </td>
</tr>
</table>
<table border="0" width="980" height="131" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" align="left" width="980">
<ul class="gorsel">
<?php
$rastgeleler = mysql_query("SELECT * FROM emlak WHERE durum=2 and onay=1 order by id desc LIMIT 8");
while($rastgele = mysql_fetch_array($rastgeleler))
{
?><li>
<table border="0" width="238" height="113" cellspacing="0" cellpadding="0">
<tr>
<td width="14"> </td>
<td width="115">
<a href="<?=$rastgele['id']?>_<?=duzgundur(StrToLower($rastgele['emlak']))?>.html">
<?php
$resimsecici = mysql_query("SELECT * FROM resimler where emlak='".$rastgele['id']."'");
if($resimci = mysql_fetch_array($resimsecici))
{
?><img border="0" src="goruntule?img=<?=$resimci['resim']?>&w=110&h=91"><?}?></a></td>
<td width="109"><font face="Tahoma" size="2"><?=$menu88?> :<?php if($rastgele['durum']==1){?><?=$menu19?><?}else{?><?=$menu20?><?php }?><br>
<?=$menu18?>: <?=$rastgele['fiyat']?> TL<br>
<?=$rastgele['ilce']?>/<?=substr($rastgele['il'],0,3)?>.<br>
<br>
<a href="<?=$rastgele['id']?>_<?=duzgundur(StrToLower($rastgele['emlak']))?>.html">
<img border="0" src="tasarim/<?=$menu97?>.png" width="84" height="18"></a></font></td>
</tr>
</table>
</li> <?}?>
</ul></td>
</tr>
</table>
<table border="0" width="980" height="33" style="border-bottom:1px solid #dcdbdb;">
<tr>
<td valign="center" align="left" width="35">
<img border="0" src="tasarim/icon.png" width="24" height="24"></td>
<td valign="center" align="left" width="272">
<?=$menu2?></td>
<td valign="center" align="left" width="659">
<p align="right"><?=$menu100?> </td>
</tr>
</table>
<table border="0" width="980" height="131" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" align="left" width="980">
<ul class="gorsel">
<?php
$rastgeleler = mysql_query("SELECT * FROM emlak WHERE durum=1 and onay=1 order by id desc LIMIT 4");
while($rastgele = mysql_fetch_array($rastgeleler))
{
?><li>
<table border="0" width="238" height="113" cellspacing="0" cellpadding="0">
<tr>
<td width="14"> </td>
<td width="115">
<a href="<?=$rastgele['id']?>_<?=duzgundur(StrToLower($rastgele['emlak']))?>.html">
<?php
$resimsecicim = mysql_query("SELECT * FROM resimler where emlak='".$rastgele['id']."'");
if($resimcim = mysql_fetch_array($resimsecicim))
{
?><img border="0" src="goruntule?img=<?=$resimcim['resim']?>&w=110&h=91"><?}?></a></td>
<td width="109"><font face="Tahoma" size="2"><?=$menu88?> :<?php if($rastgele['durum']==1){?><?=$menu19?><?}else{?><?=$menu20?><?php }?><br>
<?=$menu18?>: <?=$rastgele['fiyat']?> TL<br>
<?=$rastgele['ilce']?>/<?=substr($rastgele['il'],0,3)?><br>
<br>
<a href="<?=$rastgele['id']?>_<?=duzgundur(StrToLower($rastgele['emlak']))?>.html">
<img border="0" src="tasarim/<?=$menu97?>.png" width="84" height="18"></a></font></td>
</tr>
</table>
</li> <?php }?>
</ul></td>
</tr>
</table>
</div>
<br>
<?php include("./site02.php");?><br><br>
</div>
</body>
</html>
<?php
$_SESSION['gidenemlak']="";
?>
I think the problem is this piece: }?> Which is located somewhere in the middle of the code.
You shouldn't put brackets directly close to the open/close php tag, but separate with space: } ?>
The error is caused because of lacking space between open/close php tag and brackets. You should avoied this:
{?> AND <?}else{?>
Instead, you should have it like this:
{ ?> AND <?php else{ ?>
You are missing some ending curly brackets in your script