PHP - Blogger Problem With Reciprocal Script
Hello i'm using this script to search a specific piece of html code in webpages:
<?php $website = $_POST['url']; $siteurl = $_POST['recurl']; $recip = '<!-- Start Backlink Code --><a target="_blank" href="http://site.com" title="Site"><img border="0" src="http://site.com/image.gif" alt="Site"/></a><!-- End Backlink Code -->'; if (backlinkCheck($siteurl, $recip) === TRUE) { echo "Backlink was FOUND on: ".$siteurl; } else { echo "Backlink was NOT FOUND on: ".$siteurl; } function backlinkCheck($siteurl, $recip) { $content = file_get_contents($siteurl); if(strpos($content, $recip) !== FALSE){ return TRUE; } else { return FALSE; } } ?> This script working very well but if I insert my piece of code in blog of blogspot/blogger in particular in gadget of blogger ( html/ javascript gadget) the script don't find code If i insert my piece of code in posts of blogger script find code but in gadget no Where is the problem? Thanks Similar TutorialsWell this problem has occurred a lot. I try to put ". $_GET['site'] ." or ". $_POST['site'] ." in my script and i get a server errror when trying t access my page ( error connecting the page basically) Here is the part of the script which that is occuring to: Quote if($_GET['step'] == 2) { echo 'Just adding INCLUDE files'; exec('xcopy /X/ / ". $_GET['site'] ." / /e/i', $a, $a1); <---- This line echo '<form action="install.php?step=3&guid='. $my_guid .'" method="post">'; echo '<input type="submit" value="Continue">'; echo '</form>'; } When i try using the $_GET function or $_POST functions in alot of stuff it just shows an server error(error connecting the page on my browser) Someone please help! Previously, the PHP codebase I was using was that written by others, and I used their code to tinker with so I could get an understanding how PHP works. Now that I am comfortable using PHP, I have written my own short PHP script from scratch with the aim of it seeing my newsletter system functioning at minimal, for the first time. The newsletters system is made with HTML/PHP/MySQL. I am having a problem with the PHP side of things where I am getting an error: Quote PHP Parse error: syntax error, unexpected T_IF on line 50 ... which is: Code: [Select] if $_POST['action'] == 'Register' { I am hoping someone that knows allot about PHP could take a look at my code and see whats wrong with it? PHP code within confirm.html: Code: [Select] <?php $link = mysql_connect('localhost', 'testusr', 'testpw'); mysql_select_db('testdb', $link); $email = $_POST['e-mail']; $query = if $_POST['action'] == 'Register' { if $_POST['newsletter'] == 'Mens' { "INSERT INTO newsletters(mens) VALUES('$email')"; } elseif $_POST['newsletter'] == 'Mens & Womens' { "INSERT INTO newsletters(mensandwomens) VALUES('$email')"; } elseif $_POST['newsletter'] == 'Womens' { "INSERT INTO newsletters(womens) VALUES('$email')"; } ;} mysql_query ($link, $query); mysql_close($link); ?> HTML FORM code within index.html: Code: [Select] <FORM action="confirm.html" method="post"> <DIV> <SPAN class="input"> Action: <SELECT name="action"> <OPTION>Register</OPTION> <OPTION>Unregister</OPTION> </SELECT>    E-mail: <INPUT name="e-mail" type="text"></INPUT>    Newsletter: <SELECT name="newsletter"> <OPTION>Mens</OPTION> <OPTION>Mens & Womans</OPTION> <OPTION>Womens</OPTION> </SELECT>    <INPUT class="submit" type="submit" value="Submit"> </SPAN> </DIV> </FORM> if ($action == "discussion") { if ($_POST['comment'] == "") { echo "<p align=center>Sorry your comment was not posted due to the comment being blank. You will be redirected in a few seconds so please try again</p> <p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=15;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; include("bottom.php"); exit; } if (isset($_POST) && !empty($_POST)) { if (isset($_SESSION['posttimer'])) { if ( (time() - $_SESSION['posttimer']) <= 10) { echo "<p align=center><b>Bit of a problem here, Double Post attempt has been found. Don't worry we stopped it.</b></p>"; echo "<p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=15;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; } else { $sumscore = $row[score] + 2; $sumcomments = $row[comments] + 1; $con=mysqli_connect("DETAILS FOR SQL STUFF IN HERE BUT DELETED FOR PURPOSES OF THE FORUM"); if (mysqli_connect_errno()) { echo "<p align=center>Failed to connect to MySQL: </p>" . mysqli_connect_error(); } $sql="INSERT INTO comments (userid, topicid, category, topicname, comment, date, name, address, avatar) VALUES ('$row[id]','$content[id]','blogs','$content[topic]','$_POST[comment]','$today','$row[name]','http://www.sentuamessage.com/blog.php?who=$content[id]', '$row[cavatar]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } mysql_query("INSERT INTO notifications (userid, username, nuser, message, address, date, time) VALUES ('$row[id]','$row[name]','$content[postedid]','$row[name] has commented on your Blog','http://www.sentuamessage.com/blog.php?who=$who','$today', '$time')") or die(mysql_error()); mysql_query("UPDATE userdb SET comments='$sumcomments', score='$sumscore' WHERE username='$_SESSION[username]'") or die(mysql_error()); echo "<p align=center>Your comment has been submitted. You should be redirected back to your page in a few seconds</p> <p align=center>If you have not returned to your page <a href=http://www.sentuamessage.com/blog.php?who=$content[id]>Click Here</a>"; echo "<meta http-equiv=refresh content=2;URL=http://www.sentuamessage.com/blog.php?who=$content[id] />"; mysqli_close($con); } } $_SESSION['posttimer'] = time(); } include("bottom.php"); exit; }I am rattling my brain here. I had added a code into my script to get rid of double posts, it has a timer which stops people double posting within 10 seconds. Though since inserting the code you have an error where you will have to double post the same post because instead of inserting the post content into the database the submit button comes back with a blank result. Why is this happening? (blank result instead of saying "post successfully posted etc." or "post not posted" it just comes up blank with no entry going into the database. This results in you having to re type your comment and re submit it hoping second time lucky) This is my code once the submit has been hit. here is the basic script . i use this script for edit html or text file. <?php $action=$_POST['action']; $textarea=$_POST['textarea']; if($_GET['p']){ $page=$_GET['p']; } // Assume your text pages are called, p1.db or p2.db, etc. $url = "p".$page.".html"; if (file_exists($url)) { // do nothing } else { $url = "p0.txt"; } // where to go back to after the edit ... $return="page.php?p=$page"; // Get page $data = implode("", file($url)); if($action=="save"){ $newtext=stripslashes($textarea); $newtext = str_replace("<?", "", $newtext); $newtext = str_replace("?>", "", $newtext); $newtext = nl2br($newtext); //echo "page: $url<br><br>\n"; //echo $newtext; $fh = fopen($url, 'w') or die("can't open file"); fwrite($fh, $newtext); fclose($fh); header ("location: edit.php?p=$page"); } else{ echo" <html> <head><title>Simple Text Editor</title> <style> body,html{ margin:0px auto; width:700px; text-align:center; } #content{ margin:0px auto; width:700px; } #middle h1 { color: transparent; font-family:georgia; font-size:12pt; margin:0; color: #dF9100; padding:10px 0px 15px 0px; text-align:left; } </style> <body> <div id='content'> "; $ta=br2nl($data); echo" <a href='$return'><-- Return to Page</a><br /><br /> Make Changes and click \"Save Changes\" at the very bottom ...<br /> <form action='edit.php' method='post'> <input type='hidden' name='action' value='save'> <input type='hidden' name='p' value='$page'> <input type='hidden' name='n' value='$n'> <textarea name='textarea' rows='25' cols='80'>$ta</textarea> <br /> <input type='submit' name='submit' value='Save Changes'> </form> <div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'> </div> </div> </body> </html> "; } function br2nl($str) { return preg_replace('=<br */?>=i', "", $str); } ?> __________________ the script is running fine. but when i intregate tinymce with the script.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>abeer cms</title> <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> </head> <body> <?php $action=$_POST['action']; $textarea=$_POST['textarea']; if($_GET['p']){ $page=$_GET['p']; } // Assume your text pages are called, p1.db or p2.db, etc. $url = "p".$page.".html"; if (file_exists($url)) { // do nothing } else { $url = "p0.html"; } // where to go back to after the edit ... $return="edit.php?p=$edit"; // Get page $data = implode("", file($url)); if($action=="save"){ $newtext=stripslashes($textarea); $newtext = str_replace("<?", "", $newtext); $newtext = str_replace("?>", "", $newtext); $newtext = nl2br($newtext); //echo "page: $url<br><br>\n"; //echo $newtext; $fh = fopen($url, 'w') or die("can't open file"); fwrite($fh, $newtext); fclose($fh); header ("location: edit.php?p=$page"); } else{ echo" <html> <head><title>Simple Text Editor</title> <style> body,html{ margin:0px auto; width:700px; text-align:center; } #content{ margin:0px auto; width:700px; } #middle h1 { color: transparent; font-family:georgia; font-size:12pt; margin:0; color: #dF9100; padding:10px 0px 15px 0px; text-align:left; } </style> <body> <div id='content'> "; $ta=br2nl($data); echo" <a href='$return'><-- Return to Page</a><br /><br /> Make Changes and click \"Save Changes\" at the very bottom ...<br /> <form action='edit.php' method='post'> <input type='hidden' name='action' value='save'> <input type='hidden' name='p' value='$page'> <input type='hidden' name='n' value='$n'> <textarea name='textarea' rows='25' cols='80'>$ta</textarea> <br /> <input type='submit' name='submit' value='Save Changes'> </form> <div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'> </div> </div> </body> </html> "; } function br2nl($str) { return preg_replace('=<br */?>=i', "", $str); } ?> __________________ </body> </html> the script show error message after clicking the save button. the error message is Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\edit.php:6) in c:\wamp\www\edit.php on line 78 can any one help regarding this issue? Hi all, Im coding a simple script for my website which just changes the users rank. Code: [Select] <?php session_start(); include "../includes/db_connect.php"; include "../includes/functions.php"; logincheck(); ini_set ('display_errors', 1); error_reporting (E_ALL); $username=$_SESSION['username']; $get = mysql_query ("SELECT * FROM users WHERE username = '$username'"); $fetch = mysql_fetch_object($get); if ($fetch->userlevel >= "2"){ $newrank = $_POST['newrank']; $user1 = $_POST['user']; if (strip_tags($_POST['update'])){ mysql_query("UPDATE users SET `rank` = '$newrank' WHERE username='$user1'") or die (mysql_error()); echo ("You have updated $user1's rank to $newrank !"); } } else{ echo ("Your userlevel isnt high enouth to be here!"); } ?> <html> <head> <title>Change Rank</title> <link rel="stylesheet" href="../includes/in.css" type="text/css"> <style type="text/css"> .infobg { font-family: Arial; font-weight:normal; font-size:12px; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; background: URL(textbg1.png); font-weight:300; } .button { font-size: 12px; background:url(button.png); vertical-align: middle; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; border-left: 1px solid #000000; color: #FFFFCC; height:23px; font-weight:300; border-radius: 10px; padding-bottom:2px; } </style> </head> <body> <form action='' method='post' name='form1'> <table width='30%' cellpadding='0' align='center' cellspacing='0' border='1' bordercolor='#000000' bgcolor='#808080' style='border-collapse: collapse'> <tr> <td background='../header.jpg' colspan='2' align='center'>Change Rank</td> <tr> <td>Username:</td><td><input type='text' name='user'></td> </tr> <tr> <td>Rank:</td><td><input type='text' name='newrank'></td> </tr> <tr> <td> </td><td><input type="submit" name="update" value="Update Rank"></td> </tr> </form> </table> </body> </html> But there seems to be something wrong with that code, which I carnt see or work out. When I click Update submit button it does nothing, but can anyone see why it does nothing? Thanks. So I'm working on a website for an airline (not real) and on one of my pages you can request the cost of a flight by putting in the depart and arrival locations, like this: And if they put in a selection that isn't in the database they get this: The problem is that when they load the page initially, instead of just the selection bars and sumbit button showing up, it all does and i get an error like this: When you sumbit it, it all looks like it should, it's just that when they load it things seem to go wrong, any idea how i can fix this? Heres the code i use: Code: [Select] <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <p>Depart: <select name="depart"> <option selected="selected">Bristol</option> <option>Newcastle</option> <option>Manchester</option> <option>Dublin</option> <option>Glasgow</option> </select> Arrive: <select name="arrive"> <option>Bristol</option> <option selected="selected">Newcastle</option> <option>Manchester</option> <option>Dublin</option> <option>Glasgow</option> </select> <input type="submit" /> </p> </form> <?php $depart = $_POST['depart']; $arrive = $_POST['arrive']; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); $result = mysql_query("SELECT price FROM flights WHERE depart = '$depart' AND arrive = '$arrive'"); if ($row = mysql_fetch_assoc($result)) { echo 'This flight shall cost you £'; echo $row["price"]; } else include('includes/price.php'); ?> </div> My if-else statement doesn't seem to be doing it's job Thanks in advance Hey, so this is my register script
<?php error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', 1); require 'connect.php'; echo "<title> Register </title>"; if(isset($_POST['register'])) { $username = trim($_POST['username']); $username = mysqli_real_escape_string($con, $_POST['username']); $password = mysqli_real_escape_string($con, $_POST['password']); $password = hash('sha512', $_POST['password']); if(!$_POST['username'] OR !$_POST['password']) { die("You must enter a username and password!"); } $stmt = $con->prepare("INSERT INTO usrs_usr (username, password) VALUES (?, ?)"); $stmt->bind_param("ss", $username, $password); $stmt->get_result(); var_dump($stmt); $stmt->execute(); echo "New user has been created successfully"; $stmt->close(); $conn->close(); } ?>Now the problem is i have done a variable dump which outputs nothing, and the only error i am getting is Fatal error: Call to a member function bind_param() on a non-object I have a login script which is showing problem. The problem is that when my username and password are correct it directs to index.php page and displays the correct username there. But if the password is wrong it still directs to the same page instead of different(err-login.php) page,but this time no username is displayed. index.php: the password verifying code is as follows(the whole code of index.php is not mentioned since it is too long and a bit messy) <code> <?php $connection=mysql_connect("localhost","root",""); mysql_select_db("forum",$connection); $select=mysql_query("SELECT * FROM user_id WHERE uname='$_REQUEST[uname]'",$connection); $row=mysql_fetch_array($select); if($row['password']==$_REQUEST['password']){ session_start(); $_SESSION['name']=$_REQUEST['uname']; } else{ header("Location:err-login.php"); } ?> </code> NOTE:-The name of my db and table are correct. I have referred to username as uname. So, I'm trying to make a script that will send emails from apparently anyone. Code: [Select] <?php $email = $_REQUEST['email'] $target = $_REQUEST['target'] $message = $_REQUEST['message'] $subject = $_REQUEST['subject'] mail( $target, $subject, $message, "From: $email" ); echo "Mail sent." ; ?> Here's the HTML, if it matters. Code: [Select] <html> <head> <title>EMAIL SPOOFER</title> </head> <body> <p>This program can make emails appear as if they came from any email address, real or fake!</p> <form method="post" action="mailspoof.php"> Apparent sender: <input name="email" type="text" /><br /> Subject: <input name="subject" type="text" /><br /> Recipient: <input name="target" type="text" /><br /> Message:<br /> <textarea name="message" rows="15" cols="40"> </textarea><br /> <input type="submit" /> </form> </body> </html> Here's the error I'm getting from my webhost: Parse error: syntax error, unexpected T_VARIABLE in /home/a5938041/public_html/mailspoof.php on line 3 If I know me, it's probably the most stupid mistake in the universe, so please point it out. ::) I'm having trouble with my script. I'm getting pictures from the database and showing it in 3 columns and putting some information in each table location with the picture. But I made a change and now the table still works but I get a full blank page and have to scroll down to see the pictures. Can anybody see where my problem exists, it was working fine but now it doesn't. Any help would be appreciated. Thanks in advance. Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <title></title> <head> <link rel="stylesheet" href="./stylesheet/stylesheet1.css" media="screen"> <style type="text/css" media="screen">@import url("./stylesheet/stylesheet2.css");</style> </head> <body> <center><table cellspacing="5" cellpadding="5" width="800" border="1"> <?php include "connect.php"; $query = "SELECT * FROM promo_vet ORDER BY year"; $result = mysql_query($query) or die("There was a problem with the SQL query: " . mysql_error()); if($result && mysql_num_rows($result) > 0) { $i = 0; $max_columns = 3; while($row = mysql_fetch_array($result)) { // make the variables easy to deal with extract($row); // open row if counter is zero if($i == 0) echo "<tr>"; // make sure we have a valid product ALIGN='CENTER' if($year != "" && $year != null) echo "<td align='center'><a><img src=\"$picture\"></a><br>$testshot<FONT COLOR='red'><b>$year</b></FONT><br>$description <br> $boxno<br>$convertible<br>$coupe </td><BR>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i < $max_columns) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; } ?> </tr> </table></center> </body> </html> Hello guys i want your help in adfly clone script , i have it installed it but i have problem - shrinking links not working on main page, but working good when user logged in all server Requirements are ok my website: adglo.be script: mediafire vt: virustotal regards, Edited by ForexSon, 09 August 2014 - 06:49 PM. Hello, I'm trying to create a simple php blog thing, and I can't get the commenting to work.. blog.php?id=2 On that page, there is a form what is used to comment, it goes to send.php That php has this query in it: $yhteys = mysql_connect('10.5.49.32', '09A_user', 'pass'); mysql_select_db('09A_Jere', $yhteys); mysql_query("INSERT INTO `Blog_kommentit` (`kayttajat` , `kommentti` , `kirjid` ) VALUES ('$kayttajat', '$kommentti', '$id')") or die(mysql_error())$sql = "SELECT * FROM Blog_kommentit WHERE kirjid='$id' ORDER BY id";; mysql_close($yhteys); header('Location: ' . $_SERVER['HTTP_REFERER']); How can I make the $id to be previous pages id (2)? This shouldn't be anything hard and I'm kinda amazed why I am stuck in this, any help will be appreciated. If I just put $id I get this error: Code: [Select] Cannot add or update a child row: a foreign key constraint fails (`09A_Jere/Blog_kommentit`, CONSTRAINT `kommentti_kirjoitus` FOREIGN KEY (`kirjid`) REFERENCES `Blog_kirjoitukset` (`id`))Here is how my database works: (Kayttajat = username, kommentti = comment) Hi there, I have a simple login script written but I get an error with it. It does work but shows an error on some pages. Let me explain. Three Files: Admin.php Login.html checklogin.php When the user has logged in they go to checklogin.php. If the username and password match 1 row in the database then it forwards the user to admin.php fine. Except I keep getting mysql warning messages: Warning: Cannot modify header information - headers already sent by (output started at /home/wormste1/public_html/tilburywebdesign/shop/templates/template1/admin/updatescompanyinformation.php:3) in /home/wormste1/public_html/tilburywebdesign/shop/templates/template1/admin/companyinfoupdated.php on line 3 At the start of each page I want password protected I put the following code: <? session_start(); if(!session_is_registered(myusername)){ header("location:login.html"); } ?> I can't work out why I am getting this error. Many Thanks, Ian This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=331047.0 where is the problem? http://pastebin.com/Smw92nd5 I'm looking for the folder where the uploaded file should be but it doesn't exist, it seems that the condition "if($ext == $need)" is ignored Hello, I am relatively new to PHP/MySQL (two months) and this is my first post in the forum. I am trying to implement an 'add to cart' script from http://v3.thewatchmakerproject.com/journal/276/. The demo works fine but when i implement it on my site i get this warning: "Assigning the return value of new by reference is deprecated" from what i assume is this Function below: Can anyone help me? Also, i'm aware that using global is not the done thing anymore, so could somebody explain to me what i should do instead of global. Thanks in advance, Code: [Select] function showCart() { global $db; $cart = $_SESSION['cart']; if ($cart) { $items = explode(',',$cart); $contents = array(); foreach ($items as $item) { $contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1; } $output[] = '<form action="cart.php?action=update" method="post" id="cart">'; $output[] = '<table>'; foreach ($contents as $id=>$qty) { $sql = 'SELECT * FROM collection WHERE dress_id = '.$id; $result = $db->query($sql); $row = $result->fetch(); extract($row); $output[] = '<tr>'; $output[] = '<td><a href="cart.php?action=delete&id='.$id.'" class="r">Remove</a></td>'; $output[] = '<td>'.$title.' by '.$author.'</td>'; $output[] = '<td>£'.$price.'</td>'; $output[] = '<td><input type="text" name="qty'.$id.'" value="'.$qty.'" size="3" maxlength="3" /></td>'; $output[] = '<td>£'.($price * $qty).'</td>'; $total += $price * $qty; $output[] = '</tr>'; } $output[] = '</table>'; $output[] = '<p>Grand total: <strong>£'.$total.'</strong></p>'; $output[] = '<div><button type="submit">Update cart</button></div>'; $output[] = '</form>'; } else { $output[] = '<p>You shopping cart is empty.</p>'; } return join('',$output); } Parse error: syntax error, unexpected $end in C:\xampp\htdocs\register_process.php on line 97 Here is the script hope fully someone can help me i attached the script too Code: [Select] <?php include 'includes/database.php'; if(isset($_POST['submit'])) { $username = addslashes(trim($_POST['username'])); $email = addslashes(trim($_POST['email'])); $pass = addslashes(trim($_POST['password'])); $conf = addslashes(trim($_POST['confirm'])); $ip = $_SERVER['REMOTE_ADDR']; $date = date("d, m y"); if ( $_POST['password'] == $_POST['confirm'] ) {}else{ echo '<script>alert("Your passwords were not the same, please enter the same password in each field.");</script>'; echo '<script>history.back(1);</script>'; exit; } $password = md5($pass); if ((((( empty($first) ) || ( empty($surname) ) || ( empty($username) ) || ( empty($email) ) || ( empty($password) ))))) { echo '<script>alert("One or more fields was left empty, please try again.");</script>'; echo '<script>history.back(1);</script>'; exit; } if((!strstr($email , "@")) || (!strstr($email , "."))) { echo '<script>alert("The email you have entred is an invalid email address.")';</script>; echo '<script>history.back(1);</script>'; exit; } $actkey = mt_rand(1, 500).'f78dj899dd'; $act = sha1($actkey); $query = mysql_query("INSERT INTO Users (Username, Password, Email, Date, IP, Actkey) VALUES ('$username','$email','$date','@ip','$act')") or die(mysql_error()); $send = mail($email , "Registration Confirmation","Thank you for registrering with EthicGamer.com\n\nYour username and password is below, along with details on how to activate your account.n\nUser:".$username."\nPass:".$pass."\n\nClick the link below to activate your account:\nhttp://ethicgamers.com/activate.php?id=".$act."\n\nPlease do not reply, this is an automated mailer.\n\nThanks","FROM: activate@ethicgamers.com"); if(($query)&&($send)) { echo ' <html> <head> </head> <body> <div> <p>Thank you for registering, you will recieve an email soon with your login details and your activation link so that you can activate your account.</p> <p><a href="login.php">Click here</a> to login once you have activated.</p> </div> </body> </html> '; } else { echo ' <html> <body> <div> <p>We are sorry, there appears to be a problem with our script at the moment.</p> <p>Your data was not lost. Username: '.$username.' | Password: '.$pass.' | Email: '.$email.'</p> <p>Please try again later.</p> </div> </body> </html> '; } } else { echo "You have to fill out the form first!"; } ?> Hi all! Yet again I have a problem. I really couldn't find what the heck's wrong with this thing. It's extremely simple and still... I'm trying to put a php script in my website to monitor the status of my FTP and HFS servers. Help? <TITLE>Server Status</TITLE> <?php $data .= " </div> <center> <div style=\"border-bottom:1px #999999 solid;width:480;\"><b> <font size='1' color='#3896CC'>Server Status</font></b> </div> </center> <br>"; //configure script $timeout = "1"; //set service checks $port[1] = "80"; $service[1] = "Apache"; $ip[1] = "localhost"; $icon[1] = "habbo.jpg"; $alt[1] = "Apache"; $port[2] = "8080"; $service[2] = "HFS Server"; $ip[2] = "localhost"; $icon[2] = "web.png"; $alt[2] = "HFS Server"; $port[3] = "21"; $service[3] = "FTP Server"; $ip[3] = "localhost"; $icon[3] = "web.png"; $alt[3] = "FTP Server"; // // NO NEED TO EDIT BEYOND HERE // UNLESS YOU WISH TO CHANGE STYLE OF RESULTS // //count arrays $ports = count($port); $ports = $ports + 1; $count = 1; //beggin table for status $data .= "<table width='480' border='1' cellspacing='0' cellpadding='3' style='border-collapse:none' bordercolor='#CCCCCC' align='center'>"; while($count < $ports){ if($ip[$count]==""){ $ip[$count] = "localhost"; } $fp = @fsockopen("$ip[$count]", $port[$count], $errno, $errstr, $timeout); if (!$fp) { $data .= "<tr><td width='18' align='center'><img src='http://127.0.0.1/stat/$icon[$count]' title='$alt[$count]' alt='$alt[$count]'></td><td>$service[$count]</td><td width='18' align='center'><img src='http://127.0.0.1/stat/off.png'></td></tr>"; } else { $data .= "<tr><td width='18' align='center'><img src='http://127.0.0.1/stat/$icon[$count]' title='$alt[$count]' alt='$alt[$count]'></td><td>$service[$count]</td><td width='18' align='center'><img src='http://127.0.0.1/stat/on.png'></td></tr>"; fclose($fp); } $count++; } //close table $data .= "</table><div>"; echo $data; ?> The output of this is... Quote Parse error: syntax error, unexpected T_VARIABLE in D:\Program Files\xampp\xampp\htdocs\stat\server.php on line 18 Also, does somebody have a link or something to a tutorial/pre-made script (although I'd like to follow instructions about it) about server statistics? I want to have data on how much a certain partition on the server has free or full. Thank you in advance. Parse error: syntax error, unexpected $end in C:\xampp\htdocs\register_process.php on line 97 Here is the script hope fully someone can help me i attached the script too Shud not be a hard job Code: [Select] <?php include 'includes/database.php'; if(isset($_POST['submit'])) { $username = addslashes(trim($_POST['username'])); $email = addslashes(trim($_POST['email'])); $pass = addslashes(trim($_POST['password'])); $conf = addslashes(trim($_POST['confirm'])); $ip = $_SERVER['REMOTE_ADDR']; $date = date("d, m y"); if ( $_POST['password'] == $_POST['confirm'] ) {}else{ echo '<script>alert("Your passwords were not the same, please enter the same password in each field.");</script>'; echo '<script>history.back(1);</script>'; exit; } $password = md5($pass); if ((((( empty($first) ) || ( empty($surname) ) || ( empty($username) ) || ( empty($email) ) || ( empty($password) ))))) { echo '<script>alert("One or more fields was left empty, please try again.");</script>'; echo '<script>history.back(1);</script>'; exit; } if((!strstr($email , "@")) || (!strstr($email , "."))) { echo '<script>alert("The email you have entred is an invalid email address.")';</script>; echo '<script>history.back(1);</script>'; exit; } $actkey = mt_rand(1, 500).'f78dj899dd'; $act = sha1($actkey); $query = mysql_query("INSERT INTO Users (Username, Password, Email, Date, IP, Actkey) VALUES ('$username','$email','$date','@ip','$act')") or die(mysql_error()); $send = mail($email , "Registration Confirmation","Thank you for registrering with EthicGamer.com\n\nYour username and password is below, along with details on how to activate your account.n\nUser:".$username."\nPass:".$pass."\n\nClick the link below to activate your account:\nhttp://ethicgamers.com/activate.php?id=".$act."\n\nPlease do not reply, this is an automated mailer.\n\nThanks","FROM: activate@ethicgamers.com"); if(($query)&&($send)) { echo ' <html> <head> </head> <body> <div> <p>Thank you for registering, you will recieve an email soon with your login details and your activation link so that you can activate your account.</p> <p><a href="login.php">Click here</a> to login once you have activated.</p> </div> </body> </html> '; } else { echo ' <html> <body> <div> <p>We are sorry, there appears to be a problem with our script at the moment.</p> <p>Your data was not lost. Username: '.$username.' | Password: '.$pass.' | Email: '.$email.'</p> <p>Please try again later.</p> </div> </body> </html> '; } } else { ?> |