robert_gsfame
-
Posts
876 -
Joined
-
Last visited
Posts posted by robert_gsfame
-
-
assume that i have two column firstname = 'jane' and lastname='Lambert'
then i want to get the value using $_POST
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
echo $firstname.' '.$lastname =====> result Jane Lambert
what if firstname = 'Jane' and lastname='Lambert Sugar'
echo $firstname.' '.$lastname =====> result Jane Lambert ????
it will only take Jane and Lambert, how to make the third words included into lastname so that it will result Jane Lambert Sugar
Help please
-
friends, how can i prevent " \ " this special character using ereg
for example " . " then i will use ereg("\.",$data) so how bout " \ "
and how prevent those special such as "." "*" "%"characters being typed in one preg
thanks
-
can anyone explain this to me..is it correct if i put the code this way
<?php if($_POST['submit'])&&(!empty($_POST['textarea']))){
echo "okay";}else{
echo "wrong";?>
-
:confused:
It's yellow highlight, i've put everything exactly the same like what was written above...
Do you think i miss something maq??
-
What do u mean? is it correct or wrong...when i run it, it still works but i still worried about the highlighted mark <?>
Ignore it or you have something to do with it
-
Is it correct if i put this way
<?php session_start();?>
<!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></title>
<meta name="description">
<meta name = "keywords">
<style type = "text/css">
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<?php require_once['config.php'];?>
</head>
i created this using dreamweaver, and when i put this way, highlighted <?> mark appeared on my properties
is there something wrong with the code, can explain it to me about the meaning of that error?
-
Is it correct if i put this way
<?php session_start();?>
<!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></title>
<meta name="description">
<meta name = "keywords">
<style type = "text/css">
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<?php require_once['config.php'];?>
</head>
i created this using dreamweaver, and when i put this way, highlighted <?> mark appeared on my properties
is there something wrong with the code, can explain it to me about the meaning of that error?
-
thank you everyone
-
require_once['bla.php'] ----> it's a connection to mysql database
bla.php
$host="localhost";
$username="xxxx";
$password="xxxx";
$db_name="xxxx";
mysql_connect("$host", "$username", "$password")or die("cannot connect to server");
mysql_select_db("$db_name")or die("cannot select DB");
-
Friends, i got some simple questions here
Put require_once['bla.php'] between <head></head>
Put require_once['bla.php'] between <body></body>
Which one is actually correct, or both are correct
thanks!
-
Does anyone have the solution for this. i actually want to create a login form but when username textbox left blank, alert popup started to appear stated "Username cannot left blank", else it comes to page2.php and POST the username.
Page2: $username = $_POST['username'];
echo $username;
Please help me for page1
(*Don't relate this to sql database*)
-
this is the code written
<html>
<link rel="shortcut icon" xxxxxxx >
<title>blablabla</title>
<body>
</body>
</html>
this is the code but the problem is that window title didn't change as what was written which is blablabla
I don't know why this happened
-
Hello everyone, i created my own html page using dreamweaver, but the problem is that the title doesn't change although i've tried to change the <title>blabla</title> but the title didn't change as what written which is blablabla
does anyone can give me this explanation and what to do?
thanks in advance
-
just create a form like
<form action = blabla.php method = POST name =blabla>
<input type = text name = subject>
<input type = text name = body>
</form>
call those using $_POST
$subject = $_POST['subject']
$body = $_POST['body']
is it what you mean?
-
Hello all php masters! Does anyone know how to create a chatroom not shoutbox...
I want to create chatroom but i don't want page to be refreshed in certain seconds as it's annoying users.
Anyone has the idea
Thanks in advance
-
when i put .htaccess in my root folder, my index.php appeared with that error
or what's wrong with that?
-
can anyone also help me with this?
i want to send confirmation link or anything using mailto
but i wish to have image attached as the header of my email
anyone could help? thx in advance
-
so gevans, tell me how to use this .htaccess?
please explain to me..how to create this file, where to put n why i have error message, it says "CGI problem"..Help...HELP
-
are you sure? but most people said that it will help securing the site..
do you know how to use .htaccess?
-
I want to hide .php extention so it's like www.blabla.com/index instead of www.blabla.com/index.php
Does anyone know how to do this? please tell me in detail cause i'm still a newbie ???
-
SOLVE !!! i just add "title=$title&field=$field&q=&country=$country&search=Find+resume¤tpage=$x'> in my link and it solves my problem..
FINALLY
-
I want to make a search engine for user and display records in several pages. when i try it, at first page records displayed correctly but when i click on the second page "2" , ">" or ">>", all gone wrong. does anyone can help me? thx in advance!! here is my code:
$variable = $_GET['city'] ;
$variable2 =$_GET['title'] ;
$variable3 =$_GET['field'] ;
$variable4 =$_GET['country'] ;
$trimmed = trim($variable);
$trimmed2 = trim($variable2);
$trimmed3 = trim($variable3);
$trimmed4 = trim($variable4);
$table = "members";
$search = "city";
$search2 = "title";
$search3 = "field";
$search4 = "country";
$query = "SELECT COUNT(*)FROM $table WHERE $search2 LIKE '%$trimmed2%'AND $field_to_search3 LIKE '%$trimmed3%' AND $field_to_search LIKE '%$trimmed%' AND $field_to_search4 LIKE '%$trimmed4%' ORDER BY firstname";
$result = mysql_query($query) or trigger_error("SQL", E_USER_ERROR);
$r = mysql_fetch_row($result);
$numrow = $r[0];
$rowsperpage = 1;
$totalpages = ceil($numrow / $rowsperpage);
if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
$currentpage = (int) $_GET['currentpage'];
} else {
$currentpage = 1;
}
if ($currentpage > $totalpages) {
$currentpage = $totalpages;
}
if ($currentpage < 1) {
$currentpage = 1;
}
$offset = ($currentpage - 1) * $rowsperpage;
$query = "SELECT * FROM $table WHERE $field_to_search2 LIKE '%$trimmed2%'AND $field_to_search3 LIKE '%$trimmed3%' AND $field_to_search LIKE '%$trimmed%' AND $field_to_search4 LIKE '%$trimmed4%' ORDER BY firstname LIMIT $offset, $rowsperpage";
$result = mysql_query($query) or trigger_error("SQL", E_USER_ERROR);
$count = mysql_num_rows($result);
$info = mysql_fetch_array($result);
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
if ($numrows == 0 )
{
echo "<center><font face=arial><h4>Results</h4></font></center>";
echo "<center><font face=arial size=2><p>Sorry, your search </font>"."<font face=arial size=2> returned zero results</font></p></center>";
}
if (empty($s))
{
$s=0;
}
$result = mysql_query($query) or die("Couldn't execute query");
if($numrows > 1 ){$return = "results";}
else{ $return = "result"; }
echo "<p><font face=arial size=2>Your search </font><font face=arial size=2>returned <strong>$totalpages</strong> $return</font></p>";
$count = $s + 1 ;
while ($row= mysql_fetch_array($result))
{
$city = $row["city"];
$country = $r["country"];
$count++ ;
echo $city.$country
}
$range = 20;
echo"<center>";
if ($currentpage > 1) {
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'><img src='firstarrow.jpg' width=15 height=15 border=0></a> ";
$prevpage = $currentpage - 1;
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'><img src='previousarrow.jpg' width=15 height=15 border=0></a>";
}
for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) {
if (($x > 0) && ($x <= $totalpages)) {
if ($x == $currentpage) {
echo "<font face=arial size=2> [<b>$x</b>] </font>";
} else {
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x' class=set6><font face=arial size=2>$x</font></a> ";
}
}
}
if ($currentpage < $totalpages) {
$nextpage = $currentpage + 1;
echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'><img src='nextarrow.jpg' width=15 height=15 border=0></a>";
echo "<a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'><img src='lastarrow.jpg' width=15 height=15 border=0></a>";
}
echo"</center>";
?>
Need help ($_POST)
in PHP Coding Help
Posted
so what should i do??
i want they ignore the space, so that i could get the value after the space