Php Scripts News
Congratulations, you have found a great source for recent news for Php Scripts. Also browse and make use of our other resources.
Andrews Aerial Porter, Pembroke Pines Native, Supports Combat Zone Air ... - dvids
SOUTHWEST ASIA -- One day he could be operating a 60,000-pound-capable aircraft cargo loader and the next be driving a bus full of passengers. Whatever he's called to do, Staff Sgt. Phillip Belnavis said it's the life of a deployed air transportation ...
Read more
Liev Schreiber Talks "Wolverine" Sequel - WorstPreviews.com
During a press junket for "Repo Men," Liev Schreiber revealed that Hugh Jackman has already read the script for "X-Men Origins: Wolverine" sequel, but is unsure whether Sabretooth will be part of the new film. " I just had dinner with [Hugh Jackman ...
Read more
Letterman: Case Against Producer Handled Properly - NPR News
He admitted Tuesday the supposed script was "just a thinly veiled threat to ruin Mr. Letterman if he did not pay me a lot of money." Defense attorney Gerald Shargel said Tuesday that Halderman "was both jealous and enraged" and under financial ...
Read more
Guy Ritchie to Direct King Arthur Film - Coming Soon!
The key source material for the film will be Thomas Mallory's "Le Morte d'Arthur," published in 1485 as a compilation of French and English tales. Hodge is working on the script with Ritchie. Producers are Hollywood Gang's Gianni Nunnari, Atlas ...
Read more
Walter Salles Directing Our Wild Life - Coming Soon!
Jeff Stockwell wrote the script.debut with "Dark Water" and recently directed a segment in the ensemble shorts feature "Paris, I Love You."
Read more
Kevin Macdonald Will Show You A Murder Mystery - ShockTillYouDrop.com
James Vanderbilt, who wrote David Fincher's Zodiac and is also the writer behind the upcoming Spider-Man reboot penned the script. Murder Mystery revolves around an American couple honeymooning in Europe who are implicated when they witness a murder ...
Read more
Brain Library, Coventry Cathedral Ruins - Archinect
This is an early version of the roof form, still in development: As an aside, I wrote a script in Rhino to automatically create the triangulated trusses for that form. So you just start with two surfaces over each other, then run the script and it ...
Read more
Out of and Underneath the Mask - Chud.com
The Captain America casting threads have brought up Keaton as Batman, Reeve as Superman and Bale as Batman to say that Krasinski shouldn't be getting the internet hatred that he is until we see him in action. Some folks are for and some, myself ...
Read more
Leading comedy role not out of star Jay Baruchel’s ‘League’ - Badger Herald
However, the Apatow alum is not just any script-gobbling career go-getter. “If it sounds like I’m going to have fun doing it and I (would) pay money to see it myself, then … I’ll usually do it,” Baruchel said. Both Torrence and Baruchel ...
Read more
Move to the Right! - FAIR
The script might be the same this year. The New York Times (4/11/04) devoted a whole story to the notion that appearing with Sen. Ted Kennedy was a liability for Kerry. Even some Democrats were worried, according to the Times --though the paper ...
Read more
Top Php Scripts Results
| PHP Scripts for developers and programmers both free and commercial. |
| Hot Scripts is the net's largest PHP, CGI, Perl, JavaScript and ASP script collection and resource web portal. We are an Internet directory that compiles and distributes Web ... |
| PHP Script Tutorials from Hot Scripts. PHP is a programming language for dynamically built web sites. PHP used to stand for PHP: Hypertext Preprocessor. At Hot Scripts you can ... |
| Learn PHP Programming ... TDavid's PHP Diary updates: Using mktime and date function to skip dates and create simple calendar functions ... |
| Free PHP scripts | Open source PHP library ... Gscripts.net is a fast growing directory of free php scripts such as php forums, php photo galleries, CMS, php e-commerce solutions ... |
| PHP: Hypertext Preprocessor (the name is a recursive acronym) is a widely used, general-purpose scripting language that was originally designed for web development to produce ... |
| Site with complete script, code snippets, documentation and other PHP related resources. In affiliation with cgi-resources.com Around 700 entries |
| Free PHP scripts, tutorials, and other resources for webmasters. Scripts include an anti-spam guestbook, a poll script, and an image gallery script. |
| PHP scripts of all varieties that are ready for use on your web site. |
Other Php Scripts Results
Open Question: How to add shopping cart?
My website is completed. Design it in .html with dreamweaver because I'm not really a computer geek who knows all about scripting as .php
Please, can anyone help me???.. I've install zencart in my computer but can't really understand it even though went to the forum or support page..
please make me clear..
moreVoting Question: help with SQL UPDATE?
i am trying to update but i get error 'An error has ocured: :'
below is the script:
<?php
include ("sql.php");
$first = $_POST['firstname'];
$last = $_POST['lastname'];
$loginname = $_POST['loginname'];
$street = $_POST['street'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$cxn = mysqli_connect($host, $user, $password, $database) or die ("couldnt connect to server");
// setup MySQL query
$query = "UPDATE member SET firstName = '$first', SET lastName = '$last', SET loginName = '$loginname',
SET street = '$street', SET city = '$city', SET zip = '$zip', SET email = '$email', SET phone = '$phone'
WHERE loginName = '$loginname'";
// Execute Query
$result = mysqli_query($cxn,$query) or die( "An error has ocured: " .mysql_error (). ":" .mysql_errno ());
?>
moreResolved Question: PHP mail form help..................?
when the submit button is hit it returns an error 405 (access to page is not allowed)
can anyone suggest what is wrong with it please?
this is the script
<?php
$emailSubject = 'contact.htm';
$webMaster = ``;
$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="4;URL=http:///contact.html">
<style type="text/css">
<!--
body {
background-color: ="lightblue";
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 25px;
font-style: italic;
moreResolved Question: Basic PHP - help with course work?
I'm currently learning PHP on a short course and have this task...
The script should write the following: "3.14155265", without using the digits displayed, as simply as possible, using only Integers and Strings..
If you can help and explain, thanks in advance.
moreResolved Question: Why is my site server load so high (CPUS)?
My site is www.mafiaexpress.net, and no matter how hard I try my server load goes way to high. I've been kicked of 3 servers because of it and I try everything that can be done, limiting database requests, white space, .htacsess tips + more. Amazingly the highest it has been was recorded at "78.45" which almost knocked the whole server offline. I'm puzzled on whats going wrong, and I have been through every script and I can't find a single problem. And there php btw.
Helllppp.
moreResolved Question: How much do I charge?
I've built myself a small membership site in PHP.
It includes:
Register/Login/Logout.
Members Area.
Change Password
Forgot Password
Admin Area with view/manage users.
How much should I charge for this script?
moreVoting Question: PHP forum code using mysql?
I have just set up a mysql database and have made login and register functions that work fine, I was wondering if anyone could give me a script that I can put my database details into and bob's my uncle I have got a forum working from my database. Anyone know a script for me?
moreResolved Question: PHP 5 - Why does this print statement not do what I expect?
I have the following print statement written in PHP
<?php
print "This spans\nmultiple lines. The newlines will be\noutput as well.";
?>
When I test the script I get the following output in the broweser
This spans multiple lines. The newlines will be output as well.
However the tutorial I am following insists it should come out like
This spans
multiple lines.The newlines will be
output as well.
This does in the source but not when displayed in the browser can you explain why please?
moreVoting Question: why my email is going to spam?
when i am sending a mail to any person(say receive_name@gmail.com or receive_name@yahoo.com) through php script with my website domain(say sender@sitename.com) it is going to spam or bulk , why it's going like that can anyone suggest?
the script is working fine without any errors....
moreVoting Question: Do I need to know PHP to be able to create a contact form, for a website?
I know CSS, HTML, JavaScript.
Is there a script I can get (if PHP is required) so that I can create professionally standard contact forms?
thanks
moreResolved Question: Is jQuery worth learning?
I am relatively new to web development and have begun to learn HTML and CSS as they are essential languages for web design. I also want to move into a bit of scripting i.e. JavaScript, PHP, ASP.NET and whatnot and have seen and read a bit about jQuery on various forums.
I know that it is a JavaScript library that can produce some pretty decent effects and functionality so I want to know, is it worth learning? I have seen a book on Amazon jQuery: Visual QuickStart guide and it has some good reviews and am thinking about getting it.
Is jQuery good in your opinion? and is it worth learning?
Thanks for your answers in advance, they will be appreciated.
moreResolved Question: Website using PHP code how can I fire it off in a html page?
I have a PHP script that inserts information into an Oracle database table. The PHP script contains the connection details (username & password). How can I hide the script so the connection details cannot be found but still fire it off when I need to?
moreResolved Question: need to learn php...?
ok so i would like to learn php , i know html and css but i would also like to learn php , also i would like to make a website but i start to learn php then i sort of give up, but i think it is because im not atchaly using it while im learning it so i dont get it as easily, so i am thinking if i start making a website while i am learning it it would benifit me more. what do you think ? another thing i have...
Lynda.com.PHP.With.MySQL.Essential.Training.DVD is this good for learning php , i thought it might be easier then using a website like W3schools as i am whatching and listinig to them do it other than just reading? Last question , on avarage how long would it take to learn php at a not to advanced level but advanced enough to make my own scripts like login script and admin panel scripts etc ..?
Thankyou
Jamie
moreVoting Question: Where can i find a PHP script to edit .html files stored on my website.?
For example say the scipt is edit.php i want to be able to go to www.mysite.com/edit.php and i want it to be able to edit www.mysite.com/page.html using a wysiwyg.
Also my budget is £$0
Thanks, James
moreResolved Question: Script installation problem in cpanel?
Trying to install a script which just shows blank pages, yet i have had the script going in the past on a different server. I'm looking for clues as to where the problem may be.
The .htaccess has AddHandler application/x-httpd-php .htm and i've also tried adding that from cpanels apache handlers link but still nothing. On one of the pages i get code instead of a displayed page and the pages are .htm (example http://poker.nightlife.co.rs/shop.htm)
Wondering if anyone can provide clues as to where the problem is, is it possible that apache needs to be restarted?
moreVoting Question: I am trying to install a Script on on my website, but i am finding it difficult to do?
As an example my website http://www.website/index.html what i would like to know is, how would i get the Script to work? From what i have read it is about setting the right path to the Script? That is where i get stuck. The Script and details are here. If as an example i could be shown how to do this.
Thank you
http://www.enthropia.com/labs/share/readme.php
moreVoting Question: 2007 files being associated with the wrong mime type...?
I am trying to upload various 2007 files with the extensions: docx, pptx, xlsx, etc.
The script I am using is PHP and I have added the mime types to the upload class using mime types which I have found online, however when I try and upload a file it throws an error and associates the following mime type (below) which each of these different files and I have no idea why.
images.application/x-itunes-itlp
All answers would be greatly appreciated, thanks.
moreResolved Question: PHP Security question.?
Hi guys,
Basically what I want to know is when I upload a PHP script to my website, is it possible for someone to download it without executing it?
This may sound a bit vague so here is an example.
I make this script:
<?php
$name = "jordan";
echo $name;
?>
is it possible for someone to download that exact script instead of getting the 'jordan' result?
I wan't to know this because I have a script which sets the username and password of my MySQL database into variables and don't want anyone to be able to download and view them.
(And no, they are not echoed out like in the example above).
Thanks.
moreResolved Question: PHP 'or die' function - quick help needed, thanks :) (first working answer gets the points)?
Hi guys,
Basically my flash script is communicating with my php script, part of this php script connects to a MySQL database and contains an 'or die' function - the problem is that this outputs in a way I do not know how to give back to flash (flash needs a url coded response).
So here is the line I currently have:
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
And here are the lines I have to use to send something back to flash:
$returnVars = array();
$returnVars['err'] = "connection";
$returnString = http_build_query($returnVars);
echo $returnString;
So how can I get the 'die' function to do this?
Thanks.Its chrashing because of the database setup on the local server I think - it's just that when/if this is ever deployed I need to be able to alert the user if the command has failed - not just exit the script.
moreVoting Question: I am trying to install php a script on my host server, however i am getting a unix error that i do not?
understand. This is what i am getting
Please set the correct user (e.g. apache) for the root folder of your script (e.g. chown www-data.www-data -R getboo/)
What does this mean? do i have to CHMOD the folder where the script is? What does chown mean?
Thanks in advance
moreResolved Question: How can you replace a blank space with a - in a textfield using javascript?
Hi i'm working on a simple TV site. I'm using the below script which works perfectly to take the user to a page on the site based on whatever they type.
<script type="text/javascript">
function goToPage() {
show = document.getElementById('name').value;
window.location='/'+show+'.php';
}
</script>
Go To Show <input type="text" size="20" maxlength="80" id="name" />
<input type="submit" onClick="goToPage();" value="Go!" />
However when somebody types in "the sopranos" they will be taken to mysite.com/the sopranos.php rather than mysite.com/the-sopranos.php.
What can I add to replace the blank space with a dash?
Also I'm aware I can force the user to not type spaces so they submit thesopranos and it becomes mysite.com/thesopranos.php but I'd much prefer the first solution.
Thanks in advance for any help!Hi thanks for that first reply... it works but only on the first word. For example Two Words becomes Two-Words but Try Three Words becomes Try-Three Words. Why does it only replace the first space? Thanks
moreResolved Question: PHP User online script by SESSION?
Can I have a script where it submits a SQL query that changes the Field "Stat" on the table "Users" WHERE Username = '$myvalue' to "Online" but after 10 mins or a session expires it submits another one to say "Offline"
moreResolved Question: Creating a Social Networking Website in PHP?
I want to create my Social Networking Website in PHP.
Is there any softwares? or maybe a PHP Script?
moreVoting Question: login scripts with admin in php?
hello
i am making my self a php site i need a login script.
BUT
i need a login script that has a admin login and a user login i have found
http://evolt.org/PHP-Login-System-with-Admin-Features
that it looks really good but when i put it on my server to test and i change the the constants.
when i load it up it is like reading the code from the browser i read some of the comments bellow and some other people said they where having the same problem has anyone got this to work or is there a better script out there.
thanks
moreResolved Question: Flatfile to database conversion....how?
I have a php script which uses a flatfile database, how do i convert it to use mysql?
moreResolved Question: I scripted my website(PHP) and got it running using Wamp Sever, but how to make it public?
Hi, i scripted my website and published it using Wamp,it works when i put localhost or 127.0.0.1 in the browser, but how can i make it so other people see it? Thanks.
moreResolved Question: PHP script review...?
I'm currently in the process of making a php script. I'm looking to turn this into a commercial project in the future. The trouble is I have only been coding for around 12 months so I know my coding won't be the best.
I'm looking for someone to review my code and tell me how good or bad it is and if it is bad tell me how I could improve on it.
Is there anyone willing to do this for me or do you know of anywhere that can do it for me preferably for free.
moreResolved Question: Redirect a user if no cookie is present using PHP?
Hey all I need a script to redirect a user to a different page if a cookie is not present. I can't use java or any other language,because it's a proof of concept thing using PHP only.
moreResolved Question: PHP coding/OOP [20 chars]?
I learnt PHP because I wanted to make a site that would make me money, it worked for a little while and I'm still figuring out what I want to do with my life.
I hae a few script ideas which I think people would be interested in buying. I have been coding PHP for about 11/12 months. I am looking to sell these scripts, as I am quite a new programmer I realise my quality of code won't be the best.
Does using OOP improve the quality of code? What are the benefits of using OOP?
Are there any common security issues I need to think about before selling a script?
moreVoting Question: In php, will storing an array use less or more memory than an sql query for the same purpose?
I'm the developer of CSV 2 POST Pro for Wordpress and I want to speed it up. It imports hundreds of thousands of records and so the slightest improvement in my script can greatly increase performance. I only finished University last year so theres no way I'm going to know stuff like this.
If I have a group of settings stored in database then make a querie and hold the results for accessing 100,000 times. Would this be better or worse than having an array ( don't worry about where the array comes from at this point) and accessing that 100,000 times?
For Wordpress developers, the array would come from options so although the question is not regarding the speed of the method in obtaining the data please feel free to add any info on. I'm thinking wordpress get_option can't be faster than a direct sql query so its the long term use of the resulting data I REALLY need to know.
Thanks all
WebTechGlobal
moreResolved Question: Stop Active X popping up on my website.?
I am creating a website, and using javascript, i have allowed my users an option to resize their text. The only problem is that I have the following message pop up when my website loads;
"To help protect your security , Internet explorer has restricted this website from running scripts or ActiveX controls that could access your computer. "
Is their away to load withhout this message. Do i need to re-write this in PHP or somthing?
moreVoting Question: HELP!!! PHP doesn't recognise new lines?
Hi, I have this problem with php. I have made an html form including a text area this gets posted to a php script which processes it and the sends it to mysql. The problem is that when I make a new line in the html form it does not shoe up in php and mysql because instead of sending a <br> tag the html form only send spaces so php presumes that these are spaces. How can I change this.
Please help. Thank you.
moreResolved Question: PHP MySQL Search Script Narrowing Down Database?
I've managed to get a mySQL search script up and running coded in PHP. However what I want to do is search for multiple things one after the other, but each time to be searching through only the results from the previously narrowed down results.
So I want to search through a hundred results for the word Trainers, and maybe 50 of those results are for trainers, then before I show my results I want to search again. This time I want to search for green, and narrow the search from 50 results to say 30. Then I want to maybe search again for say laces, etc.
Does anyone know a way of doing this that perhaps isn't too complicated? I'm relatively new to mySQL so I don't even know if what I'm asking is possible!
ThanksWorked out the answer myself in the end, and just thought I would pass it on for anyone else who was looking for it!
All you need to do is include some nested if statements in the MySQL code after the initial search for the inital keyword has been done. After that, you can include a new searchterm and search again.
Hope that helps anyone who's looking to do a similar database search! I think I over complicated in my head what had to happen, and so ended up thinking the solution was going to have to be hideously complicated!
: )
moreResolved Question: A challenging question for html/php experts?
I would like some input into how to solve a little task i set myself. I have one page to work with and wish this page to be an editable profile page. It needs the ability to upload an image and edit text.
The page is an index.html page. I want this to be accomplished without accessing cpanel or external ftp clients. One idea i had was simply putting an iframe inside the html page which displays a php file upload script. It would then simply be a matter of uploading image and text files, however in this example the upload script would need to be installed first as it wouldn't upload files to the correct site if used in an iframe. Any other ideas anyone?
moreVoting Question: Help required for using PHP to parse a PHP script!?
Hello all,
I am trying an attempt to make parts of my website easier to update by passing every php script (except those specified in the .htaccess file) through a Parser script. In essence it'll work similar to that used in PHPBB forums where [url=http://somewhere.com]link[/url] will output an "<a href..." html tag.
HOWEVER, whilst I am able to pass the requested files through the parser, any php script within the requested file is not executed:
for example "include("genericstyles.php");" would normally insert some CSS styles into the page - however in the parser, this is left untouched as though it's html, so the code within the output still reads as (shown in context:) "<title>Test Page</title>
<!-- import generic styles -->
<?php
include("genericstyles.php");
?>
<!-- -->
<script language="javascript" src="Core.js"></script>
</head>"
The Parser script contains this code to find and echo the file contents requested
"$theurl = implode('', file($file));
$parse = parse_code($theurl);
echo $parse;
"
(note that "parse_code" is a seperate function that has been filled out and works further up in the Parser script)
Is there any script that can be put into the Parser script so that any php within the file requested is executed first before the echo command outputs the file as html??there's more than just includes in some of the files requested... such as (excerpt:)
"if(isset($_GET['pageopen']))
{
$pageopen = $_GET['pageopen'];
switch($pageopen)
{
case Contact:
{echo '<form method="post" action="/emailer.php">';
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
echo '<h2>Contact us</h2><p>"
Also, I really only want to edit the parser file, not the requested files themselves.... so that if index.php was opened seperately, it could still be opened normally and would still work the same as when it's opened by going to Parser.php?file=index.phpFIXED!
code used:
$theurl = implode('', file($file));
ob_start(); // start buffering php output
include($file); // output from $file is buffered
$string = ob_get_contents(); // ob_get_content contains the buffered php output
ob_end_clean(); // remove the buffered php output
then $parsed = parse_code($string);
then simply echo $parsed;
moreResolved Question: Please, Please help me with my PHP script!?
Hello,
Im trying to write a script, for sending a basic form to my email address. Everything seems ok, apart from i'm not recieving an email. Have I put the $mailto funtion in the wrong place?
<?php
$mailto = "myemailaddresshere@hotmail.co.uk" ;
$name = $HTTP_POST_VARS['name'];
$email = $HTTP_POST_VARS['email'];
if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) {
echo "<h4>Invalid email address</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
} elseif ($name == "") {
echo "<h4>No subject</h4>";
echo "<a href='javascript:history.back(1);'>Back</a>";
}
elseif (mail($name,$email,$mailto)) {
echo "<h4>Thank you for sending email</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
?>
Any help will be very much appreciated!
moreResolved Question: What is wrong with this PHP script (mysql_connect)?
I will say again...
Line 2 is
$con = mysql_connect("localhost"
,"mycorrectlyenteredusername"
,"mycorrectlyenteredpassword"
);I setup a system where it tells me the errors. I got this:Error: No database selected
Please fix this script!
<?php
$con = mysql_connect("localhost","mycorrectlyenteredusername","mycorrectlyenteredpassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db(Accounts, $con);
$sql="INSERT INTO Persons Members (Username, Password, Age)
VALUES
('$_POST[Username]','$_POST[Password]','$_POST[Age]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "TRUE";
mysql_close($con)
?>Line 2 is $con = mysql_connect("localhost","mycorrectlyenteredusername","mycorrectlyenteredpassword");
moreVoting Question: Computer error message HELP?
This error message keeps appearing when i go to Facebook and it locks up on me
An error has occured in the script on this page.
Do you want to continue running scripts on this page?
Line 1
Char 1
Code 0
URL http://www.facebook.com/profile.phpIt does nothing whether i click yes or no
I have also tried the steps in internet options like Da guy has showed me but mine is already set to these.
moreResolved Question: Please can you help with this error message?
This error message keeps appearing when i go to Facebook and it locks up on me
An error has occured in the script on this page.
Do you want to continue running scripts on this page?
Line 1
Char 1
Code 0
URL http://www.facebook.com/profile.php
moreResolved Question: Internet Explorer Script Error on Facebook?
Hi I was wondering if anyone can help me solve this problem..I only get this when I try to view profiles..not on the homepage..It wont allow me to do anything and I have to restart computer...any help would be appreciated...I have tried clicking repeatedly and disabling the script error..nothing seems to work!!
Line: 1
Char: 1
Error: Object Required
Code: 0
URL: http://www.facebook.com/home.php?I tried them all and Mozilla Firefox was successful!! thankyou :o)
moreVoting Question: how to upload pdf file useing php code?
the upload php script work good with jpg, gif, bmp but it's not work with pdf file I do not know why can you please help me
moreResolved Question: Please update this PHP hit counter script to block my IP?
Please update this hit counter script to make it so it blocks the IP "1.1.1.1.1" from adding a hit.
The script:
<?php
$count_my_page = ("hitcounter.txt");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
?>
moreResolved Question: i need a good programer to help me?
ok i need someone that knows php and can talk to me 1 on 1 and help me with a login script perferably on yahoo messenger if you would like to help me please let me know or add me on yahoo messenger.
p,s i dont want to pay.
Thankyou
Jamie
moreResolved Question: can you see anything wrong with my PHP script?
this script is supposed to verify a user by their email address and password, with their details on the database. I think I'm having problems with the query, but having problems with this script allover i think. any help on the script following, please:
<?php
#page 175
#shortening variable names
$email = $_POST['email'];
$password = $_POST['password'];
#validation
if( (!$email) or (!$password) )
{ header("Location:$HTTP_REFERER"); exit(); }
#connect to MySQL
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$conn = @mysql_connect($dbhost, $dbuser, $dbpass) or die("Could not connect to MySQL");
#select the database
$dbname = 'database';
$db = mysql_select_db($dbname)or die("Problem locating the database");
#create SQL query
$sql = mysql_query("SELECT * FROM users(email, password) WHERE email = '" . $email . "' and password = '" . $password . "' ");
#execute query
$rs = mysql_query($sql,$conn) or die("Could not execute query");
#gen number of rows that match email and password
$num = mysql_numrows($rs);
#if there is a match the login is authenticated
if ($num != 0)
{ $msg = "Welcome $email, your login was sucessful."; }
?>
<html>
<head>
<title>Log-in</title>
</head>
<body>
<?php echo($msg); ?>
</body>
</html>
moreVoting Question: I'm trying to get a PSP script to work?
The script below sends people to an error page even if everything is filled in can anyone help?
<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link
// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "realmailremoved@security.com";
$Subject = "Patient Referral";
$Patient = Trim(stripslashes($_POST['Patient']));
$Address = Trim(stripslashes($_POST['Address']));
$Birtdate = Trim(stripslashes($_POST['Birtdate']));
$Ethnicity = Trim(stripslashes($_POST['Ethnicity']));
$Male = Trim(stripslashes($_POST['Male']));
$Female = Trim(stripslashes($_POST['Female']));
$Benefit = Trim(stripslashes($_POST['Benefit']));
$NI = Trim(stripslashes($_POST['NI']));
$Professional = Trim(stripslashes($_POST['Professional']));
$Medication = Trim(stripslashes($_POST['Medication']));
$Reason = Trim(stripslashes($_POST['Reason']));
$Referrer = Trim(stripslashes($_POST['Referrer']));
$Job = Trim(stripslashes($_POST['Job']));
$MHCN = Trim(stripslashes($_POST['MHCN']));
$Phone = Trim(stripslashes($_POST['Phone']));
$Date = Trim(stripslashes($_POST['Date']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($Patient)=="") $validationOK=false;
if (Trim($Address)=="") $validationOK=false;
if (Trim($Birtdate)=="") $validationOK=false;
if (Trim($Benefit)=="") $validationOK=false;
if (Trim($NI)=="") $validationOK=false;
if (Trim($Professional)=="") $validationOK=false;
if (Trim($Medication)=="") $validationOK=false;
if (Trim($Reason)=="") $validationOK=false;
if (Trim($Referrer)=="") $validationOK=false;
if (Trim($Job)=="") $validationOK=false;
if (Trim($MHCN)=="") $validationOK=false;
if (Trim($Phone)=="") $validationOK=false;
if (Trim($Date)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Patient: ";
$Body .= $Patient;
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "Birtdate: ";
$Body .= $Birtdate;
$Body .= "\n";
$Body .= "Ethnicity: ";
$Body .= $Ethnicity;
$Body .= "\n";
$Body .= "Male: ";
$Body .= $Male;
$Body .= "\n";
$Body .= "Female: ";
$Body .= $Female;
$Body .= "\n";
$Body .= "Benefit: ";
$Body .= $Benefit;
$Body .= "\n";
$Body .= "NI: ";
$Body .= $NI;
$Body .= "\n";
$Body .= "Professional: ";
$Body .= $Professional;
$Body .= "\n";
$Body .= "Medication: ";
$Body .= $Medication;
$Body .= "\n";
$Body .= "Reason: ";
$Body .= $Reason;
$Body .= "\n";
$Body .= "Referrer: ";
$Body .= $Referrer;
$Body .= "\n";
$Body .= "Job: ";
$Body .= $Job;
$Body .= "\n";
$Body .= "MHCN: ";
$Body .= $MHCN;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Date: ";
$Body .= $Date;
$Body .= "\n";
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
moreResolved Question: Problems connecting to MySQL with PHP?
I am writing a login script. This part is supposed to authenticate the user when they enter their email and password, but I keep getting the same error message, below:
Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\own_login\authenticate.php on line 28
Could not execute query
below is the PHP script from line 24 - 28
#create SQL query
$sql = mysql_query("SELECT * FROM users WHERE email = \"$email\" and password = \"$password\"");
#execute query
$rs = mysql_query($sql,$conn) or die("Could not execute query");
Please help. Thanks
moreResolved Question: PHP IP Online code needed?
I know my IP, If it was 11.11.11.11 then how would I have a script where if THAT IP is on a page, It will echo '<font color = "Green">[ Online ]</font>' but if it isn't it will echo '<font color = "Red">[ Offline ]</font>'
moreResolved Question: How can i upload throught my php script ?
Ok i have set up everything and works like it should .. The only problem is when i try to upload pictures for my stock .. It uploads the pictures and i can download through the ftp but it wont show the picture ..if i follow the link for the picture it says: You don't have permission to access this URL on this server. Additionally, a 410 Gone error was encountered while trying to use an ErrorDocument to handle the request.Nothing worked .. I got an email from Yahoo hosting that ...
I understand your concern and we really apologize for any inconvenience
this may have caused.
Dinos, for our customers' security, we have recently made changes to the
PHP configurations for all accounts to disable the following settings:
- register_globals
- allow_url_fopen
- allow_url_include
If your PHP scripts made use of the capabilities that these options
provided, you may be experiencing abnormal behavior on those scripts.
You will need to update your code to remove dependence on these features
in order to restore your original functionality.
I am on a shared webhosting hence php.ini is not available to edit.
moreResolved Question: How to set time zones in apache?
Trying to install a script on my vps but i get a warning:
your PHP installation is returning 'System/Localtime' as the timezone of your server. This is because of a patch to PHP applied by some Linux distributions. Unfortunately, this is not a valid PHP timezone. Please edit your php.ini file and set the 'date.timezone' property to the correct value for your server.
Now my vps is located in San antonio which is UTC/GMT -6 hours.
How do i actually write this in my php.ini file?
I tried as above but no difference any ideas anyone?Thanks blackcompe but the original warning message gave to errors, both in the .ini file. I solved one by editing that but with the time zones, i don't know what to actually put in there..such as europe/london or usa/whatever.
I need to know exactly what to write including any spaces, commas, dots, dashes...i'm not too clever with this!
moreResolved Question: Web design: placing images on a website automatically?
I have created a PHP script so that people can upload files to my computer.
Do you know any websites that will tell me how to make them display on my website automatically?
more