Hi Everyone,
I fixed the problem. It was simply I didn't have mod_rewrite enabled. Something that simple should have been checked earlier, but I am know for these mistakes! :D
Shanti C commented: Good Helping.... +2
Hi Everyone,
I fixed the problem. It was simply I didn't have mod_rewrite enabled. Something that simple should have been checked earlier, but I am know for these mistakes! :D
Hello,
I am currently having a problem with .htaccess. I am trying to use mod_rewrite to rewrite: http://www.example.com/test/test?word=test to http://www.example.com/test/test.php?word=test. The only problem is the GET vars can have different names. So another example url could be http://www.example.com/test/test?test=true&form=1 or even http://www.example.com/test/test?search=Google&type=Web etc. For this I wrote a simple PHP script called test.php that simply uses foreach to write all the GET variables to the screen. Then I used this .htaccess file to do the rewriting:
RewriteEngine on
RewriteRule ^test/?([.])?$ test.php/?$1 [L]
It should rewrite test?some+vars+here to test.php?some+vars+here but for some reason it doesn't. The test page is diplaying perfectly, but for some reason mod_rewrite won't rewrite the GET vars in. I am using Apache 2.2. Can some mod_rewrite expert help me. This is urgent!!!!
Thanks so Much!!!
FlashCreations
Here is what I suggest (Might Sound Complicated):
Create a SQL database with a table that has a seat name, number, and section, etc. and then a value if the seat is filled. Then have php create a table and fill the empty seats with a bgcolor of red (#FF0000). The empty seats will link to a reservation program that will edit the MySQL table. You might want to ask your teacher for help if this assignment seems hard. I can also help (but i can't provide code!!!). Good Luck :D
You would probably want to use a MySQL table to store the emails. Then all you would have to do is write a php script that you can use to send email (Just make sure to password protect it for security!!).
PHPList is a pre-coded, easily customizable PHP mailing list application. Check it out on their website (Note to Mods: I'm not advertising this product as it's free. I'm simply providing a pre-coded resource that might be easier to understand/use).
Just a suggestion:
On line 17 I would not include the SQL query. While the chances of a bad person seeing this kind of information is unlikely, it adds some vulnerability to your site. Simply use this code:
$result = mysql_query($query) or die ("MySQL Error: ".mysql_error());
Well, I would start out by making a rectangle that is the same color as the background (Important: Make sure the shape's color has a transparency of 1%) to cover the whole stage with the rectangle tool. Next, convert the new rectangle to a shape (Make it a button). Then add AFLAX to the button that sends a message to a server page on a click.
Note: If that seems too complicated you may also try another method I though of (I'm not sure if it works!!). Add the parameter border=0 to the Flash Element and then surround the whole object in <a href='javascript:void(0);' onclick='sendMessage()'> ... </a>
. Then simply, using regular AJAX, write a javascript function that calls the server page and call it 'sendMessage()'.
Good Luck!!
If you don't have scripting abilities you may consider an external Javascript file. Take this example:
header.js:
function header()
{
document.write("MySite <a href='index.html'>Home</a> <a href='about.html'>About</a> etc. "); //Put the header code here
//Note when placing the header code, make sure you replace " (Double Quotes) with /" (Slash and then Double Quote). Ex. /"I have a dream/"
}
For the pages you want the header:
Simply put this between the <head> and </head> tags:
<script type='text/javascript' src='header.js'></script>
And place this where you want the header:
<script type='text/javascript'>
header();
</script>
I would reccomend the PHP, since it is server side (and not executed on the client's browser) if possible. Here's an example:
header.php (Place your header's code in here):
MySite <a href='index.html'>Home</a> <a href='about.html'>About</a> etc. <!-- This is just a sample. Replace this line with your code -->
For a page that you want to put the header simply type:
<?php include('header.php'); ?>
Just make sure PHP is enabled.
Best of Luck,
FlashCreations
Ok thanks for the help!!
Try AFLAX. It is an AJAX for Flash. You can use some ActionScript to call an AFLAX command to send a message to a Server Page (I prefer PHP, but you can use anything that you are comfortable with) which processes the request and updates the record in a file or MySQL table. If you have any more questions please post them here or PM me!
Good Luck! :)
Hello,
I have a question about PHP. I realized that you can use the POST variable to get data from a form submitted with the type post, but does the order of the fields matter. Example:
index.html:
<HTML>
<HEAD>
<TITLE>Form</TITLE>
</HEAD>
<BODY>
<FORM name='test' action='submit.php' method='post'>
Name: <INPUT type='text' name='name' /><br />
Programming Language <INPUT type='text' name='lang' /><br />
<INPUT type='submit' value='submit' />
</FORM>
</BODY>
</HTML>
Here's the code for submit.php:
<?php
//This code works
echo $_POST['name'];
echo "<br />"
echo $_POST['lang'];
//But if I flip the two, it doesn't.
echo $_POST['lang'];
echo "<br />"
echo $_POST['name'];
?>
My question is: Why does flipping the two POST vars make this code not work? If there is a way (besides of course writing it as the values are ordered, which will be hard since I am not sure what order the form's elements will be in) to get by this? Thanks Everyone for your great help!!!
Wow that's really cool. I am probably going to use this on further projects!!! Thanks for your help everyone!!!!
Hello,
I was browsing DaniWeb and found a code snippet that allows PHP files to be static and more search-able by browsers. I notice that certain pages of DaniWeb are PHP (such as this new thread page), yet most are html files. I know this may seem nosy, but I am interested in how this is possible with dynamic content such as a form. How is it done?
Thanks!!
Oh, I see. I just wondered since after some poking around, I noticed most other major search engines use python too! Thanks!
Here is an interesting statistic:
Yahoo has hundreds of HTML/CSS errors that don't comply with standards.
No website is absolutely prefect when it comes to standards. (Not like I'm volunteering to check!!!). I would suggest simply using a less-strict standard. I usually code in XHTML 1.0 Transitional.
Hello,
If you have ever looked at the URL of a Google search (I'm sure we all have!) you will notice that the script called is called search. So a search could be http://www.google.com/search?q=Dani+Web
. I notice that the search script file has no extension such as PHP or JSP. Does anyone know what language this is and if so, could you provide some information about it. Thanks!!
Thanks for the Tip!! I found another way also. Go to the run prompt and type Sfc /Scannow
!! It restores all the file back to normal and fixes all my file!! Yay!!
Hello,
I installed the Vista Transformation pack a few weeks ago and I have decided to remove it and replace it with a nicer looking theme that Lifehacker wrote about. I restored my computer back to before the installation, but for some reason there are still parks of the pack left. I now realized that it was a bad idea to install the pack in the first place, but I need a way to completely restore my computer. Here are some of the major issues:
And there are other little bits of the transformation pack that are still here that I would like to rid of. I realize I made a horrible mistake and please do not lecture me on my mistake. I understand now with the look of XP. If anyone has a solution to one of my specific problems or if you have a way of completely getting rid of the Transformation Pack please post it, your help is greatly appreciated! (I am also very good about giving people who reply reputation points!!!)
By the …
Ok Thanks!!!
Cool! Thanks for the help!!
Hello,
I am creating a feature for a site, that when you click a button changes specified text to a textbox that lets you edit the text. When the user presses enter, the textbox will dissapear and the text typed will be in it's place. This is so I don't have to a PHP script a bunch of times. The Javascript uses AJAX to submit that data and the page doesn't refresh. My problem is with the second step. The text will change to the textbox, but the onKeyPress teg is not displaying right. It should look like this:
onKeyUp="SDcheck(event, 'test', this)"
Yet it actually looks like this:
onKeyUp="SDcheck(event, " value=test")"
Here is my code:
<script type="text/javascript">
function EditBox(box, box2)
{
var textP = document.getElementById(box);
var text = textP.innerHTML;
textP.innerHTML = "<input type=\'text\' value=\'"+text+"\' id=\'"+box2+"B\' onKeyPress=\'SDcheck(event,\'"+box2+"\',this)\' />"
document.getElementById(box+'B').focus();
}
function SDcheck(even, id, element)
{
var characterCode;
if(e && e.which){
e = e;
characterCode = e.which;
}
else{
e = event;
characterCode = e.keyCode;
}
if(characterCode == 13){
var text = element.value;
document.getElementById(id).innerHTML = text;
return false;
}
else{
return true
}
}
</script>
<span id="test">Test</span> <a href="javascript:EditBox('test');">Edit</a>
Please Help me correct this problem!!!
Thanks!!
No, but I would start off with a basic HTML form like such:
<form name='example' action='submit.php' method='post'>
How would you rate the following? Select 1-5 for each.<br/>
HTML: <select name='HTML'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select><br/>
JavaScript: <select name='JS'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select><br/>
PHP: <select name='PHP'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select><br/>
ASP: <select name='ASP'>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select><br/>
</form>
Once you have that, go to W3Schools and learn some JavaScript to validate the users selections. Then you can write a PHP (I recommend it) file to tally the selections and place them in a MySQL Table for result viewing.
I would be a great help if you posted your code so we can see exactly what you are talking about!!!
Good idea!! Just one question. I was thinking that if there was a special account on the computer (XP) then that would mean that the account would have to auto load with XP so XAMPP was always running. Is there any way to automate this?
Thanks. It's always a ridiculous mistake like that with me!!!! :D
Hello Everyone,
I have a little problem with my PHP script. I have created a very detailed system using PHP and wish to upload it to a computer running XAMPP on my network. Because the file will be uploaded to a normal computer all of my PHP files will be accessible to anyone with the password to this computer. There are certain people that have access to this computer that would be nosy and want to look at/modify my code. Anyway, long story short, I would like a way to password protect the file when trying to acess it directly from the host computer, but still allow users on the network to use the file (ie. View the home page the PHP produces). I realize that this sounds really paranoid, but the server is not physically in my house so I have no way of knowing who accesses the computer (A few do on a regular basis). If you know of a way to do this, please post.
Thanks so much everyone!!!
Cool! Thanks!!
I would suggest first learning CSS. It has become a web standard for styling HTML text, images, etc. Once you have a very good understanding of CSS (It's pretty important to know it!!!), I would suggest going on to JavaScript. If you are creating forms you will want to have code to validate the fields before the server is sent the request. Lots of other elements require JavaScript such as FAQ's with Show/Hide Toggle Buttons, Fading Effects, and other tasks that can be accomplished from the user's browser.
After you have a very good understanding of the basics (HTML, CSS, and JavaScript), then you can go on to a more advanced server-side language such as PHP. I am mainly a PHP programmer so I would definitely suggest PHP. It has easy access to SQL databases which you will find very useful from user accounts to creating a simple polling script. All of the server side languages are great it just depends on what you want to get accomplished and what the capacity of your server is. Whatever your decision, I would recommend W3Schools as a great source for learning these languages.
Since server-side languages aren't interpreted with the user's browser, you will need a server to practice with server-side code. Instead of getting free hosting somewhere and having to upload the file every time you save, you can get XAMPP. It is a server that runs on your personal computer and supports Apache (HTML) …
Hello Everyone,
I was browsing the web today and I cam across a site that had a file called script.do. I have never seen this .do extension and I was wondering the language that it referred to. If anyone knows what the .do programming language is, please tell me. Also, if you have any resources on learning how to program in this language, please post them too!!
Thanks!!!
Hello,
I have a problem with my form validator. For some reason it will always return true when it should return false and display and error message (either about a blank username or password).
Here is my javascript:
<script type='text/javascript'>
function ValidateLogin(form)
{
var error=false;
document.getElementById('userError').style.display = 'none';
document.getElementById('passError').style.display = 'none';
document.getElementById('invalidError').style.display = 'none';
document.getElementById('usedError').style.display = 'none';
document.getElementById('loading').style.display = 'block';
document.getElementById('submit').style.display = 'none';
with(form)
{
if(pass.value==''||pass.value==null)
{
document.getElementById('passError').style.display = 'block';
error=true;
pass.focus();
}
if(user.value==''||user.value==null)
{
document.getElementById('userError').style.display = 'block';
error=true;
user.focus();
}
if(error==true)
{
document.getElementById('loading').style.display = 'none';
document.getElementById('submit').style.display = 'block';
return(false);
}
else
{
return(true);
}
}
}
</script>
And here is my HTML (JavaScript Included):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TSS SGA Voting System - Login</title>
<style type="text/css">
body {
font: Arial, Helvetica, sans-serif;
font-weight: normal;
font-size: medium;
color: #FFFFFF;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
a, a:visited {
color: #FFCC00;
text-decoration: none;
}
a:hover {
color: #FFFF00;
text-decoration: underline;
}
#box #content #loading {
display: none;
}
#box #content #userError, #box #content #passError, #box #content #invalidError, #box #content #usedError {
display: none;
color: #FF0000;
font-size: 14px;
}
#box #content #mError, #box #content #sError, #box #content #tError {
display: none;
color: #FF0000;
font-size: 14px;
}
</style>
<script type='text/javascript'>
function ValidateLogin(form)
{
var error=false;
document.getElementById('userError').style.display = 'none';
document.getElementById('passError').style.display = 'none';
document.getElementById('invalidError').style.display = 'none';
document.getElementById('usedError').style.display = 'none';
document.getElementById('loading').style.display = 'block';
document.getElementById('submit').style.display = 'none';
with(form)
{
if(pass.value==''||pass.value==null)
{
document.getElementById('passError').style.display …
Exactly, but try it, it really works. Actually now I believe they're doing some maintenance. When it's back up, try it. It actually works!!!
Ok then, try this:
<?php
session_start();
if(session_is_registered('user'))
{
$user=$_SESSION['user'];
$del="DELETE FROM online WHERE user='$user'";
$result=mysql_query($del);
if($result==true)
{
echo "<h3>Member Offline</h3>\n";
}
else
{
echo "<h3>Failed to Logoff</h3>\n";
}
//Remove the Session Vars
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();
//include"index.php";
}
else
{
include "index.php";
}
?>
How about then using something like this:
product.php?cat=3&product=Studio-8
Amazon uses a system that has a product name with spaces replaced with dashes and then a number (Probably the product number). Example of a Amazon URL:
www.amazon.com/Macromedia-Studio-Win-Mac-Version/dp/B000CS3S04/ref=sr_1_6?ie=UTF8&s=software&qid=1222636154&sr=8-6
How about trying a Google search? You could search within the HTML for your Javascrpit code. If you would like it in script form, try using the Google Ajax Search widget and simply count the results!!!
Well I would suggest giving each product a category (that has a cat number) and then within each category, give each product number (id). Then the address would be something like: products.php?cat=5&id=1
With that you could also use it to browse each category with one PHP script.
Ex.
products.php?cat=5
Try looking at some popular shopping sites such as Amazon and see how they do it. It's always best to learn from the Pro's!!!
Feel free to PM me if you need any help!!!
Please post the link. Also note, that most of the time, Dreamweaver's deign mode is not what you will see in your browser. It's best to simply switch between Code mode and an internet browser with the page loaded.
Also, with the price of ink today, many people are using freeware programs to remove the background from printed documents to save ink and paper!!
Javascript. You can use it's date function to put the time, etc. into the field. Create a javascript function to validate your form and the add onsubmit="return Validate(this);"
to your form. The validate function can validate the form and then if valid, put the date, etc into a textbox and submit. If you need specific help with Javascript validation, please feel free to PM me.
Here is an example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My Form</title>
<script type="text/javascript">
function Validate(form)
{
with(form)
{
if(name.value==''||lang.value=='')
{
return(false);
}
else
{
date.value = Date();
return(true);
}
}
}
</script>
</head>
<body>
<form name="form" action="myscript.asp" id="form" method="get" onsubmit="return Validate(this);">
This is an example form:<br />
Name: <input type="text" name="name" /><br />
Programming Language: <input type="test" name="lang" /><br />
<input type="hidden" name="date" value="" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
Well, you could disable embedding on the video, but that probably wont fix it. The best thing to do would be to not upload videos that you don't want that to happen to. Like the age old saying: "Once on the internet, always on the internet." No matter how hard you try once you post something it will never leave.
Well, I'm not expert with PHP, but I would suggest creating an SQL table called onlineUsers or somthing like that. Then when users login a PHP script adds them to the table. When they logout, simply remove them from the list.
Something like:
<?php
//Log the user in
$con = mysql_connect("localhost","username","password");
mysql_query("INSERT INTO onlineUsers (username) VALUE ('$username')") //Assuming the user's username is stored in $username
?>
And on Logout:
<?php
//Clear Cookies, etc.
$con = mysql_connect("localhost","username","password");
mysql_query("DELETE FROM onlineUsers WHERE username = '$username'") //Assuming the user's username is stored in $username
?>