means where should i check
check inside the url address bar after you have posted. Make sure something like the following hasn't happened. http://localhost/projectassign.php?formvar1=test&var2=another&tickbox=1&missingthing=here
means where should i check
check inside the url address bar after you have posted. Make sure something like the following hasn't happened. http://localhost/projectassign.php?formvar1=test&var2=another&tickbox=1&missingthing=here
Then could you check your url bar after posting to see that the variables haven't gone to the url.
I received your pm and register_globals = Off
appears in the php.ini file which is what it should have been. But could you add at the very end of your file the following to see if it displays anything after the post. <?php echo $projectassign.$id; ?>
That should confirm weather globals is on or off as we are getting mixed results. So tell me if that displays anything.
i am getting this in the browser
Array won't work due to the php.ini settings.
It means you will need to go into your php.ini settings and change the register globals to disabled. So if you like post your php.ini file in code tags and I will try and fix.
Then there are two things to consider. One is did you post the $_POST in the first place and the second is have you got globals disabled in your php.ini file as they should. So your problem currently is your post data is not being sent to $_POST. If you want to test your globals in the php.ini file use the following.
<?php
if (!ini_get('register_globals')) {
die('$_POST should work!');
} else {
die ('$_POST won't work due to the php.ini settings.');
}
?>
And let me know which message pops up.
To make things easier make the following file projectassign.php and in it is as below. Now what does the print_r at the bottom tell you in the webpage?
<?php
ob_start();
@session_start();
require_once ("check.php");
createsessions($username,$password,$userid,$projectid);
$con=mysql_connect("10.70.1.50","invensis","invensis");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database_myproject",$con);
$sql="SELECT projectname from projects where createdby='".mysql_real_escape_string($_SESSION['username'])."'";
mysql_error();
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result))
{
$id=$row["projectid"];
$projectname=$row["projectname"];
$options.="<option value=\"$id\">".$projectname.'</option>';
}
$sql2="SELECT * FROM users where reportingto='".mysql_real_escape_string($_SESSION['username'])."' and role='2'";
mysql_error();
$result2=mysql_query($sql2);
$num=mysql_num_rows($result2);
?>
<head>
<body>
<form action="projectassign.php" method="post">
<table width="100%">
<tr><td> <img src="Logofinalcopy.gif">
</td></tr>
<tr>
<td bgcolor="aqua"><h2>Project assign</h2></td>
</tr></table>
<br>
<table align="center">
<tr>
<td>projectassign</td>
<td><select name="projectassign">
<option value="<?php echo '$projectassign';?>" >----select project----</option><?php echo $options ?>
</select>
</td>
</tr>
</table>
<br><br><br>
<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 500px">
<tr>
<th></th>
<th>userid</th>
<th>username</th>
</tr>
<?php
$sno=1;
while($row=mysql_fetch_array($result2, MYSQL_ASSOC)){
?>
<tr>
<td><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $row['userid']; ?>"></td>
<td><? echo $row['userid']; ?></td>
<td><? echo $row['username'];?></td>
</tr>
<?php
$sno=$sno+1;
}
?>
</table>
<?php
if(isset($_POST['Submit']))
{
$checkbox=$_POST['checkbox'];
for($i=0;$i<count($checkbox);$i++)
{
$del_id = mysql_real_escape_string($checkbox[$i]);
$sql = "INSERT INTO projectassign(projectassign,userid,assigneddate)values('".mysql_real_escape_string($_POST['projectassign'])."','$del_id','')";
mysql_error();
$result = mysql_query($sql);
}
} print_r($_POST);
?>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</head>
On line 83 just after the last bracket. That is if the filename is projectassign.php as it is being posted to projectassign.php
i am getting Array() at the end .
Did you post the form? if it only displays Array() then that means no $_POST data has been sent.
try adding print_r($_POST);
at the bottom of the page and see what php displays. It should show the key used for your project assign value.
Then on line 41 replace with the following.
<td><select name="projectassign">
If you mean the mysql query on line 78 is not inserting one of the four columns then that is because you never specified the fourth column. Perhaps you should have a second look at the query on line 78.
Could you make your problem more clearer. I will try debugging again which is as follows but if that doesn't solve it you will need to be a bit more descriptive.
<?php
ob_start();
@session_start();
require_once ("check.php");
createsessions($username,$password,$userid,$projectid);
$con=mysql_connect("10.70.1.50","invensis","invensis");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database_myproject",$con);
$sql="SELECT projectname from projects where createdby='".mysql_real_escape_string($_SESSION['username'])."'";
mysql_error();
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result))
{
$id=$row["projectid"];
$projectname=$row["projectname"];
$options.="<option value=\"$id\">".$projectname.'</option>';
}
$sql2="SELECT * FROM users where reportingto='".mysql_real_escape_string($_SESSION['username'])."' and role='2'";
mysql_error();
$result2=mysql_query($sql2);
$num=mysql_num_rows($result2);
?>
<head>
<body>
<form action="projectassign.php" method="post">
<table width="100%">
<tr><td> <img src="Logofinalcopy.gif">
</td></tr>
<tr>
<td bgcolor="aqua"><h2>Project assign</h2></td>
</tr></table>
<br>
<table align="center">
<tr>
<td>projectassign</td>
<td><select name="id">
<option value="<?php echo '$projectassign';?>" >----select project----</option><?php echo $options ?>
</select>
</td>
</tr>
</table>
<br><br><br>
<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 500px">
<tr>
<th></th>
<th>userid</th>
<th>username</th>
</tr>
<?php
$sno=1;
while($row=mysql_fetch_array($result2, MYSQL_ASSOC)){
?>
<tr>
<td><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $row['userid']; ?>"></td>
<td><? echo $row['userid']; ?></td>
<td><? echo $row['username'];?></td>
</tr>
<?php
$sno=$sno+1;
}
?>
</table>
<?php
if(isset($_POST['Submit']))
{
$checkbox=$_POST['checkbox'];
for($i=0;$i<count($checkbox);$i++)
{
$del_id = mysql_real_escape_string($checkbox[$i]);
$sql = "INSERT INTO projectassign(projectassign,userid,assigneddate)values('".mysql_real_escape_string($_POST['projectassign'])."','$del_id','')";
mysql_error();
$result = mysql_query($sql);
}
}
?>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</head>
With 30 to 40 TB of traffic you would probably be best to A - host with your own server at home with an isp that accepts unlimited traffic or B - you can risk yourself in one of those online scams with unlimited traffic. Personally I would go for option A.
I received your pm and your code should be as follows.
<?php
ob_start();
@session_start();
require_once ("check.php");
createsessions($username,$password,$userid,$projectid);
$con=mysql_connect("10.70.1.50","invensis","invensis");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database_myproject",$con);
$sql="SELECT projectname from projects where createdby='$_SESSION[username]'";
mysql_error();
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result))
{
$id=$row["projectid"];
$projectname=$row["projectname"];
$options.="<option value=\"$id\">".$projectname.'</option>';
}
$sql2="SELECT * FROM users where reportingto='$_SESSION[username]' and role='2'";
mysql_error();
$result2=mysql_query($sql2);
$num=mysql_num_rows($result2);
?>
<head>
<body>
<form action="projectassign.php" method="post">
<table width="100%">
<tr><td> <img src="Logofinalcopy.gif">
</td></tr>
<tr>
<td bgcolor="aqua"><h2>Project assign</h2></td>
</tr></table>
<br>
<table align="center">
<tr>
<td>projectassign</td>
<td><select name="id">
<option value="<?php echo '$projectassign';?>" >----select project----</option><?php echo $options ?>
</select>
</td>
</tr>
</table>
<br><br><br>
<table border="1" cellspacing="0" cellpadding="0" align="center" style="width: 500px">
<tr>
<th></th>
<th>userid</th>
<th>username</th>
</tr>
<?php
$sno=1;
while($row=mysql_fetch_array($result2, MYSQL_ASSOC)){
?>
<tr>
<td><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $row['userid']; ?>"></td>
<td><? echo $row['userid']; ?></td>
<td><? echo $row['username'];?></td>
</tr>
<?php
$sno=$sno+1;
}
?>
</table>
<?php
if(isset($_POST['Submit']))
{
$checkbox=$_POST['checkbox'];
for($i=0;$i<count($checkbox);$i++)
{
$del_id = $checkbox[$i];
$sql = "Insert into projectassign(projectassign,userid,assigneddate)values('".$_POST['projectassign']."','$del_id','')";
mysql_error();
$result = mysql_query($sql);
}
}
?>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</head>
Perhaps the following function?
function trimstr($input,$length) {
if (strlen($input)>$length) {
return substr($input,$length).'...';
} else {
return $input;
}
}
echo trimstr('abcdefghijklmnopqrstuvwxyz',3);
Cool. As soon as I disabled the ads from the daniweb settings instead of using adblock things got a lot faster. Thanks dani.
Is there really such as thing as time? According to this article time did not begin until the Big Bang. Before that, there was no space and no time. So, "what time is it?" is a meaningless question that is impossible to answer correctly.
According to another theory I have read time existed before the big bang in a parent universe. This theory explains how our universe is one of infinit inside another bigger universe which we would know as subspace. So perhaps time has existed in one state or another for ever.
Yea, Netbeans will have you covered there but you will also need xampp or wamp installed to work with Netbeans. I can help you with setting it up if needed.
The long page loads (including all the http requests) are a result of the ads, I'm afraid.
I have tried using adblock for Opera but although removing the ads makes some difference it still takes ages for the gray forum menus to respond. My speed is 64kbps and the only thing I can think of is ajax requests. Does daniweb use a lot of ajax requests because it can be annoying at times and that is why I always use the My Favorite Forums menu.
IMO if you are going to program then it is best to do it right. That means not using gui software to program for you. Usually it is best to just have a syntax highlighter like notepad++ or if your really inexperienced then a debugger like Netbeans but never drag and drop commands. That's my opinion anyways. Other than notepad++ and Netbeans I haven't heard of many other popular programs or none that I can think of. Enjoy.
I have spoken on a chat room and found that the best solution is the gzcompress() function. It convert's the data to binary and compresses it. Found this this function is a lot better than bzcompress(). Thanks anyways. cwarn23
Hi, I have some strings but I want to convert them to binary (1 way). Are there any functions other then the compression functions that will convert strings to binary?
Thanks. cwarn23
I'm not saying it can't be broken, but it's pretty good - sufficient for me anyway. SHA variants are also worth looking at. Note - this is hashing, not encrypting. Encryption involves an algorithm creating some ciphertext which can be decrypted with an appropriate key. md5 cannot be decrypted or 'dehashed'.
That is until I complete my dehasher for the sha series than I will continue on the md series. A hard thing to do but fun.
T minus 38, ignition for sleep protocol at 23 hours.
Is there anyway to delete your own post?
The answer to this is no for a good reason. I'm sure that people like Dani don't want the whole of daniweb being deleted because of deleted posts so IMO it is best to not be able to delete posts. Also why would you want your post count to go down instead of up?
I could edit the post but would removing all the text remove my post?
As far as I'm aware removing all the text from a post by editing it does not delete the post but make you look like a fool replying with no information. No offense but could you imagine a person who's posts are usually empty. That would look ridiculous. So always say something smart instead of nothing.
If your trying to embed a login system or are using the url rewrite module and don't want the user to access the real location you could allways assign a cookie check if the cookie exists. For example:
<?php
setcookie('google_analytics',time(),time()+(60*60*24));
if (isset($_COOKIE['google_analytics'])) {
die('Access denied!');
}
This will allow the server to access the page but nobody else. Especially handy for when rewriting url's.
Like the following?
echo '<select size=1>';
$r=mysql_query('SELECT * FROM `table`');
while ($row=mysql_fetch_assoc($r)) {
echo '<option value="'.htmlentities($row['column'],ENT_QUOTES);
echo '">'.$row['column'].'</option>';
}
echo '</select>';
Use something like the following:
<head><title>test</title>
<script>
function ajax() {
//ajax stuff here
}
</head>
<body onunload="javascript:ajax();">
Hope that helps.
Then could you please post your .htaccess file for one of the sites that do not work.
Hello guys,
I unistalled XAMPP and had installed easyphp and it was running fine. But I don't know if I didn't noticed before but somehow the 403 error doesn't come in Firefox but all other browsers even with easyphp. Does anyone have any idea about it? I think it has to do with folders but I am putting everything in www folder of easy php; so I don't know why this is happening again and again. Thank you.
6pandn21
My time is 11:09PM
What's yours?
Below is a corrected version comparing case insensitive. So it will also work for MaDRiD
if(isset($_POST['City'])) {
echo "<strong>Answer nr1:<BR></strong>";
$cities= $_REQUEST["City"];
$odp1 = "madrid";
//$odp = "Madrid" && "madrid";
//neither of OR/AND works here
if(strtolower($cities)== $odp1){
echo "Your answer is <Font Color=#009900>correct</font> <P>";
} elseif($cities== ""){
echo "Please fill in this form<P>";
} else{
echo "Your answer is <Font Color=#FF0000>false</font> <P> ";
}
}
Debut Video Capture is a great one. It allows a microphone for video tutorials recording the screen in real time and can take pictures. Also you can select a portion of the screen to be recorded with many different encoders along with many other features and it's freeware. The best video capture program I have ever used. Also if you ever want to extract images from a video capture you can use Rad video tools which is also free. Amazing what you can get for two cents.
I don't see how the code relates to your question. Could you mention a line which expresses your question as I can't find what would yield 00:00:002010-03-26?
<?php
session_start();
$_SESSION["username"] = $username;
$_SESSION["password"] = $password;
//now to distroy session
$_SESSION=array();
header("location:login.php");
?>
<?php
session_start();
$_SESSION["username"] = $username;
$_SESSION["password"] = $password;
header("location:login.php");
?>
Internet Explorer isn't really designed for plugins although very few are available. I would suggest using a browser like Firefox, Opera or Crome as they all have that feature.
Google looks very different. Seems just like yesterday that the homepage had the plain word Google Beta at the top with no links unless you put in a search. Take a look at this youtube video
Welcome to daniweb and let me be the first to say please explain your questions in greater detail with relavent code. From what I can understand you want us to fix your mysql query but I can't seem to see any mysql query in your code. Please post the relavent code for your problem and which by the looks of it includes a few lines below what you posted and possibly a few lines above what you posted. (include the mysql_query() function. Also it would be great if you could explain what you have tried to do in previous attempts so we can base our code on your mistakes taking away a lot of the guess work.
Why do I need to use another variable $display_message?
You don't and would be wiser not to. You should always use stripslashes on $_POST and so below is a faster executing example.
$message = stripslashes($_POST['message']);
echo $message;
Of course you could try the below but there is no guarantee of maintaining the new data.
$_POST['message']= stripslashes($_POST['message']);
echo $_POST['message'];
As for the cause behind all of this the problem is magic quotes. magic quotes is an option in the php.ini file which automatically escapes quotes so that $_POST data is more secure for mysql query's when a user doesn't use the mysql_real_escape_string() function. So to avoid this annoying feature you have two options. Disable it in the php.ini file or the better option is just to use the stripslashes function.
Post your .htaccess to make sure there are no collisions in your .htaccess file
It means it cost big dollars. :) Naa just another way of making a variable name. So the value of $key will be the name of the variable. For example observe the following:
$a='C:/dos';
$b='C:/dos/run';
$c='\run\dos\run';
$d='test';
$$d = $c; //only $c and $d is used
echo $test; //displays \run\dos\run
As you can see whatever the value of $d is is the name of the variable for use. So in this case $d equals test so the new variable will be $test.
Hi, I have been introduced to this problem but can't get my head around how the problem works. What I understand is you have a matrix or grid of true and false statements then you need to pair together true and false statements according to best fit. For example a grid may be as follows.
T T T T F T
F T T F F T
T F T T T T
T T T F T F
But then I was told that any single false could be paired with only one of 3 true statements. How do I determine which three are the options for it to pair with?
Google toolbar
Try making line 228 as follows
Options -Indexes FollowSymLinks Includes ExecCGI
There are two possibilities and are as follows
<?php
//method 1
explode(',',$input);
//method 2
str_split ($input,6);
?>
Try commenting line 484 with a #
Try making the second .htaccess file as follows:
Order allow,deny
Allow from all
it's probably just me cant find the error.
it gives me
Parse error: syntax error, unexpected T_ECHO on line 3but the parse error isn't " instead of '
what is it?
Yes there is a bug and is fixed in the following:
<?php if (($handle = fopen("test.csv", "r")) !== FALSE) {
$data = fgetcsv($handle, 1000, ",");
echo "$data[3] , $data[10]"; /* bla bla bla bla */
fclose($handle);
}
else echo 'failure opening data file'; ?>
Could you please explain in more details what your problem is because I don't have a clue.