ko ko 97 Practically a Master Poster

It is Javascript problem. Move to Javascript forum.

ko ko 97 Practically a Master Poster

So, does your problem solve ? If then, marks as 'Solved thread' with the link under the message box.

ko ko 97 Practically a Master Poster

session_START() Why did you write like that ? Note that PHP is case-sensitive. 'START' and 'start' are different.

Write stabilized and obey the standard.

there's a big bang on my head now. what ever the query is. it takes the same results... like changing the bookname query into default query string. it is always the same

and yet book_id=1 is not the righr result from the database.

What does it mean ? You query from the table where 'book_id' with value '1'. So, the result will always be same.

while ($row=mysql_fetch_array($query)){
echo " buying ". $_SESSION." by ".$_SESSION." with ".$computePrice." copies<br/>";

}

Furthermore, what for this 'while..loop'. What is the reason for that looping section. You are not trying to get or return any value from that loop.

Your question is not clear. Post your codes where the problem appears and make your question understandable.

ko ko 97 Practically a Master Poster

Move 'mysql_close' to the very last of the statements. Also, 'mysql_close' has one arguments which was the current opening connection. Like below:

$con = mysql_connect($host, $user, $pass); // open the connection, $host as mysql host, $user as mysql user, $pass as mysql password

mysql_close($con); // close the current connection
ko ko 97 Practically a Master Poster

Use POST method. Never use GET with user informations. Remove the bracket at line 23.

$photo = ($_FILES);

Use instead above:

$photo = $_FILES['photo']['name'];
ko ko 97 Practically a Master Poster

Use POST method. Never use GET with user informations. Remove the bracket at line 23.

$photo = ($_FILES);

Use instead above:

$photo = $_FILES['photo']['name'];
ko ko 97 Practically a Master Poster

@bangla, You've incorrect variables for file.

$name_of_file=$_FILES;
$tmp_name=$_FILES;

File name array should've key as the html input file name you used, and the values follow 'name, type, size, error, tmp_name' respectively. As below example:

$file_name = $_FILES['upfile']['name'];
$file_size = $_FILES['upfile']['size'];
$file_type = $_FILES['upfile']['type'];
$temp_file = $_FILES['upfile']['tmp_name'];
$status = $_FILES['upfile']['error'];

Try with below:

<?php
$file_name=$_FILES['upfile']['name']; // give the name of HTML input file name as 'upfile'
$tmp_name=$_FILES['upfile']['tmp_name'];
$status = $_FILES['upfile']['error'];
$path = $_SERVER['DOCUMENT_ROOT'] . "/sqlPractice/upload/";
if(!is_dir($path)) {
//check the directory is already exists, otherwise, create it
mkdir($path, 755);
}
if($status==UPLOAD_ERR_OK) //checks the upload if it is ok
{
move_uploaded_file($tmp_name,$path.$file_name);
}
else{
echo "upload error";
}
?>

Your HTML should've below:

<form method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="upfile" /><br />
<input type="submit" value="Upload" name="upload" />
</form>

Replace the file name you want to process in "action=''".

Hope this help.

ko ko 97 Practically a Master Poster

Colon ';' is missing at line 4. Also, try with realpath of your upload folder. Change the '$path' like below:

$path = $_SERVER['DOCUMENT_ROOT'] . "/your_web_folder/upload/" . $name_of_file;

Don't miss the colon ';' at the end of the line.

ko ko 97 Practically a Master Poster

'setRedirect' is the method of joomla core controller. You need to import the core library and extends your class to the 'JController'. I'm not sure is there another way to solve the problem. You can find the problem on joomla forum and support.

ko ko 97 Practically a Master Poster

Move to PHP forum.

ko ko 97 Practically a Master Poster

Check the opening and closing of bracket '{}'. And make sure that all are properly nested.

It may due to the error above the line 15. It is helpful if you post the complete codes.

ko ko 97 Practically a Master Poster

Write the function that checks the session that the user was already login or not. If the user was not already login, redirect to login page, otherwise, redirect to the specific page. With my opinion, write the authentication function in the library and check the user login, and use 'autoload' method to load this library when the page was requested. Then, run this function in the constructor of every controller. So, the user cannot see the pages without login.

Also, go to nettuts+. They've video tutorials for CodeIgniter.

Hope this help !

ko ko 97 Practically a Master Poster

Did you already share the web folder ? And you need to set the permission. Check at first.

ko ko 97 Practically a Master Poster

I want to suggest to go to http://www.php.net/manual/en.

It is the perfect place for studying PHP. All function references are providing there.

ko ko 97 Practically a Master Poster

Line 85:

$copied = copy($_FILES['image']['tmp_name'], $newname);

Use below instead of above.

$copied = move_uploaded_file($_FILES['image']['tmp_name'], $newname);
ko ko 97 Practically a Master Poster

Try this.

<?php 

// Made by Shahbaz Singh July 2011. All Rights Reserved. Webdhaba.in

$q = $_GET["q"];

$db_host = "localhost";
// Place the username for the MySQL database here
$db_username = ""; 
// Place the password for the MySQL database here
$db_pass = ""; 
// Place the name for the MySQL database here
$db_name = "test";

// Run the connection here 
mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
mysql_select_db("$db_name") or die ("no database");
$sql = mysql_query("SELECT * FROM people WHERE name LIKE '%$q%'");

$num_results = mysql_num_rows($sql);
if($num_results > 0){
	$count=0;
	while($row = mysql_fetch_array($sql)){
		
		$users[$count]->name = $row["name"];

		$users[$count]->id = $row["id"];

		$default_pic = "people/$id/image01.jpg";

		$no_pic = "people/0/no_image_pic.jpg";

		if (file_exists($default_pic)) {
			$image = "$default_pic"; 
		} 
		else {
			$image = "no_pic";
		}
		$users[$count]->avatar = $image;
		
		$count++;
	}
	
	$output = "<table border='0' width='100%' cellspacing='0' cellpadding='0' >
	<tr>
		<td colspan='2' height='24' >
		<p align='center'><b><font face='Arial' size='2'>Search Results</font></b></td>
	</tr>";
	
	foreach($users as $user){
	
		$output .= "<tr>
			<td width='67' >
			<b><font face='Arial' size='2'>
			<img border='0' src='$user->avatar' width='86' height='86'></font></b></td>
			<td width='967' >
			<b><font face='Arial' size='2'>&nbsp;&nbsp;&nbsp; 
			<a href='people.php?id=$user->id"'>
			<span style='text-decoration: none'>$user->name
			</span></a></font></b></td>
			</tr>";
	}
}
else {
	$output = "<table border='0' width='100%' cellspacing='0' cellpadding='0' >
	<tr>
		<td colspan='2' height='24' >
		<p align='center'><b><font face='Arial' size='2'>Search Results</font></b></td>
	</tr>
	<tr>
		<td align='center' width='100%' >
		<font face='Arial' size='2'><br><br><br>Sorry, no results could be found.
		</font></b></td>
		</tr>";
}
$output .= "</table>";
?>
?>

Not tested yet. You may encounter the errors. If you got something wrong. Post here.

Hope this help.

ko ko 97 Practically a Master Poster

Your question is not clear. Any example or brief codes that you have ? Post the codes that you're referring.

ko ko 97 Practically a Master Poster

Now, the name array has all matches with the keyword that the user search. Echo out the name with for loop.

for($i=0;$i<count($name);$i++){
      echo $name[$i] . '<br />';
}

You can also use 'foreach' method.

foreach($name as $user) {
       echo $user . '<br />';
}

Hope this help.

ko ko 97 Practically a Master Poster

Linux server treat case-sensitive. logIn.php and login.php are different whether they're same file on Windows server. Check your filename.

ko ko 97 Practically a Master Poster

Perhaps, syntax highlighting in IDE you're meaning. Notepad++ has syntax highlighter for functions, variables and class with various languages. Check here.

ko ko 97 Practically a Master Poster

You should use array to get the data withing the loop. If not, the second will override the first and the third will override the second and so on. Finally, you would have only result, the last one. Check Line 25,

$name = $row["name"];

Should be

$name[] = $row["name"];

All names will store in $name array match with your search keyword. If you have another variable to store like this, change it to array too.

ko ko 97 Practically a Master Poster

'var_dump($result)' before while loop. Check which '$result' has, it should be mysql resources. If not 'mysql_fetch_assoc()' will returns the error. Check with 'var_dump()' first.

ko ko 97 Practically a Master Poster

You cannot put the line break within the options. Perhaps, 'optgroup' is better way to use.

<optgroup label="Group 1">
$i=0;

for($i=6;$i < $numfields; $i++)
{
echo '<option value="' . mysql_field_name($result,$i) . '" name="your_option_name">';
}
?>
</optgroup>

Hope this help.

ko ko 97 Practically a Master Poster

Create login form for using via web page (can be both HTML and PHP). Pass the data from that form to the login script and check if the user input data are already exists in the database, i.e., the username and password does not match or not.

You can learn many tutorials of login/out system on the internet. Google yourself.

ko ko 97 Practically a Master Poster

I don't know how the plugin suppose to do. Any references or documentations provided ? Anyway, you can find the WP function references on WP official site. If you're getting the errors, post the errors here. Or if your site is running alive, provide the link here.

ko ko 97 Practically a Master Poster

Succeed ? Then, marks as solved.

ko ko 97 Practically a Master Poster

@ardav, you were a little earlier posted. :)

ko ko 97 Practically a Master Poster

Use session or pass variable for message like 'http://url.com/msg=1', and fetch the message with $_GET and determine what the message refers. And show this message near your form. Example below:

$message = array("Invalid username","Invalid password","Invalid email","Account created successfully");

index.php
<html>
<head>
<title>Registration Form</title.
</head>
<body>
<form name="registrationform" method="post" action="register.php">
    <label for="name">Name:</label><input type="text" name="name" id="name" /><br />
    <label for="email">Email:</label><input type="text" name="email" id="email" /><br />
    <label for="password">Password:</label><input type="password" name="password" id="password" /><br />
    <input type="submit" value="Submit" name="register" />
</form>
<?php
if(isset($_GET['msg'])) {
        $msg = $message[$msg];
        echo "<p>$msg</p>";
}
?>
</body>
</html>

register.php
<?php 
if(isset($_POST['register'])){
    $name = $_POST['name'];
    $email = $_POST['email'];
    $password = $_POST['password'];

//your codes goes here.

//if something wrong
header("Location: index.php?msg=x"); //where x is variable for the error message that you want to return
}
?>

Hope this help.

ko ko 97 Practically a Master Poster

Did you already fetch each user id with these rows ? If then, you can pass these id with the ban anchor link to the ban process controller or action. And then, you can retrieve that id from the controller/action that you want to process with the built-in function $this->uri->segment(n) , where n is the variable of the url segment separated by the forward slash which you want to retrieve from the url.

Anyway, you can find the documentation in your ci folder. All functions, calsses and configuration are provided there.

Hope this help.

ko ko 97 Practically a Master Poster

What does the error show ? However, you will not get any value with $_GET. You was using 'uid' in the url. I'm not sure, without seeing your error status. Perhaps, it may solve your problem. Replace line 15 in profile.php with the line below.

$id = $_GET['uid'];

Hope this help.

ko ko 97 Practically a Master Poster

No worry about that. Post this thread to PHP. Your problem is inclusive in PHP even if there is no wordpress or htaccess forum. Indeed, they are involving with PHP.

ko ko 97 Practically a Master Poster

Ensure that you have 'session_start()' in all pages.

ko ko 97 Practically a Master Poster

Use nl2br() as @ardav stated. It automatically replace new line character (\n) with html 'br' tag. It prototype looks like:

nl2br(string);

echo nl2br("foo\nbar");    //return foo<br />bar
ko ko 97 Practically a Master Poster

Are you meaning '$expdat' is from MySQL database ? Did you store as variable ?

ko ko 97 Practically a Master Poster

You also need any web server such Apache, etc. Go here.

ko ko 97 Practically a Master Poster

Perhaps, stripslash() can help you.

ko ko 97 Practically a Master Poster

Are you sure you've already downloaded PHP and it is properly setup on your machine ? What server are you using ? Microsoft IIS or any third-party ? I suggest to use WAMPP or XAMPP if you're windows user, you can also use MAMPP on Mac. So, check the above question. You must install and configure PHP engine on your machine first. You can download PHP manually here. Download XAMPP here.

ko ko 97 Practically a Master Poster

You cannot control background size with CSS. Apparently, your problem kinda looks like position problem.

.samplebody{
	  background:url('images/port1.jpg');
	  background-size:1024px;
	  background-repeat:no-repeat;
          background-position: top center; /* Adjust the position yourself */
	}

Hope this help.

ko ko 97 Practically a Master Poster

It is server-side problem. Better ask on PHP forum. Move this thread to PHP forum.

ko ko 97 Practically a Master Poster

Put both horizontal and vertical value. Perhaps, try this:

ul#nav {
    background: url(img/2/separator.jpg) left center no-repeat;
}

With this above statement, ensure that your ul and li tags have proper height value, especially the same value will looks better.

ko ko 97 Practically a Master Poster

Put the slash if you're using DTD.

<link rel='shortcut icon' type='image/x-icon' href='http://www.schoolfriendtime.com/favicon.ico' />
ko ko 97 Practically a Master Poster

SELECT $criteria Why dollar sign before 'criteria' after 'SELECT' ?

ko ko 97 Practically a Master Poster

Make sure that the field names are correct. Anyway, post the codes above of these three lines. It may easy to find the problem quickly.

ko ko 97 Practically a Master Poster

What is the problem ? What do you want to do with the above codes ? Your post is not clear. Be more precise and tell us what do you want to do.

ko ko 97 Practically a Master Poster

There is plenty of ajax tutorials on the internet. Google that. We can't make a snippet for you.

ko ko 97 Practically a Master Poster

Try this:

<html>
<head>
<title>My first PHP By my own</title>
</head>
<body>
<?php
echo "My first program and its a failure";
?>
</body>
</html>

You should not have the plain text directly between the head tags. You can do in body tags. Also, you must write semi-colon ';' at the end of every PHP statements.

karthik_ppts commented: useful +5
ko ko 97 Practically a Master Poster

You need to post the original start of $coupon_code.

ko ko 97 Practically a Master Poster

Use modifier for multiline, e.g., '/^host2/m'

ko ko 97 Practically a Master Poster

Array ( [usecode] => Use Coupon )

As you posted above. $submit has wrong value stored. Check where $submit comes from.

ko ko 97 Practically a Master Poster

'+' means one or more match at least one match whether '?' means zero or one.