<?php
set_time_limit(5000);
ob_start();
session_start();
include('connection_config.php');
?>
<!DOCTYPE html>
<html>
<title>mi Adda Portal</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="sidenav.js"></script>
<link rel="stylesheet" href="headings.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Rancho&effect=shadow-multiple">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="w3-white w3-content" style="max-width:1600px">
<header>
<div class="w3-container w3-red w3-center">
<a href="home.php" style="text-decoration:none;"><h2 style="text-align:left; float:center;font-family:Times New Roman;">WAP Portal</h2>
</div>
</header>
<!-- !PAGE CONTENT! -->
<body>
<div class="bgimage">
<div class="w3-main bgimage" style="margin:auto;text-align:center">
<h4 class="w3-Rancho font-effect-shadow-multiple" style="text-align:center;margin: auto; padding-top:auto;">Fashion Wallpapers</h4>
<hr style="display: block; margin:0.5em 0.5em auto auto; border-style: inset;border-width: 1px;"><br>
<div>
<table width="100%" align="center" cellpadding="15" cellspacing="20">
<tr>
<td align="center" valign="middle">
<a href="">
<img style="border: 2px solid;border-radius: 5px; border-color:black;" src="./WAPContent/fashion/fashionwallpapers/500x500/kkf_in_fng004.gif" height="135" width="135">
</a>
</td>
<td align="center" valign="middle">
<a href="#">
<img style="border: 2px solid;border-radius: 5px; border-color:black;" src="./WAPContent/fashion/fashionwallpapers/500x500/kk_in_fng002.gif" height="135" width="135">
</a></td>
<tr>
<td align="center" valign="middle">
<a href="#">
<img style="border: 2px solid;border-radius: 5px; border-color:black;" src="./WAPContent/fashion/fashionwallpapers/500x500/ss_in_fng015.gif" height="135" width="135">
</a>
</td>
<td align="center" valign="middle">
<a href="#">
<img style="border: 2px solid;border-radius: 5px; border-color:black;" src="./WAPContent/fashion/fashionwallpapers/500x500/uk_in_fng001.gif" height="135" width="135">
</a></td>
<tr>
<td align="center" valign="middle">
<a href="#">
<img style="border: 2px solid;border-radius: 5px; border-color:black;" src="./WAPContent/fashion/fashionwallpapers/500x500/uk_in_fng003.gif" height="135" width="135">
</a>
</td>
<td align="center" valign="middle">
<a href="#">
<img style="border: 2px solid;border-radius: 5px; border-color:black;" src="./WAPContent/fashion/fashionwallpapers/500x500/uk_in_fng005.gif" height="135" width="135">
</a>
</td>
</tr>
</table>
</div>
<br/>
<?php
$connect_error = 'Sorry, we\'re experiencing connection issues.';
$con=mysqli_connect("localhost", "root", "12345","miadda") or die("Can not connect to database: ".mysql_error());
mysqli_select_db($con,"miadda") or die("Can not select the database: ".mysql_error());
$sql = "select * from miadda";
// the result of the query
$result = mysqli_query($con,$sql) or die("Invalid query: " .mysqli_error($connect_error));
// Header for the image
while ($row = mysqli_fetch_array($result))
{
//$image=$row ['CONTENT_PATH'];
echo '<img src="/WAPContent/fashion/fashionwallpapers/500x500/'.$row['CONTENT_PATH'].'" width="100" height="100">';
}
?>
</div>
<!-- Pagination -->
<div class="w3-center w3-padding-32">
<div class="w3-bar">
1
2
3
</div>
</div>
<!--end of pagination-->
<style>
.w3-bar a.active
{
background-color: #4CAF50;
color: white;
}
..w3-bar a:hover:not(.active) {
background-color: #ddd;
}
.bgimage {
background-attachment: fixed;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
/* First image (Logo. Full height) */
.bgimage {
background-image: url('bg.jpg');
min-height: 100%;
opacity:1;
}
</style>
</body>
<!--Footer-->
<footer>
<div class="w3-red w3-center" style="margin-bottom:-15px;margin-top:15px;padding-top:8px;padding-bottom:8px;">
| Home |
</div>
</footer>
</div>
<!-- End page content -->
</html>
<?php
ob_flush();
?>
Can someone please help me where am I going wrong in this part of code:
<?php
$connect_error = 'Sorry, we\'re experiencing connection issues.';
$con=mysqli_connect("localhost", "root", "12345","miadda") or die("Can not connect to database: ".mysql_error());
mysqli_select_db($con,"miadda") or die("Can not select the database: ".mysql_error());
$sql = "select * from miadda";
// the result of the query
$result = mysqli_query($con,$sql) or die("Invalid query: " .mysqli_error($connect_error));
// Header for the image
while ($row = mysqli_fetch_array($result))
{
//$image=$row ['CONTENT_PATH'];
echo '<img src="/WAPContent/fashion/fashionwallpapers/500x500/'.$row['CONTENT_PATH'].'" width="100" height="100">';
}
?>
upon running the web portal, It doesn't show any error. But images are not displayed. Image border displays for all images, but displays like unavailable or broken image.
Here's the screenshot of how it displays:
enter image description here
Images are should be retrieved from image path provided in database:
"/WAPContent/fashion/fashionwallpapers/" under column CONTENT_PATH
and the full path is: /WAPContent/fashion/fashionwallpapers/500x500/
attached is the screenshot of MySQL table from which I am working on fashion category:
fashion category
Please help me out...Thanks in advance.
The content path in the database is really that: the content path. The image name is in the field content_name.
<?php
$connect_error = 'Sorry, we\'re experiencing connection issues.';
$con=mysqli_connect("localhost", "root", "12345","miadda") or die("Can not connect to database: ".mysql_error());
mysqli_select_db($con,"miadda") or die("Can not select the database: ".mysql_error());
$sql = "select * from miadda where CONTENT_PATH<>'NA'";
// the result of the query
$result = mysqli_query($con,$sql) or die("Invalid query: " .mysqli_error($connect_error));
// Header for the image
while ($row = mysqli_fetch_array($result))
{
$image=$row ['CONTENT_PATH'].$row['CONTENT_NAME'];
//use a relative path
if(0 === strpos($image,"/")) $image = substr($image, 1);
$image = mb_substr($image, 0, mb_strlen($image)-2) + "/";
echo '<img src="'.$image.'" width="100" height="100">';
}
?>
Related
I have a table with horizontal scrolling, but I dont like the scrollbar, so I want to change it to a dot.
I tried using flickity but I have some problems.
Code:
<head>
<script src="https://unpkg.com/flickity#2/dist/flickity.pkgd.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/flickity#2/dist/flickity.min.css">
<link rel="stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<style>
.scrollme {
overflow-x: auto;
}
::-webkit-scrollbar {
width: 2px;
height:5px;
}
}
</style>
<div class="container" >
<?php
require 'db.php';
$sql = "SELECT * FROM clelist order by clelist_id DESC";
$result = mysqli_query($db, $sql );
echo "<div class='carousel scrollme' style='' data-flickity="" data-js='carousel'>
<table class='table table-bordered text-center table-responsive '>
<tr class='table-active '>
<th class='text-center align-middle carousel-cell' style=' white-space:nowrap;' > num </th>
<th class='text-center align-middle carousel-cell 'style=' white-space:nowrap;' > car_num</th>
<!--more.....-->
</tr>";
while ($row = mysqli_fetch_array($result)) {
$tmp=explode(":",$row['cle_date']);
echo '
<tbody id="searchTable">
<tr>
<td class="text-center align-middle carousel-cell" >
'.$row["DlistNO"].'<br>'.$row["cle_no"].'
</td>
<td class="text-center align-middle carousel-cell" >
'.$row["cle_date"].'<br>
'.$row["c_cle_car_no_head"].'<br>
'.$row["c_cle_car_no_tail"].'
</td>
<!--more.....-->
';
?>
<tr>
<?php
}
?></tbody>
</table></div>
</div>
</body>
</html>
Output:
Does this answer your question: https://tympanus.net/codrops/2014/01/21/dot-navigation-styles/
Also, you can check out different types of scroll dots here
I don't know how to modify the following code to make it upload multiple files by selecting once. By the following code I am able to upload one file at a time. Just wish to modify it as through this code not only I am uploading the file but also showing all the files uploaded, on the same page for download and delete.
<html>
<title>Brief upload</title>
<link href="globe.png" rel="shortcut icon">
<?php
date_default_timezone_set("Asia/Calcutta");
//echo date_default_timezone_get();
?>
<?php
$conn=new PDO('mysql:host=localhost; dbname=deu', 'root', '') or die(mysql_error());
if(isset($_POST['submit'])!=""){
$name=$_FILES['photo']['name'];
$size=$_FILES['photo']['size'];
$type=$_FILES['photo']['type'];
$temp=$_FILES['photo']['tmp_name'];
$date = date('Y-m-d H:i:s');
$caption1=$_POST['caption'];
$link=$_POST['link'];
move_uploaded_file($temp,"files/".$name);
$query=$conn->query("INSERT INTO upload (name,date) VALUES ('$name','$date')");
if($query){
header("location:index.php");
}
else{
die(mysql_error());
}
}
?>
<html>
<body>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="screen">
<link rel="stylesheet" type="text/css" href="css/DT_bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css"/>
</head>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="js/DT_bootstrap.js"></script>
<?php include('dbcon.php'); ?>
<style>
.table tr th{
border:#eee 1px solid;
position:relative;
#font-family:"Times New Roman", Times, serif;
font-size:12px;
text-transform:uppercase;
}
table tr td{
border:#eee 1px solid;
color:#000;
position:relative;
#font-family:"Times New Roman", Times, serif;
font-size:12px;
text-transform:uppercase;
}
#wb_Form1
{
background-color: #00BFFF;
border: 0px #000 solid;
}
#photo
{
border: 1px #A9A9A9 solid;
background-color: #00BFFF;
color: #fff;
font-family:Arial;
font-size: 20px;
}
</style>
<div class="alert alert-info">
Brief Uploading System
</div>
<table cellpadding="0" cellspacing="0" border="0" class="table table-bordered">
<tr><td><form enctype="multipart/form-data" action="" id="wb_Form1" name="form" method="post">
<!--<input type="file" name="photo[]" id="photo" multiple>-->
<input type="file" name="photo" id="photo" required="required"></td>
<td><input type="submit" class="btn btn-danger" value="SUBMIT" name="submit">
</form> <strong>SUBMIT HERE</strong></tr></td></table>
<div class="col-md-18">
<div class="container-fluid" style="margin-top:0px;">
<div class = "row">
<div class="panel panel-default">
<div class="panel-body">
<div class="table-responsive">
<form method="post" action="delete.php" >
<table cellpadding="0" cellspacing="0" border="0" class="table table-condensed" id="example">
<thead>
<tr>
<th>ID</th>
<th>FILE NAME</th>
<th>Date</th>
<th>Download</th>
<th>Remove</th>
</tr>
</thead>
<tbody>
<?php
$query=mysql_query("select * from upload ORDER BY id DESC")or die(mysql_error());
while($row=mysql_fetch_array($query)){
$id=$row['id'];
$name=$row['name'];
$date=$row['date'];
?>
<tr>
<td><?php echo $row['id'] ?></td>
<td><?php echo $row['name'] ?></td>
<td><?php echo $row['date'] ?></td>
<td>
<span class="glyphicon glyphicon-paperclip" style="font-size:20px; color:blue"></span></td>
<td>
<span class="glyphicon glyphicon-trash" style="font-size:20px; color:red"></span>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
You can upload multiple files in this way
Input field must be defined as an array i.e. images[]
It should be defined as multiple="multiple"
<input name="images[]" type="file" multiple="multiple" />
// Count # of uploaded files in array
$total = count($_FILES['images']['name']);
// Loop through each file
for( $i=0 ; $i < $total ; $i++ ) {
//Get the temp file path
$tmpFilePath = $_FILES['images']['tmp_name'][$i];
//Make sure we have a file path
if ($tmpFilePath != ""){
//Setup our new file path
$newFilePath = "./uploadFiles/" . $_FILES['images']['name'][$i];
//Upload the file into the temp dir
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
//Handle other code here
}
}
}
For more details PHP Multiple Upload
i'm trying to put my php code that connects to my MySQL database directly in my HTML page, but something goes wrong when i try to see the page.. how can i solve the error "Fatal error: Maximum execution time of 30 seconds exceeded in /membri/bestparty/IOS/IOS/eventi.php on line 41"
if i try to remove one variable for example $festa[$i] the error persists.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
<meta http-equiv="cleartype" content="on">
<link rel="stylesheet" type="text/css" href="css/stile.css">
<meta name="viewport" content="width=320, initial-scale=0.7, user-scalable=no">
<script src="JS/jquery-1.11.1.js.js"></script> <!--PER EVENTI-->
<script src="JS/func.js"></script> <!--PER EVENTI-->
<title>BParty</title>
</head>
<body>
<?
$DBhost = "localhost";
$DBuser = "bestparty";
$DBpass = "";
$DBName = "my_bestparty";
$table = "Dati";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Impossibile collegarsi al server");
#mysql_select_db("$DBName") or die("Impossibile connettersi al database $DBName");
$sqlquery = "SELECT * FROM `Dati` ORDER BY Data DESC";
$result = mysql_query($sqlquery);
$number = mysql_num_rows($result);
$i = 0;
while ($i < 20) {
$festa[$i] = mysql_result($result,$i,"festa");
$luogo[$i] = mysql_result($result,$i,"luogo");
$idfesta[$i] = mysql_result($result,$i,"ID");
$data[$i] = mysql_result($result,$i,"data");
$foto[$i] = mysql_result($result,$i,"organizzatore");
}
?>
<div id="navigation">
<table width="100%">
<tr valign="middle">
<td valign="middle" width="25%" align="center">
<
</td>
<td valign="middle" width="50%" align="center">
BPARTY
</td>
<td width="25%" align="center">
>
</td>
</tr>
</table>
</div>
<div id="evntprg">
EVENTI IN PROGRAMMA
</div>
<div id="container" style="overflow:scroll;">
<? echo'
<!--INIZIO DIV EVENTO-->
<a href="http://www.bparty.org/IOS/IOS/pagevento.php?var=$idfesta[$i]">
<div style="width:90%; display:block; margin:0 auto;
padding-top:10px; margin-top:10px; padding-left:10px;
background-color:#FFF; padding-bottom:10px;
border-left:solid 8px #4D7C4F;">
<table width="100%" style=\'table-layout:fixed\'>
<tr valign="middle">
<td valign="middle" align="center" class="evntfoto"
style="background-image:url($foto[$i]);
background-position:center;
background-size: cover;">
</td>
<td valign="top" align="left" id="evnttxt">
<font color="#0066FF" size="+1"> <b> $festa[$i] </b></font> <br>
echo "$data[$i]" <br>
<font color="#585858"> $luogo[$i] </font> <br>
</td>
</tr>
</table>
</div></a>
<!--FINE DIV EVENTO-->
';
?>
</div>
</div>
</body>
</html>
--EDIT--
Ok, i solved this, but now..
why the html page shows me the variable as "$festa[$i]"
and not for example "Lorem ipsum" ?
<?
$DBhost = "localhost";
$DBuser = "bestparty";
$DBpass = "";
$DBName = "my_bestparty";
$table = "Database";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Impossibile collegarsi al server");
#mysql_select_db("$DBName") or die("Impossibile connettersi al database $DBName");
$sqlquery = "SELECT * FROM `Database` ORDER BY data DESC";
$result = mysql_query($sqlquery);
$number = mysql_num_rows($result);
$i = 0;
while ($i < 20) {
$festa[$i] = mysql_result($result,$i,"festa");
$luogo[$i] = mysql_result($result,$i,"luogo");
$idfesta[$i] = mysql_result($result,$i,"ID");
$data[$i] = mysql_result($result,$i,"data");
$linkfoto[$i] = mysql_result($result,$i,"organizzatore");
echo'
<!--INIZIO DIV EVENTO-->
<a href="http://www.bparty.org/IOS/IOS/pagevento.php?var=$idfesta[$i]">
<div style="width:90%; display:block; margin:0 auto;
padding-top:10px; margin-top:10px; padding-left:10px;
background-color:#FFF; padding-bottom:10px;
border-left:solid 8px #4D7C4F;">
<table width="100%" style=\'table-layout:fixed\'>
<tr valign="middle">
<td valign="middle" align="center" class="evntfoto"
style="background-image:url($foto[$i]);
background-position:center;
background-size: cover;">
</td>
<td valign="top" align="left" id="evnttxt">
<font color="#0066FF" size="+1"> <b> $festa[$i] </b></font> <br>
echo "$data[$i]" <br>
<font color="#585858"> $luogo[$i] </font> <br>
</td>
</tr>
</table>
</div>
</a>
<!--FINE DIV EVENTO-->
';
$i++;
}
You are not incrementing $i inside your loop. Consider using a for loop instead. See also the PHP documentation on for loops.
Ok, i solved this, but now.. why the html page shows me the variable as "$festa[$i]" and not for example "Lorem ipsum" ?
You should use double quotes instead of single if you want a variable in the string to get printed. But in your case you'd have to escape all double quotes in your string this way \". The better way is instead of doing that, just to concatenate the string like this:
echo '...<b>' . $festa[$i] . '</b>...';
Do that with all variables you're echoing.
I am trying to connect with social web sites like facebook,twitter,linkedin etc using Hybridauth
This is what I do to connect with social web sites. I am new to PHP just started to learn and doing this.
index.php
<?php
# start a new PHP session
session_start();
// we need to know it
$CURRENT_URL = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
// print "CURRENT_URL $CURRENT_URL";
// change the following paths if necessary
$config = dirname(__FILE__) . '/hybridauth/config.php';
require_once( "hybridauth/Hybrid/Auth.php" );
try{
$hybridauth = new Hybrid_Auth( $config );
}
catch( Exception $e ){
echo "Ooophs, we got an error: " . $e->getMessage();
}
$provider = "";
// handle logout request
if( isset( $_GET["logout"] ) ){
$provider = $_GET["logout"];
$adapter = $hybridauth->getAdapter( $provider );
$adapter->logout();
header( "Location: index.php" );
die();
}
// if the user select a provider and authenticate with it
// then the widget will return this provider name in "connected_with" argument
elseif( isset( $_GET["connected_with"] ) && $hybridauth->isConnectedWith( $_GET["connected_with"] ) ){
$provider = $_GET["connected_with"];
$adapter = $hybridauth->getAdapter( $provider );
$user_data = $adapter->getUserProfile();
// include authenticated user view
include "authenticated_user.php";
die();
} // if user connected to the selected provider
// if not, include unauthenticated user view
include "unauthenticated_user.php";
authenticated_user.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
<head>
<style type="text/css" media="screen">
<!--
BODY {
margin: 10px;
padding: 0;
}
H1 {
margin-bottom: 2px;
font-family: Garamond, "Times New Roman", Times, Serif;
}
FIELDSET {
border: 1px solid #ccc;
padding: 1em;
margin: 0;
}
LEGEND {
color: #666666;
}
-->
</style>
</head>
<body>
<br /><br />
<center>
<h1>Welcome <?php echo $user_data->displayName; ?></h1>
<br />
<br />
<table width="600" border="0" cellpadding="2" cellspacing="2">
<tr>
<td valign="top"><fieldset>
<legend>Connected user badge</legend>
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="100" rowspan="5">
<?php
if( $user_data->photoURL ){
?>
<img src="<?php echo $user_data->photoURL; ?>" title="<?php echo $user_data->displayName; ?>" border="0" width="100" height="120">
<?php
}
else{
?>
<img src="avatar.png" title="<?php echo $user_data->displayName; ?>" border="0" >
<?php
}
?>
</td>
<td width="60" nowrap><div align="right"><strong>Provider</strong></div></td>
<td align="left" ><?php echo $adapter->id; ?></td>
</tr>
<tr>
<td nowrap><div align="right"><strong>Identifier</strong></div></td>
<td align="left"><?php echo $user_data->identifier; ?></td>
</tr>
<tr>
<td nowrap><div align="right"><strong>Dispaly name</strong></div></td>
<td align="left"><?php echo $user_data->displayName; ?></td>
</tr>
<tr>
<td nowrap><div align="right"><strong>Email</strong></div></td>
<td align="left"><?php
if( $user_data->email ){
echo $user_data->email ;
}
else{
echo "not provided by " . $adapter->id ;
}
?></td>
</tr>
<tr>
<td nowrap valign="top"><div align="right"><strong>Profile URL</strong></div></td>
<td align="left" valign="top"><?php echo $user_data->profileURL; ?></td>
</tr>
<tr>
<td align="right"><strong>Update Status</strong></td>
<td align="center"><input name="updatestatus" id="updatestatus" /></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr>
<td valign="top" align="right">
<img src="arrow.gif" align="texttop" style="margin-top:-5px;" >
Log me out
</td>
</tr>
</table>
</center>
</body>
</html>
unathenticated.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
<head>
<style type="text/css" media="screen">
<!--
BODY {
margin: 10px;
padding: 0;
}
H1 {
margin-bottom: 2px;
font-family: Garamond, "Times New Roman", Times, Serif;
}
FIELDSET {
border: 1px solid #ccc;
padding: 1em;
margin: 0;
}
LEGEND {
color: #666666;
}
INPUT {
display: block;
font-family: Arial, verdana;
padding: 7px;
border: 1px solid #999;
margin: 10px;
}
/* Gradient 2 */
.textbox{
background-image: url(images/bg.png);
border: 1px solid #6297BC;
width: 230px;
}
-->
</style>
</head>
<body>
<br /><br />
<center>
<h1>Social web sites integration</h1>
<br />
<br />
<table width="380" border="0" cellpadding="2" cellspacing="2">
<tr>
<td valign="top"><fieldset>
<legend>Sign-in form</legend>
<table width="00%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td><div align="right"><strong>login</strong></div></td>
<td><input type="text" name="textfield" id="textfield" class="textbox"/></td>
</tr>
<tr>
<td><div align="right"><strong>password</strong></div></td>
<td><input type="text" name="textfield2" id="textfield2" class="textbox"/></td>
</tr>
<tr>
<td> </td>
<td><div align="center">
<input type="submit" value="Sign-in" />
</div></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr>
<td valign="top" align="right">
<!--img src="arrow.gif" align="texttop" style="margin-top:-5px;" -->
<!-- CODE REQUIRED BY THE WIDGET -->
<link media="screen" rel="stylesheet" href="widget/css/colorbox.css" />
<script src="widget/js/jquery.min.js"></script>
<script src="widget/js/jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
$(".widget_link").colorbox({iframe:true, innerWidth:430, innerHeight:222});
});
</script>
<!-- /WIDGET -->
<!--
LINK TO THE WIDGET
return_to: call back this page after authenticatin the user
ts: nocache
-->
Or sign-in with Social web sites
</td>
</tr>
</table>
<br /><br /><br />
<!--b>Note:</b> This is just a proof of concept! it works good enough to try out on Firefox or on Chrome.-->
</center>
</body>
</html>
So please help me how to go about this?, Here I do display user information like first name and last name and picture url. I want to add another text box which will enable to update user status or post wall.
From the User Guide: Update User Status
This method exists:
$adapter->setUserStatus("");
Note From User Guide:
Currently only Facebook, Twitter, Identica, LinkedIn, QQ, Sina, Murmur, Pixnet and Plurk support this feature
You could create a form on authenticated_user.php and add a text field with ID "status_update". When it's submitted, you could check for it and run the setUserStatus method.
// if the user select a provider and authenticate with it
// then the widget will return this provider name in "connected_with" argument
elseif( isset( $_GET["connected_with"] ) && $hybridauth->isConnectedWith( $_GET["connected_with"] ) ){
$provider = $_GET["connected_with"];
$adapter = $hybridauth->getAdapter( $provider );
// *****************************************************
// NEW CODE TO UPDATE USER STATUS
if( isset( $_GET["status_update"] ) && !empty( $_GET["status_update"] ) ) {
$adapter->setUserStatus( $_GET["status_update"] );
}
$user_data = $adapter->getUserProfile();
// include authenticated user view
include "authenticated_user.php";
die();
} // if user connected to the selected provider
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.