kylegetson 16 Junior Poster in Training

I also have a few sites that increased due to this change... however, I'll admit some of my pages are ranked above others much better sites. Not all my sites increased rank, most of them had no shift.

kylegetson 16 Junior Poster in Training

looking to build a network for link exchange/promotion. The plan is to get a distributed group of reliable people. Then exchange promotion between group members. The group would need to be relatively small and manage-able. Communication would need to be open amongst the group, but kept private and away from the public. The group of people would need to be quick to respond, and promote new links.

members of this group would need experience, and established accounts in various social media sites, such as facebook, digg, reditt, stumbleupon, etc.

to keep promotion fair amongst the group and to avoid spam, each member would only have a specific amount of links they could promote each week/month. The group would have a maximum promotion per social network to avoid becoming spammy.

Anyone have any thoughts, ideas, or want to join?

kylegetson 16 Junior Poster in Training

you can use the apache directory directive. but it will probably effect how you can access it via flash.

http://httpd.apache.org/docs/1.3/mod/core.html#directory

kylegetson 16 Junior Poster in Training

You could leave it as an html file, and make your html files parsable as php files (with addhandler in your .htaccess)

I would stay away form iframes wherever possible.

kylegetson 16 Junior Poster in Training

Use this, you won't have to type up the months. This creates a string '5/1/2010' and then converts it to a timestamp, and passes it into the date function with the 'F' as the format, which will output the text version of the month.

$oldm = 5;
$newm = date( 'F', strtotime( $oldm . '/1/' . date('Y') ) );

doing it this way makes it easier to maintain. If you later want to change to month abbreviations, you could just change 'F' to 'M', no changing an array of months.

kylegetson 16 Junior Poster in Training

the .htaccess file won't be read by apache outside the document root. if your just trying to restrict access, you could use authentication, not sure if you could get flash to work with that though.

generally, you put something outside the document root that you don't want the web to have access to, but it seems like you want it to be web accessible?

kylegetson 16 Junior Poster in Training

doc root missing?

kylegetson 16 Junior Poster in Training

try the full path, with the C:\ included

kylegetson 16 Junior Poster in Training

can you post the virtual host from your conf file?

kylegetson 16 Junior Poster in Training

if CPU and RAM usage isnt high when the page is 'loading' seems to me that the problem is elsewhere.

Do pages load successfully, or do they timeout? Most browsers have a 90sec timeout by default.

Is the server responding with a static file or a dynamic script?

Check to be sure the httpd process is running, also check to see what HTTP status code you get back when the page finishes loading.

kylegetson 16 Junior Poster in Training

the counter.txt file does not exist. create the file first, and make sure its writable by the webserver.

kylegetson 16 Junior Poster in Training

use mktime() or strtotime().

strtotime('April 1 ' . date(Y) . ' 1:59:59');

this would get you paril 1 of the current year at 1:59:59.

kylegetson 16 Junior Poster in Training

there are a few ways to do it
use explode() to split by a comma and space, strpos() to find the position of of the period, and substr() to only get the data after that position.
or, you can use regular expresions and preg_replace(), something like '[a-z]\.(.*),? ?' would probably do it

kylegetson 16 Junior Poster in Training

I'd use a debugger or start printing out variables at various locations. You'll also want an 'else' case if the login does fail. session_start is usually called before other stuff happens, most specifically before any output is sent to the browser, so your lines #1-3 are probably sending output (empty lines, spaces, and/or tabs) to the browser.

kylegetson 16 Junior Poster in Training

be careful when using something like fopen with a dynamic variable. If something you didnt expect got into that fopen, it could open files you don't want anyone to open (passwords files, files with database connection details, configuration files, etc.).

that being said, you cant refresh anything via php, as its server-side. 'refresh' is a client side activity, so it will have to be done in a client-side manner, html (meta refresh) or js (document.location).

Requiring cookies is not a very good user experience for a calendar. For example, if I was looking at the calendar for next march, and I found an interesting event or something on the calendar, and wanted to send it to a friend, I could give them a URL, but they would'nt have my cookies, so they'd be like wtf you sent me a link to this month, what date are you talking about.

I would suggest not using iframes at all, or at a bare minimum, use your $_GET vars on the iframe url in place of expecting a cookie.

kylegetson 16 Junior Poster in Training

I suggest going with a forum. Or you could try something like phpfox.

kylegetson 16 Junior Poster in Training

try casting it as a string. I would guess your $module is not a string, which likely means that even casting it, won't give you expected results (though it probably won't throw an error).

you could try :

$pos = strpos( (string) $string, $find );
kylegetson 16 Junior Poster in Training

try this:

# redirect visitors to not have .php in the url
RewriteCond %{REQUEST_FILENAME} -f # only if the file requested actually exists
RewriteCond %{REQUEST_FILENAME} \.php$ # only if the file ends in .php
RewriteRule ^/(.*).php$ /$1/ [R=301,L] # 301 them to the same location, without the .php ending

# serve the .php file, even though its not on the url
RewriteCond %{REQUEST_FILENAME} !-f #only if the file requested DOES NOT actually exists
RewriteRule ^/(.*)$ /$1.php [L] # serve the php file

I did not test this, so test it out before using in a production environment. you may also want to add in a condition with -d for making sure the directory doesnt exist before redirecting or attempting to serve a specific file.

kylegetson 16 Junior Poster in Training

why not just remove the outdated one, and symlink it to the correct version?

rm -rf /usr/bin/perl;
ln -s /usr/bin/perl /usr/local/bin/perl;

you'll want to back up your old version of perl just in case. (never blindly run any script some just gives you)

kylegetson 16 Junior Poster in Training

check to make sure that the directory /var/www/ is readable (at least 444, but more than likely it should be 755) and check the owner and group as well.

kylegetson 16 Junior Poster in Training

this can also be accomplished by doing multiple vhosts for the same IP. The first one as a proxy (which will be taken by default when the proxy request doesnt match the the host name of any other vhosts, followed by the actual reverse proxy vhost. seems to do everything i want, but still makes me duplicate the vhost.

hope that helps someone else. if someone finds a better solution, let me know.

kylegetson 16 Junior Poster in Training

I found a solution that works... but is not ideal.

If i make the vhosts on separate ports, I can do a reverse proxy on the typical port 80, and the forward proxy on a different port (as it will be restricted to only me anyway).

Any ideas?

kylegetson 16 Junior Poster in Training

I am looking to have both a forward proxy, and a reverse proxy at the same time. It seems as though, when I do this, the Proxy definition I put in place to restrict access to the forward proxy also effects the reverse proxy.

...
#... inside my virtual host
 RewriteEngine on

ProxyPass / http://mydomain.com/
ProxyPassReverse / http://mydomain.com/

ProxyRequests On
<Proxy *>
Order Deny,Allow
Deny from all
Allow from My.IP.Here
</Proxy>

...

This works, although, the ProxyPass (reverse proxy) takes in the Proxy definition, Deny, Allow from My IP only.

Anyone know a way to restrict access to the forward proxy (I should be the only one allowed) but leave the reverse proxy open to anyone on any IP?

any suggestions would be appreciated.

kylegetson 16 Junior Poster in Training

Try:

$myVar = "data[1]['items'][4]['items']";
$$myVar = 'xyz';

The two dollar signs I think is what you'll need, though I have never tried it with indexes like this.

hope that helps.

kylegetson 16 Junior Poster in Training

When creating links use:

$id=33;
$page=1;
$link = "index.php?id=".base64_encode($id)."&page=".base64_encode($page);

Then when getting those variables:

$id = base64_decode($_GET['id']);
$page = base64_decode($_GET['page']);

hope that helps.

kylegetson 16 Junior Poster in Training

using php base64_encode and php base64_decode can help as well.

never run a query on data you unsure about.

also, its a good idea to restrict the permissions of the mysql user your scripts are using, so in case someone does get in, they can't create, alter or drop tables. require an additional login before allowing those type of queries.

backup early. backup often.

darkagn commented: Great suggestions +3
kylegetson 16 Junior Poster in Training

I've done some similar work, there is a lot of code already written. Heres one class already written that may help:
http://www.micahcarrick.com/04-19-2005/php-zip-code-range-and-distance-calculation.html

kylegetson 16 Junior Poster in Training

if you have an auto increment field, just use mysql_insert_id() to get the last auto increment

kylegetson 16 Junior Poster in Training

would it not make more sense to have all this data in 1 table? if your table names are literally differentiated by a number, just add a field to your table structure. So instead of having 62 tables, have 1 table with the following fields:
date, user, url, short_url, TableNumber

Then you can have 1 simple, quick query to get what you need.

kylegetson 16 Junior Poster in Training

yes, just append the ID to the url as your building your links. If your using something like wordpress (and maybe other blog/cms systems) there are functions for this. Wordpress has a function add_query_args() that allows you to easily append/remove things from the URL.

kylegetson 16 Junior Poster in Training

In that case 'searchme' would be the name given to the results of the concat column. I think your missing a comma:

SELECT *, ( CONCAT(string1,' ',string2) as searchme ) FROM table WHERE searchme LIKE "$search"
kylegetson 16 Junior Poster in Training

Yea, no point in suggesting possible solutions, they are endless, and would be a waste of everyones time. Find out what your host allows, or at a minimum, some specifics on your setup.

kylegetson 16 Junior Poster in Training

Assuming you use the URL
http://www.mywebsite.com/myfile.php?ID=5

$ID = $_GET['ID']; // this would have 5 as a string, that could actually be anything (like SQL to inject)
$ID = intval($_GET['ID']); // this would have 5 (as a int) you could use this in a query without worry of injection (though the number could be different than you expect)

You could also use encoding, like base64_encode() and base64_decode() to put variables on the URL. Hope that helps.

kylegetson 16 Junior Poster in Training

Youll need to use some server side scripting to do this. What type of server are you using?

kylegetson 16 Junior Poster in Training

relying on the URL and $_GET variables can leave you vulnerable. It can be safe, when done correctly. The most important thing, is you need to verify the data, before you try to do something with it. Specifically when adding/modifying/deleting things from a database, be sure the person should be able to perform that action.

I would try to keep it to a minimum, but passing an ID or something isnt bad... just make sure its a (valid) number.

kylegetson 16 Junior Poster in Training

using an .htaccess file you can redirect your old product pages to your new ones. search engines will pick this up over time, but it will help those people that click on old links, they'll get to the right place.

I'd also suggest creating a friendlier 404 page, so you don't lose visitors.

It looks like you've got an xml sitemap, make sure its updated with the new URLs.

definitely investigate your crawl errors.

hope that helps.

kylegetson 16 Junior Poster in Training

if your looking to concatinate (combine) two strings, in php, use the dot (.).

$a = "string1";
$b = "string2";
$combinedStrings = $a . $b;

But it looks to me like your trying to combine the strings in the wrong place, unless you have a column with the name of two of your other columns combined?

kylegetson 16 Junior Poster in Training

if your using an embed tag, you can do loop=true. But are you trying to embed an AVI file? thats definately not a good idea

kylegetson 16 Junior Poster in Training

I currently use phpDesigner. I like it cause its a very easy and light solution. I've used dreamweaver, but it definately lacks alot of features of an development IDE. I've also used Aptana and Netbeans. Both are pretty solid, but require a lot of resources.

Id recommend Apache as you can learn about it's configuration at the same time as learning php.

definately agree. Theres alot you can learn by playing with apache, I personally wouldnt suggest doing it on windows, unless that's where you'll be spending most of your time.

I do alot of development for Wordpress, so I have a few themes, functions, and classes I work from.

I havnt had the time, but I my next plan is to learn Symfony (the framework), it looks pretty cool.

kylegetson 16 Junior Poster in Training

Your issue is your using single quotes ' instead of double quotes " as a string with a variable in it.
on line 48 you have:

createthumb('$dir1','$dir/thumbs/$photo1',100,100);//Not working(problem here only)

Try:

createthumb("$dir1","$dir/thumbs/$photo1",100,100);//Not working(problem here only)

the problem is, that when you use single quotes '$myvar' will actually be the string $myvar instead of the variable myvar. PHP does not parse inside single quotes, only double quotes.

hope that helps.

kylegetson 16 Junior Poster in Training

I agree with what everyone else said. There are solutions to make things easier, frameworks for instance make building forms/database input easier and faster, but without knowing your way around is going to make installing a framework, and making it work for you, instead of against you, pretty difficult.

good luck.

kylegetson 16 Junior Poster in Training

You would need to start with fopen, curl, or any other http request function. Youll then have to parse the html returned using a regular expression search to find the pieces of the header your looking for.

hope that helps.

kylegetson 16 Junior Poster in Training

Heres the sample from SACK Simple Ajax Code Kit

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<title>Simple AJAX Code-Kit (SACK) Demonstration</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="author" content="Gregory Wild-Smith" />
	<meta name="copyright" content="Gregory Wild-Smith" />
	<style type="text/css" media="screen">
		@import url( style.css );
	</style>
	<script type="text/javascript" src="tw-sack.js"></script>
<script type="text/javascript">
var ajax = new sack();

function whenLoading(){
	var e = document.getElementById('replaceme'); 
	e.innerHTML = "<p>Sending Data...</p>";
}

function whenLoaded(){
	var e = document.getElementById('replaceme'); 
	e.innerHTML = "<p>Data Sent...</p>";
}

function whenInteractive(){
	var e = document.getElementById('replaceme'); 
	e.innerHTML = "<p>getting data...</p>";
}

function whenCompleted(){
	var e = document.getElementById('sackdata'); 
	if (ajax.responseStatus){
		var string = "<p>Status Code: " + ajax.responseStatus[0] + "</p><p>Status Message: " + ajax.responseStatus[1] + "</p><p>URLString Sent: " + ajax.URLString + "</p>";
	} else {
		var string = "<p>URLString Sent: " + ajax.URLString + "</p>";
	}
	e.innerHTML = string;	
}

function doit(){
	var form = document.getElementById('form');
	ajax.setVar("myTextBox", form.mytext.value); // recomended method of setting data to be parsed.
	ajax.requestFile = "sackdemo.php";
	ajax.method = form.method.value;
	ajax.element = 'replaceme';
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
}
</script>
</head>
<body>
<h1>SACK Demo Page</h1>
<p><small>&#xA9;2005 Gregory Wild-Smith (http://www.twilightuniverse.com/)</small></p>
<p>Here you can play around with some of the options of SACK and it gives some example code on how to use it. This is a really basic example, but it should be a good starting point. Enjoy playing with my SACK.</p>
<h2>Playground</h2>
<form id="form" method="post" action="sackdemo.php">
<fieldset><legend>Play with these to change the …
kylegetson 16 Junior Poster in Training

If you put the pictures into an list <li> it would be easier to keep updated. You could style them to show 5 pictures per row. Then later, if you need 3 pictures per row, you can just adjust your css, rather than your entire table structure.

But if you want to do tables, heres some code that may get you started:

//$img[row][column]

$img[0][0] = "img1.jpg";
$img[0][1] = "img2.jpg";
$img[0][2] = "img3.jpg";
$img[0][3] = "img4.jpg";
$img[0][4] = "img5.jpg";

$img[1][0] = "img6.jpg";
$img[1][1] = "img7.jpg";
$img[1][2] = "img8.jpg";
$img[1][3] = "img9.jpg";
$img[1][4] = "img0.jpg";
echo "<table>";
foreach($img as $row){
	echo "<tr>\n";
	foreach($row as $col){
		echo "<td>";
		echo $col;
		echo "</td>\n";
	}
	echo "</tr>\n";
}
echo "</table>";
kylegetson 16 Junior Poster in Training

yea, I think using <?php instead of just <? to open php tags may help.

You should check the mime types that your server is using. I think you need to be sure php files are set up as application/x-httpd-php. You can do this in your mime.types file in apache, or an .htaccess file.

kylegetson 16 Junior Poster in Training

I cant say that I've ever worked with a space in a column name... but I would assume you could use the little tick marks around the name of the field.

$sql = "UPDATE Lieneke SET `Best moment` = REPLACE(`Best moment`,'$moment','$momentnew')";

If your using a tool like phpMyAdmin, you could do the update by simply editing the row and seeing how it formats the update statement.

kylegetson 16 Junior Poster in Training

sorry, should have looked closer. your missing a semicolon on line 6 of your index.php file. Also, you can't use $this outside of a method in a class. If you want $this->two to be equal to 'variable 2', you need to do that in your declaration.

private $two = 'variable 2';
kylegetson 16 Junior Poster in Training

You can also do this via css and ajax. I do it this way, so i can create a few simple classes for my cursors, and then just use addClass or removeClass whenever an event occurs that I need to change the cursor (click, hover, alert, etc.)

kylegetson 16 Junior Poster in Training

It sounds like your server is not parsing php files. What type of server is this running on?

kylegetson 16 Junior Poster in Training

You could use an ajax request, so the page wouldnt reload, it would just be sent without the user knowing. You wouldnt want that to be done onChange though, you would need to change it to onBlur.

If ajax isnt for you, the anchor would be the another solution, your users will still notice a slight 'jump' but it would bring them back to where they were.