nav33n 472 Purple hazed! Team Colleague Featured Poster

Congrats! Don't array_push insert an element to the array ? Weren't you searching the array using array_search ? Anyways, Congrats once again !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. well, here is a simple example for file upload.. http://www.tizag.com/phpT/fileupload.php Check that out !

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
//page1.php
session_start();
$_SESSION['number'] = 10;
header("Location: page2.php");
?>

and

<?php
//page2.php
session_start();
echo"number= ".$_SESSION['number'];
?>

If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. If your script uses session_register(), it will not work in environments where the PHP directive register_globals is disabled.

Source : http://nl2.php.net/manual/en/function.session-register.php

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can pass variables from 1 page to another through URL (ie., GET method), through forms (ie., POST method), by using Sessions or by using Cookies. get method , post method , sessions and cookies !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Writing data to a file is very simple. Open a file with different modes using fopen. Write contents to it using fwrite. Then close the file. http://nl.php.net/manual/en/function.fopen.php . I dont understand what exactly you mean by enable the form to upload a file to my server. Isn't file uploading enabled in your server ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

magic_quotes is not the best function out there as it can cause slashes to be added in places they are not needed. read http://en.wikipedia.org/wiki/Magic_quotes for details on that subject.

Hmm.. Thats a good link ! But, I would rather use mysql_real_escape_string than addslashes and stripslashes because if you use mysql_real_escape_string, you dont have to worry about stripslashes.

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can make use of nl2br to convert \n (new line) to <br />.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I found this and maybe it might be useful for you. http://www.webmasterworld.com/databases_sql_mysql/3561413.htm Btw, I have never encountered this problem !

nav33n 472 Purple hazed! Team Colleague Featured Poster

ust off the top of my head I'm assuming the addslashes function will take nasty characters like " and add a slash in front of them (which is used for cleaning a variable to be INPUT into the database?) and then stripslashes is to be used when they come back out of the database so that all the evil characters like " are back again

Absolutely. But check if get_magic_quotes_gpc is turned on. If it is turned on, then you don't have to explicitly escape '.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No.. Just use $ngclasses = mysql_fetch_array($result);

nav33n 472 Purple hazed! Team Colleague Featured Poster

list($ngclasses) = mysql_fetch_array($result);

is wrong. It will assign the 0th index of the array fetched by $result to a variable $ngclasses. If you want $ngclasses to be an array, don't use list. Well, here is more on list.
http://nl2.php.net/manual/en/function.list.php

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your apache isn't configured to parse php files. Either try http://www.expertsrt.com/tutorials/Matt/install-apache.html OR install Wamp or xxamp ! :) Wamp/xxamp is a bundled software with pre-configured apache/php and mysql !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yes. Possible.

<?php
if($_POST['metode'] == "Authorname") {
//if the user selects authorname from the list then use this query
$query = "select * from tablename where firstname like '%$searchtext%' or lastname like '%$searchtext%'";
} else {
   // else use other query 
}
dottomm commented: Fantastic!!!! +1
nav33n 472 Purple hazed! Team Colleague Featured Poster
$query = "select * from table where AuthorFirstName like '%$searchstring%' or AuthorLastName like '%$searchstring%'";

This will look for $searchstring in both AuthorFirstName and AuthorLastName fields. :) I hope thats what you want !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Here is a simple example.

//this is test1.php
<html>
<body>
<?php
$con = mysql_connect("localhost","root","");
mysql_select_db("test");
$query = "select * from orders";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)) {
	echo "<form method='post' action='test2.php'>";
	echo "<input type='hidden' name='orderid' value='".$row['order_id']."'>";
	echo $row['order_id'];
	echo "<input type='submit' name='submit' value='Edit'>";
	echo "</form>";
}
?>
</body>
</html>

In this script, it lists all the order_ids from order table. You can edit an order by clicking on Edit button.

//this is test2.php
<?php
	$con = mysql_connect("localhost","root","");
	mysql_select_db("test");
	$orderid = mysql_real_escape_string($_POST['orderid']);
	$query = "select * from orders where order_id = '$orderid'";
	$result = mysql_query($query);
	$row = mysql_fetch_array($result);
	echo "<form method='post' action='test3.php'>";
	echo "<input type='hidden' name='orderid' value=".$row['orderid'].">";
	echo "<input type='text' name='amount' value=".$row['amount'].">";
	echo "<input type='submit' name=submit value=update>";
	echo "</form>";
?>

order_id is passed from test1.php to this script. We get the amount of that particular order_id in this script,which is displayed in the textbox. The user can change the amount value and click on Update.

//this is test3.php
<?php
$con = mysql_connect("localhost","root","");
mysql_select_db("test");
$amount = mysql_real_escape_string($_POST['amount']);
$orderid = mysql_real_escape_string($_POST['orderid']);
$query = "update orders set amount = $amount where orderid = '$orderid'";
mysql_query($query);
header("location: test1.php");
?>

In this script, orderid and the edited amount is passed on.. Then the amount is updated in the table for that particular orderid and then redirected back to test1.php . I hope thats clear.. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

When the user clicks on Edit button, pass that user's id in a hidden variable, query the table, fetch the record and print respective values in the textboxes. Is there any particular error ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Users profile looks organised now ! :) Nice !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb ! Good luck with your friend's problem :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

-988

nav33n 472 Purple hazed! Team Colleague Featured Poster

Why do you want to redirect after querying the table ? Why not query the table after "implicitly redirecting" to another page using form method="post" ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Arthur !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Eyes: 1 blue 1 green
Location: Australia (country where they mass produce kangaroos)
Age: 50 (acting as 75)

Hobbies: Study, swimming when it gets flooded, Study and Study

Lmao ! Thats funny ;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hey! Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb Trix !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Condense that to:

People who want to take over control of other people's computers.

Right !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Here are mine:

Watermarks in the reply box. Put that message OUTSIDE the box. It is maddening to the mildly dyslexic, because it makes the text impossible to read once it is typed.

The reply box clearing when I navigate away to get something to paste in there.

The insertion point disappearing from the reply box.

Ads taking over the browser, preventing scrolling until the ad shuts up. This is usually an ad that uses 100 percent CPU time.

Ads causing the browser to scroll to the ad (and away from the reply window) during a post.

IntelliTXT ads - maddening to the mildly dyslexic. Not accessible. That includes that BOOKMARKS button. The movement causes the visual cortex image to refresh, emptying the mental equivalent of a text buffer.

Hover tooltips - maddening to the mildly dyslexic. Not accessible, as above. Let us turn it off if it is pesky.

Flash-based ads - Moving ads are maddening to the mildly dyslexic. Not accessible.

Use of overloaded ad servers, slowing the loading of a page or preventing it from completing.

Too much advertising is not the problem. Intrusive advertising is the problem. When ads take over the computer, it's intrusive.

People who give negative reputations to others who disagree with their political beliefs.

Text that won't wrap in the code sections (it goes under the sidebar).

The inactivity timeout is too short, as is the time allowed to edit.

People who complain about posts to old topics.

Aren't you forgetting something …

nav33n 472 Purple hazed! Team Colleague Featured Poster

-983

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. I dont understand.. You want companyname to be a hyperlink, but here you have it for companytype ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

If you want a popup, use window.open http://www.w3schools.com/htmldom/met_win_open.asp

nav33n 472 Purple hazed! Team Colleague Featured Poster

Lmao ! now thats a twisted question !

nav33n 472 Purple hazed! Team Colleague Featured Poster

In short, he's trying to say, a "normal" man has really become pregnant and nobody knows the truth !

I doubt if he has read the article.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Mr Beatie, who became a man about 10-years ago, is said to be the first technically pregnant male, with Doctors on Oprah last night confirming the pregnancy.

The pregnant man became an internet hit when he was featured on a website covering his alleged pregnancy. While many doubted the possibility, Thomas Beatie has now said that he made the decision to become a man about 10-years ago, but maintained the sexual organs of a woman.

Thats in the article. So, Mr. Beatie was Ms. Beatie more than 10 years ago. Then she decided to turn herself into a man. But then, she thought, oh, I should create history by becoming first "man" to be pregnant. So, she decided to keep her reproductive organs so that she can give birth to a child. Then, on one fine day, Mr.Beatie (with female organs) became pregnant ! Thats got nothing to do with woman,evil thing, snake, tree, etc.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can't use javascript variable in php script. But you can use php variable in javascript. ie.,

z="<?php echo '100'; ?>";
	alert(z);

is possible. But this wouldn't work.

var z;
z="<?php echo '100'; ?>";
<?php 
echo $z;
?>

But, if you are passing the price as the value of the select box, then getting it with an onchange event and assigning the calculated value to a textbox shouldn't be difficult.
eg.

<html>
<head>
<script type="text/javascript">
function calculate(amount) {
	var quantity ;
	var price;
	var total;
	quantity = document.getElementById('quantity').value;
	price = document.getElementById('article').value;
	total = quantity * price;
	document.getElementById('total').value = total;
}
</script>
</head>
<body>
<form name="form" method="post">
Enter quantity: <input type="text" name="quantity" id="quantity"><br />
Select an article: <select name="article" id="article" onchange="javascript: calculate(this.value);">
<option value=''>Select one</option>
<?php
	mysql_connect('localhost','root');
	mysql_select_db('test');
	$q = "select amount from orders";
	$r = mysql_query($q);
	while($row = mysql_fetch_array($r)) {
		echo "<option value=".$row['amount'].">".$row['amount']."</option>";
	}
?>
</select><br />
Your total : <input type="text" id="total" name="total">
</form>
</body>
</html>

Or, if you are passing an id as the value of the select box, you can do it this way. Submit the page using an onchange event. When the page is submitted, the quantity, the id will be posted. With the Id, query the table, get the price, multiply it with quantity and echo the value in total.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:'( lol..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Date functions used in mysql. I am not sure about the 2nd question.

nav33n 472 Purple hazed! Team Colleague Featured Poster

plssss post your question in VB forummm..

nav33n 472 Purple hazed! Team Colleague Featured Poster

-979

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hey ! Welcome to Daniweb ! You can create a thread here to get the feedback of your site ! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb ! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

-977

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb ! Please read the guidelines before posting ! And post your question in VB.net forum. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb ! Please post your question in hardware forum !