wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
What is line 432 in the code you posted?
-
You need to post the code you're having issue with here. Also explain what in your code is not working correctly
-
You just need to wrap your variables in HTML tags, eg echo "<h1>$title</h1>"; echo "<p>Posted on $date by <b>$author</b></p>"; echo "<p>$message</p>"; That some basic styling. To apply more you'd use CSS.
-
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
Its your cache. Go to http://localhost let it load and then do Ctrl + F5 -
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
The index file is in the htdocs folder (same as test.php). Removing the index file should show a directory listing -
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
Try Ctrl + F5 when going to http://localhost. Your browser has cached the old index page -
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
I know test.php in the htdocs folder. What I want to know is what is shown when you go to http://localhost (i dont want you to run test.php) -
Define what you mean by "it doesnt work". What is you function supposed to do? What are you trying to do?
-
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
Just go to http://localhost not http://localhost/test.php You should get directory listing. Which shows all files in the htdocs folder. Is test.php listed? -
The snippet you provided is fine (on its own). We'll need to see more code.
-
You are overwritting your $_POST data when you submit your other two forms. What you'll have to do is pass the old $_POST data in either a hidden field in your other forms or via $_SESSION vars
-
why is this file_gets_contents not working?
wildteen88 replied to scbookz's topic in PHP Coding Help
No not all. As I mentioned earlier everything in square brackets is optional, ie not required. If the format for calling the function was this ( , , [ ] ) Then it'll make function calls ugly and confusing. in_array($needle, $haystack,) -
why is this file_gets_contents not working?
wildteen88 replied to scbookz's topic in PHP Coding Help
parameters wrapped in square brackets are optional. In your case all you'll need to do is $oscfile = file_get_contents("http://cc.cc.cc.cc:81/osc/osc/osc/catalog/product_info.php?products_id"); Personally I find the manual easy to read. One of the best around. However if you're struggling to read the manual have a read of this. -
Reading all the <option> values from a <select> form
wildteen88 replied to pianoman993's topic in PHP Coding Help
No. The select field will only return the option(s) selected by the user. Why do you need to retrieve all options? -
In your php.ini you need to make sure display_errors is set to On and that error_reporting is set to E_ALL. Save the php.ini and restart Apache. NOTE Make sure you're editing the correct php.ini. To confirm, run phpinfo and look at the Loaded Configuration File. This will tell you the full path to the php.ini PHP is reading. Make sure you're not editing lines that start with a semi-colon (
-
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
Remove all files in C:\Program Files\Apache Group\Apache2\htdocs leaving just test.php Go to http://localhost. What is listed? -
[SOLVED] Printing a web page WITHOUT headers and footers
wildteen88 replied to NewbieBryan's topic in PHP Coding Help
You can use CSS to apply a different style when printing. Here is an example -
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
You can download Apache2.2 from here instead: http://apache.mirror.rbftpnetworks.com/httpd/binaries/win32/ Download the package titled apache_2.2.11-win32-x86-no_ssl.msi Seems the link is broken on the Apache download page. -
You cannot have any ouput form of before using header. To fix this change this <?php include('connection.php'); ?> <head> <title>checklogin</title> <link href="style.css" rel="stylesheet" type="text/css" /> <link rel="icon" type="image/png" href="favicon.ico"> </head><?php // Connect to server and select databse. To this <?php include('connection.php'); // Connect to server and select databse. Now change <body> <!-- header start --> to <head> <title>checklogin</title> <link href="style.css" rel="stylesheet" type="text/css" /> <link rel="icon" type="image/png" href="favicon.ico"> </head> <body> <!-- header start -->
-
Remove the . after '$g_name'. Also these lines $your_team = mysql_real_escape_string($_POST['your_team']); $opp_team = mysql_real_escape_string($_POST['opp_team']); $time1 = mysql_real_escape_string($_POST['time1']); $date1 = mysql_real_escape_string($_POST['date1']); $g_name = mysql_real_escape_string($_POST['date1']); $result = mysql_real_escape_string($_POST['result']); $writeup = mysql_real_escape_string($_POST['writeup']); Should be after you connect to mysql. mysql_real_escape_string will only work if you're connected to mysql first.
-
Have a look at this FAQ Snippet.
-
By sanitize I meant pass your variables to mysql_real_escape_string before placing them in your queries.
-
Values needs to wrapped in quotes in your queries. You should sanitise user input before placing it directly into to your queries. It is not recommend to place raw $_POST, $_GET data etc into queries.
-
mysql_query only expects two parameters. The first will be the query. The secound parameter which is optional is the mysql link resource, which in your case is $con. You cannot pass two queries at the same time to mysql_query, only one at a time. This mysql_query($sql,$sql1,$con); should be written as mysql_query($sql,$con); mysql_query($sql1,$con);