nav33n 472 Purple hazed! Team Colleague Featured Poster

Nope. Still the same result. Maybe you would like to use this script :)
http://www.hotscripts.com/PHP/Scripts_and_Programs/Networking_Tools/Whois/index.html (Max's Whois). I have tried it and it works like a charm!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hmm.. a little complicated..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. I tried this script. It worked only for www.yahoo.com (on both mozilla and firefox). It didn't work for www.microsoft.com , www.daniweb.com or even www.whois.net. :S I think something is wrong with the script.
Edit: It worked for www.msn.com ;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Is it really possible ? :S

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hmm.. Well, then the only thing that can be wrong is the value of $_SESSION. Print the query and check what's in $_SESSION. I still don't see anything wrong with your code.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your code looks absolutely fine to me.
P.S Check your table. Maybe it is stored that way (premium1 that is) ;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. Is it related to php ? :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

I think nothing is in $_SESSION.
After session_start, print what's in session. print_r($_SESSION);

nav33n 472 Purple hazed! Team Colleague Featured Poster
for($i=0;$i<100000;$i++) {
 for($j=$i;$j<10000;$j++) {
     echo "i is ".$i." j is ".$j."<br />";
}
}

wouldn't it take as much resource in java as it takes in php to execute the above code ? won't it take 1 byte for int and 2 for a character ? :-/ Just wondering!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Eg. test1.php

<?php
session_start();
$array = array();
for($i=0;$i<5;$i++) {
$array[] = $i; //insert $i to an array
}
$_SESSION['array'] = $array; //assign $array to the session variable $_SESSION['array']
?>

test2.php

<?php
session_start();
$array = $_SESSION['array']; //assign $_SESSION['array'] to $array
foreach($array as $value) {
print $value; //print $array contents
}

P.S. Dude, don't you understand english ? How hard is it to use code-tags ?

R0bb0b commented: Hell ya dude! +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Why don't you refresh after you are done with all the processing ? Why do you want to refresh anyway ? I don't think it will work that way..

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Maybe thats how you saved it ? It works fine for me in this simple example.. :)

<?php
$con = mysql_connect("localhost","root");
mysql_select_db("test");
$xyz = rand(1,2000);
$password = "something$xyz";
$username = "someuser$xyz";
$query = "insert into member (spid,uname,pss) values ('$xyz','$username',aes_encrypt('$password','password'))";
mysql_query($query) or die(mysql_error());
$query = "select uname,aes_decrypt(pss,'password') as password from member where spid='$xyz'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo "Username: ".$row['uname']." Password: ".$row['password'];
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster

Search for pagination in this forum. You will find lots of threads on the same.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Great :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I think you should use an alias. ie.,

$sql = "SELECT userId, name, email, aes_decrypt(password,'keyhere') as password, country FROM accounts where id='". $_SESSION['member_ID'] ."'";

I guess that will do the trick..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Try commenting header('refresh: 0; url=updating.php'); and see if it works.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Instead of having if-else if-else loop, why don't you assign these values to the dropdown list and then use a single query ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep. isset checks if a variable exists and is set. Can you post your code so that we can see where you are going wrong ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can run multiple queries.

<?php
if(isset($_POST['submit'])) {
//query 1
//query 2
//query 3 .....
}
<html>
<body>
<form method="post">
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>

?

nav33n 472 Purple hazed! Team Colleague Featured Poster

i was told the order in which you put the $blah $blah2 has to be the order of the fields in the table?

Almost right. You can change the order in your insert query itself. That is,

$query = "insert into table (column1,column2) values ('$value1','$value2')";
or
$query = "insert into table (column2,column1) values ('$value2','$value1')";
$query = "insert into table (activities) values ('$xyz')";
$query = "insert into table (activities) values ('$activities')";
$query = "insert into table (activities) values ('$selectedevents')";

All the 3 queries above will work. So, you don't really have to change the column name.

nav33n 472 Purple hazed! Team Colleague Featured Poster

http://www.tizag.com/phpT/examples/formex.php/
Here is an example with checkboxes.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What exactly are you trying to do ? In the above query, you are inserting the records into volunteer table. If you want to insert the values to activities table, change your query.. :-/

Edit:

$activities = trim($_POST);

This wouldn't work because $_POST is an array.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Great! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

what do i need to name the table in the database? instead of activities to i have to rename it selected_value? and is that the same goes for the form? do i change it to selected value also? as of now when i use the $selected_value it doesnt show the selected values in the database. what type of table am i suppose to make? i just made a varchar is that okay?

Basically, its like this. You have a checkbox array in the form (eg. activities). Say, the user selects 3 options from the checkboxes. So, only those 3 checkboxes will be posted.

<?php
$some_variable = $_POST['activities'];
//this will assign checkbox array activities to $some_variable. If you try to insert $some_variable to a table, it will not insert the selected values but just "array" to the table. 
print $some_variable;
//prints 'array'

You have to iterate through the array and get them in the form of a string.
To do that, you can use buddylee17's code.

$selectedevents='';
foreach($_POST['activities'] as $val ) {
$selectedevents .= $val.", ";
}
$selectedevents=substr($selectedevents,0,-2);

By the end of the iteration, $selectedevents will have the selected values of the checkbox ($selectedevents will be a string and not an array). You can use $selectedevents to insert to the table or use it in mail (or whatever!).

nav33n 472 Purple hazed! Team Colleague Featured Poster

How do you want to insert selected checkbox values ? You can insert all the selected values in 1 field as buddylee17 has mentioned or you can have one row for 1 selected value. It all depends on how you want to save the values.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ah! I see.. So, its a firefox bug :S

nav33n 472 Purple hazed! Team Colleague Featured Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster

I would use something like this:
http://forums.digitalpoint.com/showt...us#post8399126
every time the user opens the file. Upon "404 error" continue to work offline. Upon "successful response" open up online connection, proceed to compare and update online database, redirect the user to the online application.

Nice logic. But the above script didn't work for me. I opened a webpage(http://www.google.com) and then, executed the script. It said, "still alive". Then, I disabled my lan and tried again! It again said, still alive. Then when I switched off my modem, restarted apache and tried 'http://localhost, it said "cannot work in offline mode". I am not sure is it the firefox or the script.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You need to make a simple php/mysql interface that lets you updates values for a database.

;) But his question is how to ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are taking the checkbox array and inserting it to the database. First, you have to 'collect' the selected checkboxes, because, unchecked checkboxes values aren't posted.
To see what you selected, use a for/foreach loop.
Eg.

foreach($_POST['checkboxname'] as $selected_value ) {
echo $selected_value."<br />";
//do something
}

$selected_value print only those checkboxes which were selected. Do whatever you want with it! :)
I hope its clear ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Try this.

<?php
if ($_POST['save']) {
	$space = $_POST['textspace'];
	$myFile = "testFile.txt";
	$fh = fopen($myFile, 'w') or die("can't open file");
	fwrite($fh, $space);
	fclose($fh);
	echo "Saved";
} 
if ($_POST['edit']) {
	$myFile = "testFile.txt";
	$fh = fopen($myFile, 'r');
	if(filesize($myFile)!=0) {
		$textspace= fread($fh, filesize($myFile));
	} else {
		$textspace= "The file is empty";
	}
	fclose($fh);
} 
if ($_POST['show']) {
	$myFile = "testFile.txt";
	$fh = fopen($myFile, 'r');
	if(filesize($myFile)!=0) {
		$theData = fread($fh, filesize($myFile));
	} else {
		echo "The file is empty";
	}
	fclose($fh);
	echo $theData;
} 
?>
<!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" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
    <title>atlas Am&eacute;rica (mockup) - Temario</title>   
   <link rel="stylesheet" type="text/css" href="../../lib/css/contacto.css" />
    <link rel="alternate stylesheet" type="text/css" href="css/print.css" title="Print" />
    <link rel="icon" href="../../imgs/notes.ico" />
    <link rel="shortcut icon" href="../../imgs/notes.ico" type="image/x-icon" />
</head>

<body>
<div id="everything">
    <div id="header">    
        <a href="../base.htm"><img src="../../imgs/banner-small.png" alt="atlas America v0.1 (mockup)" /></a>
        <h1><a href="base.htm">atlas America v0.1 (mockup) </a></h1>            
        <ul>
            <li id="last"><a href="../../html/base.htm"><font size="2"></>Indice de temas</font></a></li>
            <li id="last"><a id="first" href="../index.htm">Salir</a></li>
        </ul>

    </div>
    <div id="sidenav-content">

    <br clear="all" />

    <div id="imgizq">
        <img src="../../imgs/juanIndice2.png" />
    </div>
    
    <div id="indice">
        <h1>Notas</h1>
<form action="notesx.php" method="post">        
<fieldset>
<legend>
Capítulo 01:
</legend>
<textarea  id='userInput' name="textspace" cols="40" rows="3" >
<?php if(!empty($textspace)) { echo $textspace; } ?>
</textarea> 
<br>
<input type="submit" name="save" value='save'/>
<input type="submit" name="edit" value='edit'/>
<input type="submit" name="show" value='show'/>

<br>
<p><b id='boldStuff2'></b> </p> 

</fieldset>
</form>

    </div>

</div>


<br clear="all" />



<div id="footer">atlas Am&eacute;rica Mockup - Software Libre M&eacute;xico</div>


</div>
<p>
    <a href="http://validator.w3.org/check?uri=referer"><img
        src="http://www.w3.org/Icons/valid-xhtml10"
        alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
</p>
</body>
</html>
…
nav33n 472 Purple hazed! Team Colleague Featured Poster

Then you need another form in the block of "edit".

echo "<textarea id='userInput' name=\"textspace\" cols=\"40\" rows=\"3\" >".$textspace."</textarea>";

So, when the user edits the form and clicks on submit, write the contents back to the file (or whatever!).


Edit: Btw, its (language = php, java, c, etc) and not [code language=] :)[code=language] (language = php, java, c, etc) and not :)[code language=] :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

So basically, the problem is with Vbulletin and not mozilla.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hmm.. But why does that happen ? :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

In this thread, I can see the first 5 posts. Then, all I see is an empty page. If the length of the text in code-tags is more, this seems to happen. First I thought it must be my internet. So, I reloaded the page and again, I see only half the page. So, Is this a firefox bug or is it my internet (I doubt) or is it me ?
I have attached the screenshots of it for proof !

P.S. It works fine in IE..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yeah, I tried using &amp; but it truncated the text. I don't believe Flash interprets html. I know the <br> tag gets displayed as plain text.

Oh, I didn't know that. But there must be a work around.. :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster

Great! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Then maybe something is wrong with your query.
I tried it and it worked !

SELECT uname,datej,curdate(),(YEAR(curdate())-YEAR(datej))-(RIGHT(curdate(),5)<RIGHT(datej,5)) AS age FROM members ORDER BY uname
Shanti C commented: smart answer +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

I don't think its possible. You have to use foreach, iterate through array elements and take required step. You can't change the 'structure' of an array (ie., replacing [] with " "). Again, I hope I am wrong.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yes. date is a mysql keyword and whatever the datatype is, its still a problem.

nav33n 472 Purple hazed! Team Colleague Featured Poster

replace date with `date`.

nav33n 472 Purple hazed! Team Colleague Featured Poster

date is a mysql reserved keyword. You should use `` around reserved keyword fields to make them work.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Unless you do a print_r, there 'wont' be []. :-/ I don't understand why[ or how] you want to [going to] do it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi Nav,

Sorry, I am not in PHP, I work in ASP.
These days I am learning PHP, so I don't know much about php.ini file.

Ah! I see.. Btw, Good work with your script :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Then it has to work. Check if $_POST is null.

nav33n 472 Purple hazed! Team Colleague Featured Poster
SELECT DATE_FORMAT( FROM_DAYS( DATEDIFF( NOW( ) , "1978-03-28" ) ) , '%Y' ) +0 AS age

Even this works. Just replace the date (1978-03-28) with the date of birth column.

nav33n 472 Purple hazed! Team Colleague Featured Poster
nav33n 472 Purple hazed! Team Colleague Featured Poster

The problem is I am not getting any error, its running smooth on my system.

Which OS u r using?

Its not OS dependent. Go to php.ini and search for ; Error handling and logging ;, and use this.
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT This will show all errors except notices.