you are making 2 calls to call.php
first has post variables:
xhr.send("amount=" + transferTotal + "&name=" + name);
second does not:
window.open('https://mydomain.com/con.php', '_blank');
you are making 2 calls to call.php
first has post variables:
xhr.send("amount=" + transferTotal + "&name=" + name);
second does not:
window.open('https://mydomain.com/con.php', '_blank');
$_SESSION gets set by session_start()
before that is empty
So:
<?php
session_start();
header("Content-Type: application/json");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Origin: null");
if (isset($_SESSION))
{
$_SESSION["time"] = time();
if (isset($_SESSION["time"])) echo json_encode("Session exists:" .$_SESSION["time"]);
}
else
{
echo json_encode("Session does not exist!");
}
remove the style="display:none;"
from
<ul id="playlist1" style="display:none;">
<?=$output?>
</ul>
if (isset($_POST['chkNumberck'])) $returnArray=$_POST['chkNumberck'];
else $chkNumberck= array();
$count=5;
echo"<form action='test.php' method='post'>";
for ($sub_id=0 ;$sub_id < $count;$sub_id+=1)
{
echo "<input type='checkbox' name='chkNumberck[]' value=$sub_id ";
if (in_array($sub_id,$chkNumberck)) echo"checked='checked'";>
}
echo "<input type='submit' /></form>";
also:
echo "<td><a id='more' href='http://www.niloofar3D.ir' onClick='return popup(this, \"mypopup\")'><button>»</button></a></td>";
according to the manual: operators precedence
it has an 'Undefined order of evaluation'
and may 'change between versions of PHP or depending on the surrounding code'
something is wrong at around line 228
if (isset($_POST['type'])) {
if ($_POST['type'] == "login")
}
change to
if (isset($_POST['type'])) {
if ($_POST['type'] == "login") {
// do something
// like displaying your login form
}
}
$id =$_POST['user_id'];
make sure your browser points to http://localhost/yourfile.php
and NOT file://c:/wamp/htdocs/yourfile.php
<?php
session_start();
must be the at the very top of youre script.
no html before it, not even a white-line;
for actual error message:
if just you run session1.php, $_POST will be empty.
test: var_dump($_POST);
the $_POST is filled bij the form only after you submit it
but action="session2.php"
will redect to session2.php
so in session2.php $_POST['text'] will have the value input in the form.
So no need for $_SESSION.
should it be :$mail->Port = 465; //port secure ssl email
if(!empty($stu_fname) &&
!empty($stu_lname) &&
!empty($stu_email) &&
!empty($stu_telp) &&
!empty($stu_skype) ) {
You never execute the update query
$s="UPDATE finance SET credit ='" . $r. "' WHERE payee = 'rw'";
$res = mysql_query($s) or die(mysql_error());
That just turns off any error message below E_PARSE level.
It doesnot solve the error.
works:
$keys = array('key1', 'key2', 'key3');
$value = 'some value';
$string='$md';
foreach($keys as $index => $key)
{
$string.="['$key']";
}
$string.= '=$value;';
eval($string);
var_dump($md);
but:
If eval() is the answer, you're almost certainly asking the
wrong question. -- Rasmus Lerdorf, BDFL of PHP
there can be no output , or even empty lines outside <?php ?> before
session_start();
so do as veedeoo tells you and put it at the top of the page
<?php
session_start();
?>
<!DOCTYPE html>
<html>
I don't think or die(mysql_error()
works here because you access the mysql not though php but though the shell.
to get te result back from the shell
exec('command', $result);
var_dump($result);
vars inside ' ' are treated as plain text
vars inside " " are treated as var
so
should work
echo "<img src='libchart-1.3\libchart\demo\generated\demo25_$email.gif'>";
also posible
echo '<img src="libchart-1.3\libchart\demo\generated\demo25_'.$email.'.gif">';
change the ` (back tick) in the query value part to ' (single qoute)
stings are surounde by a single qoute.
Colomnames by a back tick
look to me that company/vision-mission.html
get redirected to company.php?pageSlug=vision-mission
in company the vision-mision page is fechted for the data base:
wdsQuery("SELECT pages_ID, pages_title, pages_description, pages_content, pages_slug FROM " . $dbtable['pages'] . " WHERE pages_slug = '" . slugs($_GET['pageSlug']) . "'");
and echoed:
echo $r['pages_content'];
N is the number of levels of subdirectory used."N;/temp"
makes no sence.3; /temp
does, but is not necessary and not recommended, so do you reley need it?
see php#ini.session.save-path
no.
php runs on the server.
Then the html & javaschript output is sent to the browser.
The browser runs the javascript.
to get the javascript valus back to the server you can use ajax.
jQuey makes it easyer
your html
<p><label for="img1">صورة 1</label>
<input type="file" name="img[]" id="fileField1" />
<input type="text" name="label[]" id="Limage1" placeholder="Add label">
</p>
your php
...
$tmp_name = $_FILES["img"]["tmp_name"][$key];
$name = $_FILES["img"]["name"][$key];
$label = $_POST['label'][$key];
....
// change your query to save $label in your db
if($result){
// header('Location:includes/pan/projects/google/face.php?propid='.$p);
// cant redirect, have to do 4 more images
}else{
echo"Error";
}
...
first create te code in html to make sure you get what you want.
Then create that html-code using javascript with document.createElement
line 5
if($email == $row1['email'])
and what are you trying to do on line 4?
in json the name also has to be inside "", I foreget about that.
Gess that you have to write your own parser.
something like:
$var = preg_replace("/_result_=/", "", $var);
$var =trim($var);
$var =trim($var,'{'); //remove {
$array = explode (",", $var);
$result=array();
foreach ($array as $var2)
{
$array2=explode(':',$var2);
$result[$array2[0]]=$array2[1];
}
var_dump ($result);
This just caught my eye
line 105if ($male == 1 && $gender = "male")
shoulden that be :if ($male == 1 && $gender == "male")
also on line 107
if both $author and $title are NULL, $result2 will be undefined.
Use isset() before using it.
You also need a mail server. That is not normaly part of a wampp instalation.
Should be fine on your hosting server.
to install on localhost: http://flowingmotion.jojordan.org/2012/04/26/how-to-set-up-email-with-wamp/
one to many %s
$query_lignecommande = sprintf (" INSERT
INTO lignecommande(commande,article,quantite,prix,subtotal,total) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($row_commande['id'],"int"),
GetSQLValueString($row_panier['article'], "int"),
GetSQLValueString($row_panier['quantite'],"int"),
GetSQLValueString($row_panier['prix'],"double"),
GetSQLValueString($row_panier['subtotal'],"double"),
GetSQLValueString($row_panier['total'],"double"));
does your webserver has writing permision on that xml?
foreach ($array1 as $array2)
{
$number[]=$array2['number'];
}
array_multisort($number, $array1);
$pdf->Cell(0,10,'id'.$row['id'],0,1);
$row['id'] don't exist : your query only gets the name.
it sould be $pdf->Output($name,I);
or $pdf->Output();
header('Location: '. ".pdf");
you already send the pdf to the bouwser, also requires a full filename or url
You never set the values of $id, $ISPID, $Aug2013 and $Sep2013
Do a var_dump($_POST)
, they are in there.
check out mysql_real_escape_string
also notice that mysql is deprecated and replaced by mysqli
move this part to the <header> section of the calling page
<link href="css/vertical_menu_basic.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type='text/javascript' src='js/jquery.hoverIntent.minified.js'></script>
<script type='text/javascript' src='js/jquery.dcverticalmegamenu.1.1.js'></script>
<script type="text/javascript">
$(document).ready(function($){
$('#mega-1').dcVerticalMegaMenu({
rowItems: '3',
speed: 'fast',
effect: 'slide',
direction: 'right'
});
});
</script>
remove everything outside the <body> tag including the tag it self
you should parse $nfname
$copen is a file handeler, not a file name