ShawnCplus 456 Code Monkey Team Colleague

Just remove the surrounding click event ie.,

$(".run").click(function(){ ... });
ShawnCplus 456 Code Monkey Team Colleague
var bd = new Date();
if ((bd.getDay() > 0 && bd.getDay() < 6) && (bd.getHours() >= 8 && bd.getHours() <= 17)) {
  //show
} else {
 // hide
}
ShawnCplus 456 Code Monkey Team Colleague

Help you with what?

ShawnCplus 456 Code Monkey Team Colleague

Ahh, add a space before your WHERE, right now you have SELECT * FROM myTableWHERE...

ShawnCplus 456 Code Monkey Team Colleague

Try

"WHERE ho_uniqueid='".$_SESSION['uid']."'";
ShawnCplus 456 Code Monkey Team Colleague

Your image is being cached because it's the same URL. Add a random URL parameter to prevent it from being cached.

document.getElementById('captchaImage').src="captcha.php?_rnd=" + Math.random();
ShawnCplus 456 Code Monkey Team Colleague

You could give http://labjs.com/ a shot.

LABjs (Loading And Blocking JavaScript) is an open-source (MIT license) project supported by Getify Solutions. The core purpose of LABjs is to be an all-purpose, on-demand JavaScript loader, capable of loading any JavaScript resource, from any location, into any page, at any time.

ShawnCplus 456 Code Monkey Team Colleague

Show us the code you have and we'll help you from there.

ShawnCplus 456 Code Monkey Team Colleague
ShawnCplus 456 Code Monkey Team Colleague

If I have a css code like this:

body { color:#000; font-family:Arial; font-size:62.5%; padding:0;  margin:0; }

ul { margin-left:24px; }

li { color:#ffffff; }

#divID { height:50px; }

#divID li { padding-right:10px; }

Will the text in #divID li borrow properties from li and make the text white?

Short answer: Yup. Unless you override it with a more specific selector and color it'll inherit (hence the Cascade in Cascading Style Sheets)

ShawnCplus 456 Code Monkey Team Colleague

m not student.. m professional..and this is required for my proj..
dnt worry i solved it now...no need to waste ur time..

Evn f ur prfsnal u nd 2 shw efrt. <--- This is hard to read
Even if you're a professional you need to show effort before we help you.

ShawnCplus 456 Code Monkey Team Colleague
ShawnCplus 456 Code Monkey Team Colleague

Exactly, like I said. You would have one file say image.php generate the image and in the file you wanted to show the image you'd do

<img src="image.php?someparam=somevalue" />
ShawnCplus 456 Code Monkey Team Colleague

If you want to place it dynamically inside another page you would have one PHP file generate the image and then point to that in an <img> tag.

But to set the content-type just use:

header('Content-Type: image/png');
ShawnCplus 456 Code Monkey Team Colleague

As much as I try and aviod overposting more experienced and respected posters, if you remove the [] that will only let you select 1 of the checkboxes and not multiple. If you want multiple You need to loop through them. Try

<?php
  $engineers = $_POST['Prefered_Engineers'];
  foreach($engineers as $engineer) {
     echo $engineer;
  }
?>

Hope that helps

What he said, it's been a long day :)

ShawnCplus 456 Code Monkey Team Colleague

Remove [] from the name of the field, PHP sees that and tries to turn it into an array.

ShawnCplus 456 Code Monkey Team Colleague

time BETWEEN '$endDateTime' AND '$startDateTime' Put quotes around the dates

ShawnCplus 456 Code Monkey Team Colleague

do you mind passing on a quick example? Would they be auto?

ul#navigation {
  position: fixed;
  top: 10px;
  left: 10px;
}
/* place the ul with the ID navigation 10px from the top-left corner of the screen */
ShawnCplus 456 Code Monkey Team Colleague

I have tried using position: relative; within the ul.sidenav portion, but it's still stuck in the left corner.....any other ideas? Should I use the relative position in all portions?

Also, I don't know if it makes a distance, but I am using IE 7...

When you use position:fixed you have to use the left and top CSS properties to position it on the page.

ShawnCplus 456 Code Monkey Team Colleague

Use position:fixed which will keep the element in the same place on the screen even if the user scrolls the page. Also, Java != Javascript

ShawnCplus 456 Code Monkey Team Colleague

!== The === and !== operators check type along with value. 0 is an integer, NULL is NULL. so $somevar = 0; if ($somevar == NULL) { /* true */ } but if ($somevar === NULL) { /*false*/ }

ShawnCplus 456 Code Monkey Team Colleague

You could use a <span> tag or (this may not be cross-browser compatible) you can use the first-line pseudo-selector on the div like so

div#someID { font-size: 1.8em; }
div#someID:first-line { font-size: 3.5em; }
ShawnCplus 456 Code Monkey Team Colleague

http://php.net/mysql - Language documentation is your friend

ShawnCplus 456 Code Monkey Team Colleague

Your first place you should go for any question related to PHP is the PHP documentation: http://php.net/for

ShawnCplus 456 Code Monkey Team Colleague

Hash one way, your thinking in terms of 1998 technology. Today we have supercomputers with millions of cpus with petaflops whatever that means. So when the performance of the average computer increasing every month it makes it possible for the computer to hash every combination until there is a matching hash. And with today's average home pc, it is possible to crack a hash where the original string was ONLY 3 digits long and that takes about 40 seconds. However with a supercomputer perhaps something like 7 digits could be cracked in that time. Keep up with the technology dude.

It doesn't matter what year you're talking about a hash is by definition impossible to reverse. A hash is ONE WAY. You may be able to use a supercomputer to calculate hash collisions which result in the source string but you can't reverse a hash. Yes, an average home computer can do it, hell I have a set of rainbow tables myself, but this doesn't change the fact that a hash is ONE WAY and a hash can't be reversed. You might have noticed I was repeating myself there because it was necessary. I'm not saying that a hash cannot be resolved to the eventual string, I'm saying that it isn't done the way encryption is done. There are decryptors, there are no dehashers, only lookup tables which, as mentioned before, you provide a hash and it does a lookup by hashing every possible string and comparing that hash to …

ShawnCplus 456 Code Monkey Team Colleague

OK, I gotta throw my 2 cents in here. There is no such thing as a de-hasher. A hash is ONE WAY. The only thing that can be done is to produce every possible string against the salt using the same algorithm to produce the same hash. It's not possible to reverse a hash, that's why it's a hash.

ShawnCplus 456 Code Monkey Team Colleague

Don't use ereg (http://php.net/preg), and read the giant READ ME FAQ at the top of the PHP forums then come back here and ask your question again

ShawnCplus 456 Code Monkey Team Colleague

$HTTP_COOKIE_VARS["users_resolution"]

See http://www.wallpaperama.com/forums/php-tutorial-guide-how-to-show-screen-resolution-find-display-script-t517.html.

I don't think this can deal with resize events - javascript/ajax would probably be required for this.

Don't use HTTP_COOKIE_VARS, use _COOKIE
http://php.net/$_COOKIE

diafol commented: Fair one. Thanks +4
ShawnCplus 456 Code Monkey Team Colleague

What do you find wrong in my way of communication and typing??Could you please tell me ??:?:

There's nothing in that one, but this

Hi frnds...
I am doing ma collg 1st yr and i am of CSE department(comp sci engg) and i want to do some additionals course on

seems to be missing some vowels, consonants and words in general.

thanks for your reply but could you please tell me what is clojure??.As this is the first time i am hearing about it..some basic infos about clojure

Google is your friend, along with Wikipedia or essentially anything that exists that you could use to help yourself find the information before begging for it.

ShawnCplus 456 Code Monkey Team Colleague

Your } for your changePassword function is a {. Also, you don't need to specify public for all of those variables, scope defaults to public.

ShawnCplus 456 Code Monkey Team Colleague

Inside the function basicAjaxSwitch you are defining a variable basicAjaxSwitch so it's being overwritten. Just use a different variable name inside the function.

ShawnCplus 456 Code Monkey Team Colleague

exec only returns the response code, use shell_exec, that'll get all of the output so if imagemagick is producing errors you'll be able to see them.

ShawnCplus 456 Code Monkey Team Colleague
ShawnCplus 456 Code Monkey Team Colleague

Yes, "newnewnew" explains exactly what your problem is. And not using code tags helps us out even more. What exactly is your question?

ShawnCplus 456 Code Monkey Team Colleague

I have Ghostscript and IMagemagick installed on my local machine. I can access the IM functions from the command line. The environment variables are also set.

The problem is that when I try to execute the IM function using PHP's exec() method, I get no result. The same script works on my remote web host.
When the execution is successful, exec() returns a 0. On my local machine, it returns 4.

Is there a way to see any kind of error message returned from exec()? How do I know that PHP is able to find IM?

Any help in this matter would be useful!

PHP has built-in ImageMagick functions, why are you using an external program?

ShawnCplus 456 Code Monkey Team Colleague

A) Use code tags
B) This is a PHP problem not Javascript
C)

<?xml version="1.0" encoding="UTF-8"?> // <---- this is your problem because of the <?

If you're in PHP you have to echo the <?xml otherwise PHP will think you're trying to open PHP tags and parse whatever is inside.

<?php echo '<?xml version="1.0" encoding="UTF-8"?>' ?>
Airshow commented: Good answers, A, B and C. +1
ShawnCplus 456 Code Monkey Team Colleague

What do you mean by calling the table? Also, why're you using PDO for the connection then just completely ignoring it and using mysql_query anyway? http://php.net/pdo

ShawnCplus 456 Code Monkey Team Colleague

Show us your code otherwise we're just guessing

ShawnCplus 456 Code Monkey Team Colleague

Thanks for the quick reply ShawnCplus. It spares me an awful lot of pain and hair ripping! Thank you so much!

As a short explanation strings are arrays of characters so if you want to get the 3rd letter in a string just do $string[2] (counting begines at 0)

ShawnCplus 456 Code Monkey Team Colleague

Hi all,

I've tried searching both here and google for help on this one. I'm not quite sure what to call it basically I have a directory with different files all .txt. I want to display only the ones beginning with letter A. How do I modify my below code to do this?

<?php
if ($handle = opendir('poems/')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            echo "$file\n <br />";
        }
    }
    closedir($handle);
}
?>

I know I need to use something like A* but I don't even know what to call it to search for it?

Thanks!

<?php
if ($handle = opendir('poems/')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != ".." && $file[0] == 'A') {
            echo "$file\n <br />";
        }
    }
    closedir($handle);
}
ShawnCplus 456 Code Monkey Team Colleague

Alright. I think I get it. So, if I were to try and echo the contents of http://www.example.com/ , I would use this for my code right? Cause, at the moment I'm not seeing anything.

<?php
$source = file_get_contents("http://www.example.com/");
echo $source;
?>

Sidenote: We have to use a variable and echo it. I know this could be a one line code.

If you see absolutely nothing then you may be getting an error. On the line before $source = ... put ini_set('display_errors', 'On'); error_reporting(E_ALL); If you're getting an error that will show it

ShawnCplus 456 Code Monkey Team Colleague

Alright, so what would be the proper way to get information from a web path then?

The above code was what I was told in class yet it produced nothing when I tried to echo the teachers example page. My original code was to use a web path but since it wasn't producing any output, I decided to see what the issue was.

If the file is on the same server as the script then use the absolute path. If it's a remote file use the URL.

ShawnCplus 456 Code Monkey Team Colleague

You're not giving a full path, you're giving a web path. In the first example it is making a web request to fetch the file, in the second example it is directly accessing the filesystem. Make sure your path is correct or use an absolute path like /path/to/your/webroot/page.html

ShawnCplus 456 Code Monkey Team Colleague

Excuse me for beeing persistent; maybe I have not given enough information ...

The data has the shape of six files. They are very small, seen as computer files, but seen as figure tables to fill by hand, a couple of them could seem a bit scarey. You do not want to fill them in every time you want to repeat a simulation with some minor change ... or simulate a quite different case.
Is it really so that PHP does not provide a standard method for upload and download files?

If you want to save simulations for future use just use a damn database. Don't try to go against the grain when working with PHP. There are plenty of tools as your disposal for working with stuff like this. Instead of having the simulation parameters saved on the user's machine just have them saved in your database.

ShawnCplus 456 Code Monkey Team Colleague

i dont no whether it is the place or not to share my problem........the problem is that i have a little problem with my router..........!!

when ever the electricity failure happens, my internet connects gone to disconnect imediately............then if i turn on and off my router manually it connects again and works fine...!!

My problem is that i want to make a script that when ever internet connections get disconnect my router should restarts automatically...!!

Please help me with any cmd command or php script or by any kind of script ..
i am using windows................and please don't ignore it...........!!

Get.......... an............. UPS............., hardware................ should.......... stop.............. the............... issue................ long............ before................. software............ does.........

ShawnCplus 456 Code Monkey Team Colleague

You can't, use a database. It's that simple.

ShawnCplus 456 Code Monkey Team Colleague

I need to import TEST.TXT (located in the same directory as my script

It has 1 Record: "6","Lunch","234"

Iget this error message: Warning: mysqli_close() expects exactly 1 parameter, 0 given in C:\wamp\www\test\import.php on line 19

Why?

Heres my script:

<?php
// Connect to the MySQL server and select the corporate database
$mysqli = new mysqli("localhost","user,"password,"test");
// Open and parse the test.txt file
$fh = fopen("test.txt", "r");
while ($line = fgetcsv($fh, 1000, ","))
{
$id = $line[0];
$item = $line[1];
$price = $line[2];

// Insert the data into the sales table
$query = "INSERT INTO example SET id='$id',
item='$item', price='$price'";

$result = $mysqli->query($query);
}
fclose($fh);
mysqli_close();
?>
$mysqli->close();
ShawnCplus 456 Code Monkey Team Colleague

someone needs to write a decent tutorial on profiles that are user editable, people want to try recreate facebook/myspace to see how it works, its not about reinventing anything.

thanks, enzo

As for this, if you're just using it as a learning experience then it should be just that. It's not a very good learning experience if you just follow someone else's tutorial. The point of recreating something is to learn from the reverse engineering of it.

"Hmm, they have user profiles what is a user profile though. Let's see, a user has a name, and a phone number and an email address. But, oh, look a user has an ID too, that's probably the unique key."

"User's have friends but how do they do that? Ahh, I see, it's really just a list of user ids that they are friends with. But... I know that just storing a list of IDs breaks normalization so they probably have a many-to-many relationship of users. That makes more sense..."

Stuff like that.


(As an aside, echo doesn't need () it's not a function it's a language construct)

ShawnCplus 456 Code Monkey Team Colleague
echo '<a href="profile.php?id="$id">Enzo's Profile</a>';
?>

ive spotted the " after the = sign, wasnt supposed to be there but $id doesnt seem to contain anything?

If you're trying to get the value of $id in that string then you have to concatenate because you're using single quotes.

echo '<a href="profile.php?id=' . $id . '">Enzo's Profile</a>';
ShawnCplus 456 Code Monkey Team Colleague