DanceInstructor 19 Posting Whiz

If the page does not load automatically you may need to add index.php to the DirectoryIndex directive in the apache conf file.

Find your http.conf file, probably in this directory:

C:\NEMO\Apache Group\Apache\conf

Open http.conf and do a text search for DirectoryIndex

The line should look something like this:

DirectoryIndex index.html index.html.var

edit it to look this way

DirectoryIndex index.html index.html.var index.php

Save http.conf and exit. Restart the apache server and see if phpMyAdmin works.

DanceInstructor 19 Posting Whiz
DanceInstructor 19 Posting Whiz

Have you looked at this page?

DanceInstructor 19 Posting Whiz

In that case I think you will need a new query. The problem though is you can't know what the query will be if you don't know how many search terms will be entered. SQL queries are not my strong point. I suggest you make a post in the MySQL forum. I'm sure someone there will have an idea for making a query that works for you.

Good luck

DanceInstructor 19 Posting Whiz

should you register your domain name independently from your web host?

NO

That tells me that you should register it with your web host...

Of course the question was asked differently in the post....

DanceInstructor 19 Posting Whiz

The following should work. I did not post a complete solution the first time. I posted an idea :) expecting you to fill in the rest. At any rate you have something to work with now. The search is not really good as it does not take into account results that contain more than one search term, meaning if an entry has 2 search terms in it, that entry will be listed twice. Anyway I hope this helps.

<?php
$link = mysql_connect('localhost', 'root', 'vipula');
if (!$link)
{
      die('Could not connect: ' . mysql_error());
}

@mysql_select_db(test1) or die("unable to select database");

$name = $_POST['name'];
$name_arr = explode(' ', $name);
$search_result = '';

foreach($name_arr as $key => $name)
{
      $query="SELECT * FROM staffpub WHERE";
      $query.=" authors LIKE '%$name%'";
      $query.=" OR title LIKE '%$name%'";
      $query.=" OR source LIKE '%$name%' ORDER BY title";
      $result_arr[$key]=mysql_db_query("test1", $query);
      $num_rows_arr[$key] = mysql_num_rows($result_arr[$key]);
      $search_result.= "Found $num_rows_arr[$key] results for the term $name.<br />";
}

mysql_close();

echo($search_result);

echo '<b><center><font size="4" color="#FF0000">Search Result</font></center></b><br><br>';

foreach($result_arr as $key => $result)
{
      $i=0;
      while ($i < $num_rows_arr[$key])
      {

            $row = mysql_fetch_row($result);
            $search_term = $name_arr[$key];
            $authors = $row[1];
            $title = $row[2];
            $source = $row[3];

            echo "<b>Search Term:</b> $search_term<br><b>Authors:</b> $authors<br><b>Title:</b> $title<br><b>Source:</b> $source<br><br><hr><br>";

            $i++;
      }
}

?>

One more thing:
Where I have

$authors = $row[1];
$title = $row[2];
$source = $row[3];

If you have an ID field in staffpub the above is fine. If you only have 3 columns in staffpub you will need them to be defined this way:

$authors = $row[0];
$title = $row[1]; …
DanceInstructor 19 Posting Whiz

I think you guys should read the question again.

DanceInstructor 19 Posting Whiz

No that won't work, I don't have time now but I will reply in 6 hours or so with something that does :)

DanceInstructor 19 Posting Whiz

Ahh, that worked like a charm. Thanks man :)

DanceInstructor 19 Posting Whiz

It was interesting to find out about John Chambers and CISCO. Its admirable that he was willing to sacrifice his pay to help the company, instead of trying to bleed it dry and get out....

DanceInstructor 19 Posting Whiz

You can use explode to create an array from $name (users input) like so:

$name = $_POST['name'];
$name_arr = explode(' ', $name);

then create a seperate query for each search term in your array:

foreach($name_arr as $key => $name)
{
$query="SELECT * FROM staffpub WHERE";
$query.=" authors LIKE '%$name%'";
$query.=" OR title LIKE '%$name%'";
$query.=" OR source LIKE '%$name%' ORDER BY title";
$result[$key]=mysql_db_query("test1", $query);
$num_rows[$key] = mysql_num_rows($result);
}

Now you have an array of results and the corresponding num_rows in 2 arrays.
I suppose you could still search for the user input as one string, or as combinations of terms(if there is more than two words input) to get more valid results if they exist. There are many ways you can proceed from this point. Make sure that you check out www.php.net if you have not already. Also the function reference is VERY useful.

DanceInstructor 19 Posting Whiz

DaveSW I hope you will help me :)

At this site. There is a vertical menu on the left side of the page. It uses some javascript for styling and animation. It works fine and looks good in firefox, but in IE as you hover over the different menu options the background will disappear and in the status bar you will see a message about downloading images. All classes in the rollover have the same background image. Any ideas as to how to prevent the flicker and redownload?

Thanks

DanceInstructor 19 Posting Whiz

In your config you have:

$table_name ="authusr";

but in your query in create.php looks like this:

CREATE TABLE IF NOT EXISTS authorize
(
firstname VARCHAR(20),
lastname VARCHAR(20),.....

and then have:

echo "<p>$table_name has been create.</p>";

so you have not created the table authusr, but have created the table authorize. You can change your query to look like this and things should work better:

$sql ="
CREATE TABLE IF NOT EXISTS $table_name
(
firstname VARCHAR(20),
lastname VARCHAR(20),
username VARCHAR(20),
password VARCHAR(30),
email VARCHAR(100),
authority VARCHAR(20),
redirect VARCHAR(100)
)
";

Happy New Year :)

DanceInstructor 19 Posting Whiz

GL either way.

DanceInstructor 19 Posting Whiz

I don't know bout the short term time problems, but long term using a cms could save you lots of time. Updating webpages as easy as making a post!

I don't plan to update my website more than once a week, but I still plan to move it over to a Mambo backend. Probably way more backend than I need, but then again I'm a geek :cheesy:

You know (my personal feeling). Any time you deal with people, effort and frustration are going to be involved :twisted:

DanceInstructor 19 Posting Whiz

Maybe you didn't post all your code.... But I don't see where you have retrieved your variables from $_POST. You will either need to assign them at the top of the script like this:

$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
etc....

or use the $_POST variables in your query:

$query="INSERT INTO $table ('firstName', 'lastName',.......) 
VALUES ('{$_POST['firstName']}', '{$_POST['$lastName']}',...)";

I prefer the first way so the query looks cleaner and has less syntax for me to screw up ;)

DanceInstructor 19 Posting Whiz

Could you post your code pls. It will be much easier to help you if we can see your code. Let's start with the page you use to create the database and table.

DanceInstructor 19 Posting Whiz

Yeah what you said. Easy!

lol

DanceInstructor 19 Posting Whiz

It doesn't update right away. It will go away soon don't worry...

DanceInstructor 19 Posting Whiz

Option 1:

Create a page - index.html. Put it in your main webroot ex: www.todaysfishing.com/index.html. In that index.html put this in your header:

<head>
<meta http-equiv="refresh" content="0;URL=http://www.todaysfishing.com/forums/" />
</head>

If you choose this option you could add some text in <h1> tags for seo purposes. Leave the text black and set the background black and the user just sees a flash of black and then the forum, but the search engine would see your seo optimized text.

Option 2: (the better option really, but more complicated possibly)

If you are on an Apache server you can use mod_rewrite. You could add something like this to your .htaccess file:

RewriteEngine  on

RewriteCond %{HTTP_HOST}   !^www\.todaysfishing\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^(.*)         http://www.todaysfishing.com/forums$1 [L,R]

I'm not that great with mod_rewrite so the above may need some modification. There is a nice tutorial on mod_rewrite here

DanceInstructor 19 Posting Whiz

Have you looked at Mambo? There should be a way to set it up so that the user has an account to add articles, but not have admin priviledges. When I first looked at Mambo it was pretty confusing to me, but after playing with it for a couple of days I came to like it. Its like anything else, it takes time to learn it.

DanceInstructor 19 Posting Whiz

To remove a directory:

rmdir('directory_name');

Killer_Typo commented: very much helpful!! +1
DanceInstructor 19 Posting Whiz

Well you could have the header and footer info in 2 files. Then when they update you could have a script read the header file into a string, then add the updated content to the string, then read the footer file into the string as well. Take the complete string and write it to a .html file.

Unfortunately there is no perfect solution.

The other option is to use mod_rewrite to make the search engine see the php page as static. Like Daniweb has done :)

DanceInstructor 19 Posting Whiz

There is more than one way to do this. Do you want to use an i-frame (probably not)? If not this is one way:

<html>
<head>
stuff..
</head>
<body>
template stuff...
<!--  time for user content -->
<?php
include_once('user_content.php');
?>
more template stuff...
</body>
</html>

As far as I know for this to work the template page has to have the extension .php

DanceInstructor 19 Posting Whiz

Its kind of hard to tell since there is a scripting language involved, but we definitly should not be able to see the following in your source code:

<% if($mc->hasVirtualTours() && $mc->hasOpenHouses())
   {
     $cellWidth = 25;
   }
   else if(!$mc->hasVirtualTours() && !$mc->hasOpenHouses())
   {
     $cellWidth = 50;
   }
   else
   {
     $cellWidth = 33;
   }  
   if($mc->hasVirtualTours()) 
   { %>

More than likely you have not closed a script tag properly or have an extra ' " or something of that nature.

Does comcast support server-side scripts? That is the other possibility, that the script is not executing because the server doesn't support it.

DanceInstructor 19 Posting Whiz

Unless $some_value is an array itself....

DanceInstructor 19 Posting Whiz

Yes this should be possible. There may be some scripts already written to do this although I am not aware of them. You could try searches on google and yahoo to see what you can find. If you don't find anything useful, you will find most of the php functions you will need here.

DanceInstructor 19 Posting Whiz

An update on this. I have just found out that TRUNCATE `table`; works on MyISAM databases for MySQL to reset the autoincrement value, but not neccessarily other types. It does NOT work on InnoDB types.... If you want to change the table type in MySQL you can do this:

ALTER TABLE `database_name`.`table_name` TYPE = MYISAM;

Then it will be easier to modify or reset the autoincrement value.

DanceInstructor 19 Posting Whiz

It would be cool if you posted your code. That way noone would have to guess if they didn't understand your description of the problem...

DanceInstructor 19 Posting Whiz

I have a suggestion for any forum that deals with job offers. How about locking posts that are more than a month old?

[RANT]
When I come to the forum I browse thru most of it. The only places I don't check very often are: software development, tech talk, and coffee house. Otherwise though, if there is a new post I see it. It usually takes me 20-30 minutes to look through everything (yeah I know I don't have to) and that's if I'm not responding to posts (I try to help :)) So, when I look in the "Webmaster / Designer / SEO Job Offers" forum and find that someone has replied to posts that are over 2 months old, it irritates me that I took the time to look. Honestly, if you reply to a post about a job from 2 months ago, do you think you have a chance at getting it? No you don't. You are just spamming. AAAAYYYYEEEE!! maybe I should get some sleep.
[/RANT]

DanceInstructor 19 Posting Whiz

Try this to see what is in your array:

echo('<pre>');
print_r($My_Array);
echo('</pre>');
DanceInstructor 19 Posting Whiz

One way to do it would be to make an animated gif as the mouseover image. I could make gifs for you if there aren't too many of them. Just be sure of the size though, wouldn't want to do it twice :)

DanceInstructor 19 Posting Whiz

You can escape problematic characters with \ so to have a % inserted into the database it would have to look like \% in the query. You can read more about it here. There is also a high probability that VB (I'm not familiar with VB) will have a function to escape strings for mysql (PHP does :))

DanceInstructor 19 Posting Whiz

Try this:

<input type=\"radio\" name=\"question[]\" value=\"1\">$row[2]<br />
<input type=\"radio\" name=\"question[]\" value=\"2\">$row[3]<br />
<input type=\"radio\" name=\"question[]\" value=\"3\">$row[4]<br />
<input type=\"radio\" name=\"question[]\" value=\"4\">$row[5]<br />

You also may need to add this somewhere:

$My_Array[] = $_POST['question[]'];

or maybe just:

$My_Array[] = $_POST['question'];

can't remember lol.

DanceInstructor 19 Posting Whiz

If you empty (TRUNCATE) the table it will go back to zero.

DanceInstructor 19 Posting Whiz

I voted yes, but I really don't have a strong opinion one way or another.

[j-k]
With my luck I would find that all the people living near me would hate me lol
[/j-k]

DanceInstructor 19 Posting Whiz

I think this tutorial will teach you most of what you need to know.

Making Universal Pop Ups

DanceInstructor 19 Posting Whiz

Hehe Dani I'm 32, I'm sooo livin in tha 90s :p

Tans, when I try to do tans in photoshop they always seem to come out peachy or just not tan :(

Yes I have da colormixer bookmarked, thanks :)

DanceInstructor 19 Posting Whiz

dreamincode???? never heard of it :p Hehe

DanceInstructor 19 Posting Whiz

Its for my site. The one in my sig. :) Oh yeah, I hope to turn this into a Mambo template...

DanceInstructor 19 Posting Whiz

So it is lol.

DanceInstructor 19 Posting Whiz

I got past my earlier jaggies issue :) and now I'm trying to decide on some colors. The one thing I would like to keep in this pic is the red circle, I'm open to changing other stuff though. What does everyone think? What colors should I use?

DanceInstructor 19 Posting Whiz

Funny thing. Semi related to this. If you type in the keywords I set my site up for, I don't show up on Google, but daniweb does. Google rates daniweb higher than my site due to links. So type in "dance teacher country raleigh nc" and you will see that the 6th result is me posting on daniweb lol.

DanceInstructor 19 Posting Whiz

That looks great, but yes the curved line segments :( You don't have to do it for me :p Thanks for trying to help :)

DanceInstructor 19 Posting Whiz

That's no fun :( It didn't work well for me.

DanceInstructor 19 Posting Whiz
$message = "$name$teamname$email$tiebreaker$team\";

I think should be this:

$message = "$name$teamname$email$tiebreaker$team";

or is that the first error you fixed?

Try echoing all your vars to the browser so you can see what they look like.

echo($_POST['name']);
echo($_POST['teamname']);
etc...

My guess is one of the _POST vars is not defined which would mean there is a misspelling in your submission form.

DanceInstructor 19 Posting Whiz

I would like to smooth out some jaggies in a picture without making it too blurred, does anyone have any suggestions?

DanceInstructor 19 Posting Whiz

LOL Personally I like it, but I guess for the mainstream it may be a bit much.
Me <== not mainstream
or should that be:
Me != mainstream

DanceInstructor 19 Posting Whiz

Did you try using the background for the post title and the signature?

DanceInstructor 19 Posting Whiz

Maybe you could use an iframe? You can make the frame small so the user may not even know it is there. Load a form into it initially to call your php function and then read the results with the javascript once it reloads....