cereal 1,524 Nearly a Senior Poster Featured Poster

You can store data to a session, so you can display it when you reload the form.

cereal 1,524 Nearly a Senior Poster Featured Poster

Interesting thread but what's the situation now?

cereal 1,524 Nearly a Senior Poster Featured Poster

@emhmk1
he can't use strtotime() because the date format is MM-DD-YYYY not DD-MM-YYYY

Here you can read the formats that strtotime() expects: http://www.php.net/manual/en/function.strtotime.php#91165

bye

cereal 1,524 Nearly a Senior Poster Featured Poster
cereal 1,524 Nearly a Senior Poster Featured Poster

It isn't the same, he replaced double quotes with single quotes, check line 4. By the way, give us the error message you get from that code. Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Alternative to Lsmjudoka's solution:

<?php
$a = '11-07-2009';
$b = explode('-', $a);
echo $b[2] .'-'. $b[0] .'-'. $b[1];
?>

Maybe I'm wrong but, in this case, I don't see any advantage in using mktime()
bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

In your CSS:
@ line 4 add this rule: text-align: center; so IE will center the div
@ line 27 remove: position: fixed; and add:

display: block;
margin: 0px auto;
text-align: left;

Right after add a new rule for the form:

form
{
   margin-top: 30px;
}

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Have you considered to use a CMS (Content Management System) as Joomla, Drupal o Wordpress? Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

You're welcome :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Yet another function to display random images:

<?php

   function randomize() {
      $path = $_SERVER['DOCUMENT_ROOT'] . "images/";
      $dir = isset($_SERVER['DOCUMENT_ROOT']) ? $path : NULL;
      $filez = glob($dir . "*.jpg");
      shuffle($filez);
      echo '<img src="/images/' . str_replace($dir , '', $filez[0]) . '" />';
   }

   randomize();

?>

$path is where you put your images, then I check if $path is set and if it's ok I use glob to find all JPEG in the path ($dir variable, you can change it with gif or whatever). Finally, I use shuffle to randomize the order of the array ($filez variable). Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

In order to pass a session from a page to another you need to start, every page, with session_start()

bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

And it's also the only accessible way to do it.

cereal 1,524 Nearly a Senior Poster Featured Poster

Check your hosts file. You can find it in c:\windows\system32\drivers\etc. Open it with notepad, and check if there is any of the websites you can't access.

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Firefox.. but you missed Konqueror, Epiphany, Flock, Dillo.. and Lynx! :D

cereal 1,524 Nearly a Senior Poster Featured Poster

You can learn to use sessions:

- http://www.php.net/session
- http://www.php.net/session_start

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Yes, is very similar to a table. A grid is an organizing principle derived from typographic design. It is used to design page layouts, you can read about grids here:

- http://www.alistapart.com/articles/outsidethegrid
- http://www.markboulton.co.uk/journal/comments/five_simple_steps_to_designing_grid_systems_part_4/
- http://en.wikipedia.org/wiki/Grid_(page_layout)
- http://webstyleguide.com/page/grids.html

If you are interested in more information there is Making and Breaking the Grid. A graphic Design Layout Workshop by Timothy Samara.

On Mozilla Firefox there is an extention called Web Developer that can give you a topographic view of the pages, this can help to understand how some pages have been designed.

To design a grid you need programs like Photoshop or Gimp, and yes, you can use also Golive and maybe Dreamweaver, but these aren't necessary. All you need is to know HTML (or XHTML). Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Download Process Explorer and try to find out what is going on:

- http://www.microsoft.com/technet/sysinternals/Utilities/ProcessExplorer.mspx

Then go to install a firewall, for our purpose you can use Zonalarm or whatever you prefer. You need a firewall to block and find out which processes are trying to connect to Internet. You can also use TCP View to monitor TCP traffic:

- http://www.microsoft.com/technet/sysinternals/Utilities/TcpView.mspx

Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe is too late, but read here:

- http://httpd.apache.org/docs/2.2/platform/win_compiling.html#projectcomponents

In order to use htpasswd.exe you have to build apache from source.

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster
cereal 1,524 Nearly a Senior Poster Featured Poster

if this is my array, how do I reverse it:

$fruits = array('apple', 'orange', 'bananna');

Here you can create a new variable that contains the reversed array, once you have done simply print it:

<?php
  $fruits = array('apple', 'orange', 'bananna');
  $aaa = array_reverse($fruits);
  $bbb = array_reverse($fruits, true);

  //display results
  echo '<h2>Array $aaa</h2><pre><code>';
  print_r($aaa);
  echo '</code></pre>';

  echo '<h2>Array $bbb</h2><pre><code>';
  print_r($bbb);
  echo '</code></pre>';
?>

or if this is it:

$fruits = array('red' => 'apple',
     'orange' => 'orange',
     'yellow' => 'bananna');

you see the example on php.net has an array with in an array(I think?) so it throughs me off.

As before, just reverse $fruits:

$fruit = array('red' => 'apple', 'orange' => 'orange', 'yellow' => 'bananna');
$ccc = array_reverse($fruit);

//display results
echo '<pre><code>';
print_r($ccc);
echo '</code></pre>';

:)

cereal 1,524 Nearly a Senior Poster Featured Poster

Yep, I agree with jamshid and Sabia. To start the best thing you can do, it is trying to modify, or better, improve existing scripts. To do this, I'm sorry for you :P but you need to explore php.net as it is the best resource you can afford out there.

I'm still learning too, at this time I've learned how to write some code by myself, but now I need more: good basics to speed up and secure my code. It's time for books, I think, at least for me.

Last but not least: continue reading topics in this forum, you can learn a lot from users experience.

bye

cereal 1,524 Nearly a Senior Poster Featured Poster

Great! :D

cereal 1,524 Nearly a Senior Poster Featured Poster

Your URLs have been blocked by the forum filter. We can't help you without your css code. Please paste the stylesheet or a link to an example online, so we can look it.

P.S. sorry autocrat I didn't saw your reply =)

cereal 1,524 Nearly a Senior Poster Featured Poster

Ok, I saw it. In my opinion you just missed a slash:

...
progid:DXImageTransform.Microsoft.AlphaImageLoader
(src='templates/rt_colormatic/images/style3/fx-tab.png', 
...

Add a slash (/) before templates. Actually the browser considers this link as a relative path, not an absolute path. Bye :)

P.S. excuse me for my bad english.

cereal 1,524 Nearly a Senior Poster Featured Poster

In my opinion, the best thing you can do is to learn XHTML basics and CSS, so you can take control over your pages. You can do this without using Dreamweaver or any other WYSIWYG software.

Jedit, NVU, Eclipse are all good, free and cross-platform. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

If your production server is on a shared hosting you can't change anything in your php.ini file. Otherwise just edit the file with a text editor, save the changes and reload the server.

Besides: Linux is more suitable for PHP. Windows is better for ASP and ASP.NET

cereal 1,524 Nearly a Senior Poster Featured Poster

Works fine for me. Have you seen this bug in other computers? Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

As stymiee said, you can do it. For example something like this:

<?php

	$d = date('w');

	$maxim[] = 'sunday';
	$maxim[] = 'monday';
	$maxim[] = 'tuesday';
	$maxim[] = 'wednesday';
	$maxim[] = 'thursday';
	$maxim[] = 'friday';
	$maxim[] = 'saturday';

	echo $maxim[$d];

?>

Just replace 'sunday, monday...' with your text.
Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

It could be that the php you tested this code on also doesn't support output buffering.

Try this test:

if (ob_start()) {
echo 'Output buffering supported';
} else {
echo 'Output buffering not supported';
}
ob_flush();

I've tried your test. In my case buffer works fine. And you are right, ob_get_clean can't unset a variable. I've made a big mistake, by no echoing my test function: echo hello("world"); Thanks for the clear explanation digital-ether, it is a very pleasure to read your posts :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Hey MidiMagic try to insert 'yahoo' or any other word :P

cereal 1,524 Nearly a Senior Poster Featured Poster

:D I hope I've found the reason of the problem! The word references is a reserved word in MySQL, this means that you can't use it as a table or column name.

- http://dev.mysql.com/doc/refman/4.1/en/reserved-words.html

cereal 1,524 Nearly a Senior Poster Featured Poster

Check the array. While function works fine to me. I have done it like this:

$names[] = 'name1@host.tld';
	$names[] = 'name2@host.tld';
	$names[] = 'name3@host.tld';
	
	$x = 0;
	$y = 2;
	while ($x <= $y)
	{
	    mail($names[$x], "hey", "whats up?");
	    $x++;
	}

Bye.

cereal 1,524 Nearly a Senior Poster Featured Poster

Ok, then try it like this:

$query = "UPDATE company SET references = 'blahblahblah' where `company_id` = 18"

Sometimes the underscore gives some problems.. like "syntax error". In this example I've put backticks, not single quotes, around company_id.

Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe it depends on double quotes in references row. Try it like this: mysql_query("UPDATE company SET references = 'blah blah blah' WHERE company_id = 18"); If you are using a $_POST then remove single quotes from it. This way: mysql_query("UPDATE company SET references = $_POST[references] WHERE company_id = 18");

cereal 1,524 Nearly a Senior Poster Featured Poster

Mine is Cinque.... Er.. I dunno about that.

de hi ho.. ^_^ in Italian language that means "five"!
Besides, mine is Zuwarah o_o'

cereal 1,524 Nearly a Senior Poster Featured Poster

Prabably this login system uses sessions. If the login form use GET instead of POST you can try to build a link to log into the restricted area, from lynx (links or w3m). You need to look the form structure in order to know if there is any kind of hidden input that can block your login script.

If the form is simple, then, you can build a link with your username and password, something like this: lynx [url]http://server/login.script?user=yourUser&pass=yourPass[/url] Obviously, if that works, you can't close lynx otherwise you will lost your session. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Try to change "ForwardX11 no" to YES, in your ssh server.

cereal 1,524 Nearly a Senior Poster Featured Poster

Try VidShot Capturer 1.0:

- http://www.softpedia.com/get/Multimedia/Graphic/Graphic-Capture/VidShot-Capturer.shtml

When you finish recording, you can use a converter to change the movie to flash format: flv.

Or you meant to do it directly through a web page?! o_o

cereal 1,524 Nearly a Senior Poster Featured Poster

I was trying your function, it worked for me when I moved ob_get_clean() to the end, after return $mail_sent. I believe that ob_get_clean was empting the variable $MESSAGE before the script could send the email.

You can try with this little function:

function hello($name) {
	ob_start();
   	echo 'hello ' . $name;
   	$message = ob_get_contents();
   	return $message;
   	ob_get_clean();
     }
   
     hello("world");

If you put ob_get_clean() before of return $message, you won't get anything

cereal 1,524 Nearly a Senior Poster Featured Poster

Clipmarks, so the user can save the pages whose is interested in.

cereal 1,524 Nearly a Senior Poster Featured Poster
cereal 1,524 Nearly a Senior Poster Featured Poster

You mean a tag cloud box, related to the searched word?

cereal 1,524 Nearly a Senior Poster Featured Poster

Or you can also try this script:

- http://mikecherim.com/experiments/support/P_php_browser_sniffer.phps

Basically it uses eregi function to identify browsers and platforms. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

For my forms I use definition lists (<dl>) instead of tables or divs. I put labels in <dt> and input, textarea, option and select in <dd>. And then I use stylesheets to improve it.

This way:

<div id="form">
<form method="post" action="check.php">
<dl>

  <dt><label for="user">User:</label></dt>
  <dd><input name="user" type="text" class="text" /></dd>

  <dt><label for="pass">Pass:</label></dt>
  <dd><input name="pass" type="password" class="text" />
      <input type="submit" name="submit" value="login" class="button" /></dd>

</dl>
</form>
</div>

The CSS part:

* { margin: 0; padding: 0; }

 body {
  font: 12px/17px Verdana, Arial, sans-serif;
  color: #111;
  background-color: #fff;
 }

 #form {
  display: block;
  margin: 0px auto;
  width: 320px;
 }

 dl {
  width: 300px;
 }

 dt label {
  font-weight: bold;
  margin: 10px 0 5px;
 }

 input.text {
  width: 100%;
  font-size: 14px;
  color: #000;
  background: #eee;
  border: 1px dotted #666;
 }

 input.button {
  float: right;
  font-size: 14px;
  color: #000;
  background: #eee;
  border: 1px dotted #777;
  width: 50px;
  padding: .1em;
  margin: 15px 0 0;
 }

This way if css fails or is disabled, the form will still mantain a good appearance and usability.

cereal 1,524 Nearly a Senior Poster Featured Poster

You can use XSPF, an open source flash music player:

- http://musicplayer.sourceforge.net/

Otherwise you need an audio streaming server, there are a lot of solutions, as RealServer and Icecast:

- http://www.realnetworks.com/
- http://www.icecast.org/
- http://www.linuxdevcenter.com/pub/a/linux/2001/03/30/streaming_linux2.html

Just search on Google. bye :)

P.S. you can also use WinAmp, VLC, XMMS or Windows Media Services to stream audio content, but is not always the best solutions, read here: http://www.shoutcast.com/

cereal 1,524 Nearly a Senior Poster Featured Poster

You can point out what selectoris are unused. You can do this with a Mozilla Firefox extention. It is called Dust-me Selectors, just google to find it. Bye :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Yes, indeed. Thanks for the reply :)

cereal 1,524 Nearly a Senior Poster Featured Poster

Hiya,
I'm new here :) I've arrived here with a google train, in search of a method to limit or slow down brute force attemps.

I agree with many of you, but I also think that we can only slow down an attacker. Best thing we can do is logging the attemps.

A simple pattern is 5 failed login attempts on a username. This is without regards to who made the attempts or from where or what IP (these are factors that can be changed by the attacker), just the fact that there exists 5 failed login attempts on a single username in the last 15 minutes.

I agree with you, and probably this is the best solution, but an attacker could always write a brute force program that tries four password per username and then switch to the next username until the timeout is finished, no?

Or my guess is just fantasy?! :D

cereal 1,524 Nearly a Senior Poster Featured Poster

You can also use ctype_alnum, this way:

$username = ctype_alnum($_POST['username']) ? $_POST['username'] : NULL;

if($username == NULL) {
  echo 'error message';
} else {
  echo $username;
}
cereal 1,524 Nearly a Senior Poster Featured Poster

Maybe you can have a look to the source of rand.c

- http://lxr.php.net/source/php-src/ext/standard/rand.c

bye :)