vaultdweller123 32 Posting Pro

how dogs got rabies? I dont want answers like "they got it from wild animals, who are infected by rabies, like bats, squirrel, fox, skunk etc.." , its like a loop id doesn't answer the question. i mean how was the 1st infected rabid animal got it?

vaultdweller123 32 Posting Pro

flies to the moon --> santa

vaultdweller123 32 Posting Pro

and that is what you call DISCRIMINATION!, if that is the criteria of employment... then average programmers have no chance of landing a job... So you had to be super smart in order to have to had a secure future after graduate. So if your just studying in college and you think that your skills are not that excellent enough, better quit school.... go join a gang, commit crimes and kill intelligent programmers. Is that what you mean? Ive seen many successful programmer friends that are not really that smart. i mean they just average in college days but became proficient in their craft through experience.

vaultdweller123 32 Posting Pro

And of course, the not-so-smart programmers are cheaper... :icon_wink:

oh yeah exactly!

vaultdweller123 32 Posting Pro

have you really doin some effort? havnt you noticed you had no opening curly brace( { ) in your switch in criteria. line 11.

vaultdweller123 32 Posting Pro

2 shomai, 5 puso and 1 jazz cola!

vaultdweller123 32 Posting Pro

I wanna say that im not lazy even since i've started posting in this forum..for your higher information, every single code or i mean syntax you've posted,i always try to search the meaning,the function of that code..i have a tutorial here PHP and Javascript.And if you didn't know,i learned..i've gained new knowledge in some of your code.Yeah i searched,but if i do not find any answer,i just post in this forum..and ask some help..and yeah,i copy the code here but not all the codes i've asked here were copy and paste..well, it's your opinion and view of point,but you can't see me while thinking,debugging all the codes..Ya,learning comes from asking,and when you ask,there's an explanation why..Just ask and you learn something new..im not a typical person that you know copy and paste the codes, i searched. study the all the PHP codes in w3schools,print it so that i have a hard copy here..tnx for your commented..

i really hope it's true as we are taking our time and effort on helping you here. About your error in search, you said that there's an error. can you show us the error?. coz. i didn't find any wrong in the code.

vaultdweller123 32 Posting Pro

thanks for this is see what you mean now how i was suppost to do it but when i login in and get directed to the profile page i get an error it says

Notice: Undefined variable: _SESSION in C:\wamp\www\profile\myprofile.php on line 5

screen shot of proble below

oh sorry dude... i forgot to update the connect.php file. add the session_start();

connect.php

session_start(); //start session
mysql_connect('localhost','root',''); //your connection
mysql_select_db('yourdatabase'); //your database
vaultdweller123 32 Posting Pro

Sure potential is an important quality, but would you hire a dull person
to make a software for you company, even if that dull person has
potential? Or would you hire a "*smart" person for that same job?
Remember its you ass on the line.


------------------------------------------------------------------------------------------
* whatever smart means these days.

it's really no point talking to a moron.... trying to get a point over his head. im not saying you depend it all to him.. im just saying that a company dont just hire all pure smart programmers... they can give a chance to average programmmer.... coz. they will grow from work experience. of course u must have a smart lead programmer that will lead the team.

vaultdweller123 32 Posting Pro

This isn't about making me "feel good"

The moderators here don't pick on the small guy.

You appear to be paranoid.

and your the jealous guy? :D

vaultdweller123 32 Posting Pro

This isn't about making me "feel good"

The moderators here don't pick on the small guy.

You appear to be paranoid.

and your the jeolous guy? :D

vaultdweller123 32 Posting Pro

One of the best ways of learning is by asking for help and as long as you learn from that help then next time they should be able to solve the same problem by themselves.

yeah thats exactly my point.... takeshi is just jumping from one problem to another. he do not absorbed the knowledge we provide. no effort at his side at all. he doesn't learn from it. he always ask for help.

vaultdweller123 32 Posting Pro

How is that any worse than copying peoples answer in hopes of stealing the solved count?

you really feel good about yourself huh? I repeat i dont copy answers from dumb answers its not worth it.... i know moderators will get me from this as they like pick on small guy. Ive been quite a while on daniweb and ive seen many times members are cursing other people but dont get refractions. As for you, trying hard to provoke me to emotional response... im not scared and i dont care about reputations or whatsoever.

vaultdweller123 32 Posting Pro

you know what takeshi.... im so sick and tired of debugging your code... i had help you many times and even provided code in many of your threads but you didn't had even the effort to payback the guys that helped you. You dont mark you thread solved. You just come here and beg for answers which is very annoying that some solutions are simple and obvious. i think your so lazy that your just copy and paste the code without even understanding it. Were like baby spoon feeding you here. Grow up and do you assignments on your own. You wont learn anything if you dont put your effort on it. I hope i make sense to you.

vaultdweller123 32 Posting Pro

A programmer will grow more with time from work experience... so it doesn't always the criteria is to hire super smart programmers. the important quality there is potential.

vaultdweller123 32 Posting Pro

i dont know if you understand me right but it's pretty obvious... session works like global variable. So store the user id through session, through that id the user profile. ok ill provide add some basic login and ill revised all the code. basically im providing you all the code from log-in and viewing profile to editing profile.

connect.php

mysql_connect('localhost','root',''); //your connection
mysql_select_db('yourdatabase'); //your database

index.php

<?php

	include("connect.php");


if( isset($_POST['btnlogin']) ){
	
	$user = $_POST['user'];
	$pass = $_POST['pass'];

	if( $user ){

	$sql = mysql_query( "SELECT * FROM user WHERE username='$user'" );
		if( mysql_num_rows($sql) != 0 ){

				while($row=mysql_fetch_array($sql)){
					if($row['password'] == $pass){
					$_SESSION['id'] = $row['id']; // this is here use store the user id. $_SESSION['id'] is available globally
					echo "<script>window.location='myprofile.php';</script>"; // redirect
					}else{
					echo "<script>alert('Incorrect password!');</script>";
					}
				}
				
			}else{
		echo "<script>alert('username does not exist, register first!');</script>";
		}

}

}
	
?> 



<form method='post'>
<h2>Log-in</h2>
<table>
<tr><td>Username :</td><td> <input name="user" type="text" /></td></tr>
<tr><td>Password :</td><td> <input name="pass" type="password" /></td></tr>
</table>
<input type="submit" name="btnlogin" value='log-on' />
</form>

myprofile.php

<?php

include('connect.php');

$sql = mysql_query( "SELECT * FROM user WHERE id='".$_SESSION['id']."'" );  // call the $_SESSION['id'] which stores the user id, we've set from log-in

echo "<h2>Profile</h2>
<form method='post' action='editprofile.php'>
<table>";

$row=mysql_fetch_array($sql);
echo "<tr><th>Name: </th><td>".$row['username']."</td></tr>
	<tr><th>Password: </th><td><input type='password' value='".$row['password']."' disabled='true' /></td></tr>
	<tr><th>Email: </th><td>".$row['email']."</td></tr>";


echo "</table><br />
<input type='submit' value='edit profile' />
</form>";

?>

editprofile.php

<?php

include('connect.php');


if(isset($_POST['btnedit'])){
$user = $_POST['user'];
$pass = $_POST['pass'];
$email = $_POST['email'];

$sql = mysql_query( "UPDATE user SET username='".$user."', password='".$pass."', email='".$email."' WHERE id='".$_SESSION['id']."'" ); // call $_SESSION['id'], which holds the user id

if($sql){
echo …
vaultdweller123 32 Posting Pro

good news... then you just solved your own problem yourself...

vaultdweller123 32 Posting Pro

storing id through session is very simple. here ill give you a basic example.

<?php

session_start() // you need to inorder for the session to work, this is very important. Or you can set autostart in the php.ini

$_SESSION['id'] = 1; // this is how you set session variable

//so that means that you had now created a session variable named $_SESSION['id'] and store your id, in my example i use 1;

//then you can get that value like this

$id = $_SESSION['id'];

//means you get your id through out the page... where you can use it on   major query on selecting specific rows.


?>
vaultdweller123 32 Posting Pro

on w3schools.com... they had simple example. for easy understanding... just follow fbody's link.

vaultdweller123 32 Posting Pro

i dont like interviews... i prefer actual exams.

vaultdweller123 32 Posting Pro

who is serkan?

vaultdweller123 32 Posting Pro

ahhh ok sorry i thought your problem was about uploading... just hang in there... there will be someone veteran in PHP will solve your problem...

vaultdweller123 32 Posting Pro
vaultdweller123 32 Posting Pro

hey icefrog... where is your move_uploaded_file() function? i cant seem to find it? it's responsible for uploading.

vaultdweller123 32 Posting Pro

Yeah, yeah. I always use that excuse too! :icon_lol:

waaaaaaaaaaaaaaaaa! seriously dude! i didn't mean it!

vaultdweller123 32 Posting Pro

hit print screen! :twisted:

vaultdweller123 32 Posting Pro

so may captcha script on the net! just google it out dude.

vaultdweller123 32 Posting Pro

ei by the way im not copying AB's post. Actually when i read this post, i only see kivata and ardav post. And im pretty slow coz. i test it 1st and run on my localhost before i submit my solutions. Upon submitting i was surprise AB's post 1st on my post.

vaultdweller123 32 Posting Pro

how about browser games... preferably turn-based RPG game.

Salem commented: Careful, first comes "think for me", then comes "explain it to me", finally there will be "please help me do it". You've already past stage 2! +19
vaultdweller123 32 Posting Pro

i didn't say .htaccess is new... my point is .htaccess is very hard to learn... I know PHP but i have no idea on .htaccess.

vaultdweller123 32 Posting Pro

you mean u dont want user see where the form redirected when the user view its source code?

<?php

if(isset($_POST['btnsubmit'])){
echo "<script>window.location='secret.php';</script>";
}

?>
<form name='form1' method='post'>
<input type='submit' name='btnsubmit' value='go' />
</form>

tried and tested....this should hide the action attribute of the form... but it still show in the url. if you want to change the url. then you have to use .htaccess. after all you only want the action attribute to be invisible... so i just give u what u ask.

vaultdweller123 32 Posting Pro

one way of saying thanks is marking this thread solved.. :twisted:

vaultdweller123 32 Posting Pro

just google it away dude! were in the new era now were not in medieval times... ahahaha

vaultdweller123 32 Posting Pro

awww sorry sir... i was just told by my friend... damn he's makin fool of me again! sorry for my ignorance sir.

vaultdweller123 32 Posting Pro

i recommend an e-store.

vaultdweller123 32 Posting Pro
vaultdweller123 32 Posting Pro

use mysql distinct query, to query distinct rows.

vaultdweller123 32 Posting Pro
<?php
echo "<script>alert('".$val."');</script>";
?>
vaultdweller123 32 Posting Pro

is it true daniweb is from india? my friend told me that? though im not an indian, im a big fan of indian programmer like Pranav Mistry. I hope it's ok to ask here. pardon my ignorance.

vaultdweller123 32 Posting Pro

a guy here saying hes just a newbie to PHP but know how to use .htaccess?

vaultdweller123 32 Posting Pro

you had syntax error on your query

SELECT * FROM table ORDER BY RAND(), LIMIT 1

erase the comma next to RAND(), it should look something like this

SELECT * FROM table ORDER BY RAND() LIMIT 1

vaultdweller123 32 Posting Pro

and let's just say im a big fan...

vaultdweller123 32 Posting Pro

I'm not an expert, just a hobbyist.

dont believe him... hes just too humble to admit it.hes an expert in PHP... you hear me... E.X.P.E.R.T.....your soooo lucky ardav help you.... hes the most knowledgable guy i know here in PHP.

vaultdweller123 32 Posting Pro
<option value=''>--select--</option>
vaultdweller123 32 Posting Pro

ok ill give you a basic example and based in your inputs
1st create 3 files

connect.php

mysql_connect('localhost','root',''); //your connection
mysql_select_db('yourdatabase'); //your database

myprofile.php

<?php

include('connect.php');

$sql = mysql_query( "SELECT * FROM user WHERE id='1'" );  //this id is just a sample, it should be a session variable. you must  store your id through session. so that your id can propagate through out the page.

echo "<h2>Profile</h2>
<form method='post' action='editprofile.php'>
<table>";

$row=mysql_fetch_array($sql);
echo "<tr><th>Name: </th><td>".$row['username']."</td></tr>
	<tr><th>Password: </th><td><input type='password' value='".$row['password']."' disabled='true' /></td></tr>
	<tr><th>Email: </th><td>".$row['email']."</td></tr>";


echo "</table><br />
<input type='submit' value='edit profile' />
</form>";

?>

editprofile.php

<?php

include('connect.php');


if(isset($_POST['btnedit'])){
$user = $_POST['user'];
$pass = $_POST['pass'];
$email = $_POST['email'];

$sql = mysql_query( "UPDATE user SET username='".$user."', password='".$pass."', email='".$email."' WHERE id='1'" ); //again use session to this.

if($sql){
echo "<script>alert('profile updated');window.location='myprofle.php'</script>";
}else{
echo "<script>alert('updating profile failed!');</script>";
}

}




$sql = mysql_query( "SELECT * FROM user WHERE id='1'" );
$row = mysql_fetch_array($sql);
echo "<h2>Edit profile</h2>
<form method='post'>
<table>
<tr><th>username:</th><td><input type='text' name='user' value='".$row['username']."'/></td></tr>
<tr><th>password:</th><td><input type='password' name='pass' value='".$row['password']."'/></td></tr>
<tr><th>email:</th><td><input type='text' name='email' value='".$row['email']."'/></td></tr>
</table><br />
<input type='submit' name='btnedit' value='update' />
</form>";



?>

tried and test... its still incomplete and you should make some validations upon updating. make sure the new username doesn't match existing username and validate your email. You must do the rest. cause i feel like im doing your assignment here. By the way this is just a basic example at least im showing you the code rather than just explaining it to you textually.

vaultdweller123 32 Posting Pro
<?php

$input=56; // your input here, ex. 56
$credit=76;
if($input<$credit){
$dif = $credit-$input;
}

echo $dif;

?>
vaultdweller123 32 Posting Pro
<?php

echo $images[rand(0,count($images)-1)];  

?>
vaultdweller123 32 Posting Pro

where is your ending tag of form? </form>

vaultdweller123 32 Posting Pro

Works fine for me.

how? it tells me the my current browser which is opera doesn't support the all-new yahoomail. Im forced to switch to the classic one. Do i have something to configure 1st?

vaultdweller123 32 Posting Pro

opera doesn't support all-new yahoomail?