Ok, well try this:
$arrivaldate = mysql_real_escape_string(date("Y-m-d",strtotime($_POST['arrivaldate']));
Ok, well try this:
$arrivaldate = mysql_real_escape_string(date("Y-m-d",strtotime($_POST['arrivaldate']));
Yeah, I'd say something like:
$arrivaldate = mysql_real_escape_string(strtotime($_POST['arrivaldate']));
would work. Try it out and post back.
You'll want to format the date back prior to doing the insert. So, in the script you use to process the form data, use strtotime to convert the string to a timestamp. Then insert the data.
You could use str_replace function to replace "//" with "/".
$uploadsDirectory = $_SERVER['DOCUMENT_ROOT'] . $directory_self . 'uploaded_files/';
$uploadsDirectory = str_replace("//","/",$uploadsDirectory);
There are many other ways of fixing the problem. str_replace just seems the easiest to me.
If the user_id data type is numeric, then it won't need single quotes in the sql.
$sql = mysql_query("INSERT INTO shoutbox (index, user_id, username, message) VALUES(' ', $user_id, '$username', '$message')");
This could also apply to the index, however since you are inserting an empty value, I would assume the datatype is not numeric.
You could start off with basic data validation. Pumping all of the fields into the db without checking even one of them? That's just asking for injection.
No, you'll have to show some kind of effort first. The site is called daniweb. Not free code for the lazy.
Set a field called verified in the database with a default value of 0 or False. Then after admin verifies, have him/her set the value to 1 or True.
Please start a new thread and mark this one as solved.
Here you go:
<script type="text/javascript">
function validator(){
var valid = true;
if (document.form1.textMessage.value=='')
{
document.getElementById('tobeVisible').style.visibility='visible';
valid=false;
}
return valid;
}
</script>
It's the nesting order of the elements. For instance:
p .red { color:red }
would apply a style to elements nested in p tags with the class="red" like below:
<p>The following span is <span class="red">red</span></p>
It would display as: The following span is red
Also,
.class1 p {color:green}
would apply a style to p elements nested under elements with class="class1" like below:
<div class="class1">Bill had <p>green</p> shoes on.</div>
It would display as:
Bill had
green
shoes on.
You'll need some type of ftp (file transfer protocol) software. This will allow you to move your files from your local machine to the server that the site is hosted on. Most web editors like Dreamweaver and FrontPage already have ftp included. Otherwise, there are many free ones like Filezilla and FireFTP that will do just fine. Once the software is installed, you'll need your domain name, username, and password to connect to the site.
thanks for your reply...
can i make these type of urls with out httpd.ini file...if so tel me how to do that??????
You'll probably have to enable mod rewrite by uncommenting a line in the http.conf file located in apache/conf/ folder. You won't be able to mod rewrite without first enabling it.
li-list item; ul- unordered list; They are used to create a list in html.
Read more at http://www.w3schools.com/TAGS/tag_li.asp
Why are you trying to open an html page with fopen?
Use:
header('Location:http://www.stopaeta.org');
Have you tried using a header?
header('Location:index.php');
This will only work if nothing has been outputted to the client yet.
It's just a bunch of divs nested together with an external CSS file. You should be able to view the source code and see how it is done. You'll also want to look at the css file to see how the elements have been styled. It's all there.
Create a blank php page and put the following in to see how it should work:
<?php
$profpic="http://www.daniweb.com/alphaimages/logo/logo.gif";
?>
<html>
<head>
<style type="text/css">
body {
background-image:url('<?php echo $profpic ;?>');
margin-left: 10px;
margin-top: 4px;
margin-right: 5px;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
After you see how it works, try replacing the $profpic value with your image path.
No, throw out that completely overkill switch statement and get rid of any attributes and values in the body. We don't do it like that anymore. We use CSS. Here's the basic idea:
<?php
$profpic="whateverimage.jpg";
?>
<html>
<head>
<style type="text/css">
body{
background-image:url('<?php echo $profpic ;?>');
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
The code assumes that php has been closed with a ?> delimiter prior to the style tag
Just do this if you want to assign it to the body:
<style type="text/css">
body{
background-image:url('<?php echo $profpic ;?>');
}
</style>
Note: This should go in the head of the document.
The name the element has in the form goes inside the brackets.
So if your form has
<input name="name" type="text" id="name" tabindex="16" />
After the form is submitted, PHP can assign the value posted to the variable. Here we assign the value of the textbox above to the variable $nameField:
$nameField=$_POST['name'];
Now if you want to use that variable in your email, you'll need to use the variable just defined.
$body = <<<EOD
<br><hr><br>
name: $nameField <br>
Get it??
Wrap the code like so:
[code=php]Code goes here [/code]
As to your problem, your email contains undefined variables. For instance you define namefield as $nameField = $_POST['name'];
but in the email you send, you have the undefined variable $name instead of the defined $nameField.
Next time, wrap your code in code tags when posting to keep things neat. There are plenty of people here to help out. Keeping things neat will improve your chances of getting help.
When using heredoc, you must open and close the variable with the same identifier.
$body = <<<em
<br><hr><br>
name: $name <br>
surname: $surname <br>
email: $email <br>
telephone: $telephone <br>
comments: $comments <br>
EOD;
should be:
$body = <<<EOD
<br><hr><br>
name: $name <br>
surname: $surname <br>
email: $email <br>
telephone: $telephone <br>
comments: $comments <br>
EOD;
Also, variables in php are case sensitive, so you'll have a blank page unless you change echo "$theresults";
to echo "$theResults";
Just use > instead of GREATER THAN. Since xCount is numeric, you also won't need quotes around it. So I think:
$sql = "SELECT * FROM `textads` WHERE `expos` > xCount ORDER BY RAND() LIMIT 3";
should work.
You could use JavaScript to detect the user agent then write a link prefix variable for each link. A much better solution would be to install a testing server (WAMP, XAMPP, IIS) on your machine. This way you can access your site by typing http://localhost into the url instead of file:///C:/Documents%20and%20Settings/My%20Documents/index.htm
Are you accessing the file through localhost?
In the form element, add the attribute target="_top".
<form action="process.php" target="_top">
Have a look at all of the possible target values:
http://www.w3schools.com/TAGS/att_form_target.asp
Download xampp or wamp. They are free, small downloads, that require no to minimum configuration changes.
Here's a comparison of the two from oracle.com:
http://www.oracle.com/technology/pub/columns/hull_php2.html
Not a big fan of google I take it.
Just a wild guess, http://www.microsoft.com/expression/
Also, if you are currently a student in college, you can download a fully licensed copy free from dreamspark site.
Post the code and error messages.
www.w3schools.com will hold your hand through every step. By the time you're done there, you won't need any of the other links mentioned.
motter, in your iframe, example2.php,
<BODY <bgcolor="1F1F1F">
should be
<body bgcolor="1F1F1F">
Also, you should validate your code with W3C if you expect to have a cross browser compliant site.
I agree with keith. What happens when you have 100 users? You are going to have 100 user tables with one row of data in each. Bad design. All of this could be done with 1-3 properly normalized tables.
Put the background attribute before the background image. This has to do with the order the browser applies the attribute styles in. I would also try to get away from using all caps for the attributes.
TD.MAINCELL{
font-weight: bold;
font-size: 105%;
background: white;
background-image: url("bricks.jpg");
color: blue;
font-family: "arial", sans-serif
}
In XHTML, the background and bgcolor attributes have been deprecated. This is because they can easily be implemented with css. If you want it to validate, use
<td style="background-image:url(bricks.jpg)">
However, the best way to do this would be to put these sort of styles in an external stylesheet. This way, it can be cached by the browser and not retrieved repeatedly for each concurrent page that uses the style. This will not only clean up your html, but will also cut down on page load time resulting in a better experience for the user.
Here's a function I found on php.net that will copy the directory. I have also added an unlink code to delete the original folder after copy. This may throw a permission denied error or it may work. Good luck!
<?php
$folder = 'excel_files';
$backup = 'excel_files_backup';
full_copy($folder, $backup);
function full_copy( $source, $target )
{
if ( is_dir( $source ) )
{
@mkdir( $target );
$d = dir( $source );
while ( FALSE !== ( $entry = $d->read() ) )
{
if ( $entry == '.' || $entry == '..' )
{
continue;
}
$Entry = $source . '/' . $entry;
if ( is_dir( $Entry ) )
{
full_copy( $Entry, $target . '/' . $entry );
continue;
}
copy( $Entry, $target . '/' . $entry );
}
unlink($source);
$d->close();
}
else
{
copy( $source, $target );
}
}
?>
Do you have phpmyadmin? If so, create a table with the appropriate rows, save the excel file as a csv, and import to the table.
Have you tried it out yet?
Yes, the best way is to just save the image path. You can save the image into the database as a blob but, most say it's a bad idea. Have a read here on the pros and cons and a tut on how to do it.
Submit your site to all the major search engines.
Sign up for Google Webmaster Tools. This is will tell you the last time that google crawled your site as well as errors such as broken links. Also, submit an xml sitemap to the webmaster tools. There are several free sitemap generators and the webmaster tools will give you links to each. This will give google a roadmap to follow when crawling your page.
Lastly, swap links with other sites. If a site gets crawled and it contains a link to your site, it will bump your search engine rank.
These are just some suggestions. SEO is very complex, but these suggestions should get you in the search results.
After the body tag, throw in <a name="top"></a>
<body style="background-color:#4b2600;" onload="MM_preloadImages('images/home_over.gif','images/our-cakes_over.gif','images/Gourmet-Gifts_over.gif','images/Order_over.gif','images/Wholesale_over.gif','images/faq_over.jpg')">
<a name="top"></a>
This is supported in php. I'm not to sure if the keyword super is. Here's a simple example of this:
class Human
{
public $thirsty = 'Very thirsty!';
function drink($water)
{
$this->thirsty = 'Not thirsty!';
}
}
That will work but I would add something like an underscore to separate the two values. The page that parses the url will have to "GET" the variable s. Since it's actually two variables, you should set some type of delimiter to separate them.
Something like:
<?php
$var = $_GET["searchvalue"];
$partner = $_GET["partnervalue"];
header("Location: http://www.lynxtrack.com/afclick.php?o=7560&b=ft9z13pz&p=9136&l=1&s=$var&p=$partner"); ?>
Tootol. I tested your script with both php and html extensions. When given a php extension, the file works perfect. When given an html extension, the file looks identical to the screen shot you provided. Make sure that you have the file saved in htdocs and are previewing through localhost.
The page isn't being parsed. Here are a few questions to varify:
1.) Are you sure Apache is running? (Check the Task Manager for Apache.exe)
2.) Are you testing the file under localhost? (Does the url say "http://localhost/filename.php" or does it say "C:/...")
3.) Is the php file saved in the htdocs folder?
There are many other possibilities but these are the common ones that are easily solved.