priti
-
Posts
461 -
Joined
-
Last visited
Posts posted by priti
-
-
explore setcookie() function in php
-
for Ted plays soccer in New York, Basketball in London and Tennis in Paris. you may need to iterate both array and generate the required string
-
one way is
$sports = array(baseball, soccer, tennis);
$str = implode(",",$sports);
$pos = strrpos($str,',');
$final_str = substr($str,0,$pos).' and '.substr($str,($pos+1),strlen($str));
echo $final_str;
there may be other ways also...
-
You most welcome buddy
-
I am referring to this
<?php
session_start();
ob_start();
include 'inc/open.php';
// Define $ip and $password
$ip=$_POST['ip'];
$password=$_POST['password'];
-
I have no idea if you have two different file or one single but session_start(); needs to be very first line in your code.
-
I see
$value_for_select = $array["id"];
is id is email address??
in php code modify $to = $_POST['displayname']; to $to = $_POST['First_and_Last_Name'];
-
modify
echo '<select name= "displayname">';
$value_for_select = $array["Email"]
echo "<option value=\"$value_for_select\">$text_for_select</option>\n";
in other part
<?php
if($_POST){
$to = $_POST['displayname']; //this will give you the to email address
$subject = "WHAT SHOULD THIS BE";
$message = "Date: $date\n\r".
"Dear $First_Name, $Last_Name,\n\r".
"Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah.Blah Blah BLah..\n\r".
"Sincerely,\n".
"$name \n".
"$street \n".
"$city, $zip \n".
"$email \\n".
$headers = "From: $email";
mail($to, $subject, $message, $headers);
// SUCCESS!
echo '<p class="notice">'.
'Thank you for your submission. '.
'</p>';
// clear out the variables for good-housekeeping
unset($date,$legislator,$bill,$name,$street,$city,$zip,$email);
$_POST = array();
}
?>
to understand more what your $_POST contains try print_r($_POST)
-
on index page try printing session. print_r($_SESSION); and see if you can find your variable registered in session.
-
$from_address=noreply@yourdomain.com //this is going to be same for all recipient ? or else you can pass the from_address as hidden form field.
<input type="hidden" value="noreply@youdomain.com" name="from_address" />
-
My approach will allow you get the email address directly and you don't have to query the DB again.
-
$query=mysql_query("SELECT * FROM table1");
$rownum=mysql_num_rows($query); // you are fetching all records from table1
for($i=0;$i<$rownum;$i++)
{
$query=mysql_query("SELECT * FROM table1 LIMIT $i,1"); //why this is required here? you already fetched records from table1
while($select=mysql_fetch_array($query))
{
$update=mysql_query("UPDATE table2 SET cat_num='$select[cat_num]'+$marks"); // print the update query
}
}
-
Can you use :
$value_for_select = $array["Email"] ?.
-
Please check
$check_fname = mysql_query("SELECT * FROM `roster` WHERE `name`='$formatname'") or die(mysql_error());
//$check_fname contains the result set.But in function -mysql_num_rows you are referring to '$check_members'
mysql_num_rows($check_members)
Kindly try, mysql_num_rows($check_fname) ..
Let us know if it works.
-
Can you help us to know, Which one is causing issue
$this->mProdCat = (int)Catalog::GetCategoryByProduct($this->_mProductId); // you say this is main issue
OR
$this->mProductSize = Catalog::GetProdsByCategory($this->mProdCat); //you say you are using this
Both are different functions ? I got confused sorry.
Secondly, In first function variable name is '$this->_mProductId' and in another '$this->mProdCat'. Please make sure it is not like this - '$this->_mProdCat'.
Do let us know further to help you.
-
one more option can be:
$users=array();
while($qry = mysql_fetch_array($result))
{
if(!in_array($qry['username'],$users)
{
array_push($users,$qry['username']);
}
}//end while
-
logically yes,
$curGameID = $_REQUEST['gameID']; //u are reading curgameid
if (trim($curGameID) == "") { //you are checking if empty gameid
//logic to fetch the id from database
}
Hope it helps.
-
file_get_content has dependency on php.ini setting the other option can be CURL.
-
with jquery
$('#table_id').attr('height');
-
$gameID = mysql_query($gameResult);
$curGameID = $gameID;
$gameID is of type resource you need to read you records from the resource by using mysql_fetch_row() or mysql_fetch_assoc().
-
Why you have kept the "." around GAME_DIRECTORY?
you have defined the constant like - define("GAME_DIRECTORY", $row['path']);
then use as below
$ft["settings"]["DIR"] = GAME_DIRECTORY ;
Let us know what error you are facing?
Thanks
-
try - file_get_content(url)
remember to check your php.ini setting to use this function.
-
you are asking "how would i go about this? " and then you are adding the codes as well !!
Quit confusing !!
-
run the loop over array and you will get all values!!
-
try
$menu = '<script type="text/javascript">
if (!FlashDetect.versionAtLeast() {
// Dont have flash 8 or later
var content = "<b><font color=#FF0000>Install flash 8 or later!</font></b>";
document.write(content);
} else {
var content = "<p>Hi, you have flash 8 or later.</p>";
document.write(content);
}
</script>';
Manipulate Array Output
in PHP Coding Help
Posted
$arr1=array('stagedevelopment','companylocation');
$arr2=array('','New City, South africa');
echo '<pre>';
print_r($arr1);print_r($arr2);
$arr[]=$arr1;
$arr[]=$arr2;
print_r($arr);