wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
That is exactly what data validation is. Example [code=php:0]<?php if(isset($_POST['submit')) { if(isset($_POST['title']) && trim($_POST['title']) != '') { $error = 'Please provide a title'; } if(isset($error)) { echo $error; } else { echo 'The title is: ' . $title; // this is where you run your SQL query } } ?> <form method="post"> Title <input type="text" name="title"><br /> <input type="submit" name="submit" value="Post Title"> </form>
-
This falls down to to basic data validation/verification.
-
Have a look into cURL perhaps. cURL allows this.
-
[SOLVED] Array split keys and values into 2 arrays
wildteen88 replied to mjedman1's topic in PHP Coding Help
Have a look at the array_keys and array_values functions prehaps? -
Something like TinyMCE and FCKEditor
-
Don't just paste code. Provide more information in your post, such as what you're trying to. What the script is supposed to do, and the outcome after running it. If you have any errors, always post them in full.
-
By PHP2.0.22 you mean phpBB? If so I would highly recommend you to post this over at phpbb.com You will also want to contact your host about this too, they'll be able to provided you with raw http logs.
-
Is there a PHP script for uploading music??
wildteen88 replied to beanstyle's topic in Miscellaneous
Have a look over at hotscripts.com for such scripts. However for what you'r wanting to do you can make it fairly easily by yourself. Uploading music is the same as uploading images. -
When you uninstalled Apache, it should of removed the Apache service with it. To remove the old service run the following command in the Command Line Terminal httpd.exe -k uninstall Before running the above command, you may have to navigate to Apaches bin folder first, eg cd C:\Program Files\Apache Foundation\Apache2.2\bin What is the output of the above command?
-
I been meaning to update that FAQ, anon linked you to. Moving files out side of the PHP folder is no longer recommended. Keep all files where they are when PHP is installed. Firstly did you install PHP using the installer? If you have, go to php.net and download the zipped binaries package rather than the PHP installer. Extract the zip to where you have PHP installed, now move your php.ini in C:\Windows back to C:\php. Delete all other files you have moved <- these will interfere. Next step add PHP to the PATH Environment Variable. Once you have done the above make sure PHP is reading the php.ini you're editing, by running phpinfo function. Ignore the Configuration File (php.ini) Path line. Concentrate on the Loaded Configuration File line. It should read C:/php/php.ini If it is, has the MySQL extension loaded? You can tell this by scrolling down and finding a MySQL subheading.
-
[SOLVED] Using a form to insert data into a database
wildteen88 replied to hansman's topic in PHP Coding Help
You might want to use the following instead. $sql = 'INSERT INTO `'.$type.'`(data form previous page)VALUES(Variables)'; Before using $sql in mysql_query, echo $sql to see if it is being populated properly. -
Can someone help me connect to mysql?
wildteen88 replied to kidzkit's topic in PHP Installation and Configuration
Ok so you have followed everything I told you in my previous post. Then the next problem is PHP may not be reading the php.ini you're editing. Adjust your script to this: phpinfo(); $con = mysql_connect("localhost","root","rhoads"); if (!$con) { die('Could not connect:' . mysql_error()); } else { echo "Good connection"; } mysql_close($con); Run your script again, this time you'll get a web page rendered, with PHP's current settings. The line you want to be concerned with is the Loaded Configuration File line. To the right of that line should be the full path to the php.ini PHP is reading for configuration, it should read C:/path/to/php/php.ini Can you confirm this? -
[SOLVED] Using a form to insert data into a database
wildteen88 replied to hansman's topic in PHP Coding Help
$sql="INSERT INTO 'Type'(data form previous page)VALUES(Variables) should be $sql="INSERT INTO $type(data form previous page)VALUES(Variables) -
Can someone help me connect to mysql?
wildteen88 replied to kidzkit's topic in PHP Installation and Configuration
How have you install Apache, PHP and MySQL? Using separate installers? If you have, go to php.net and download the zipped binaries package rather than the PHP installer. Extract the zip to where you have installed PHP to, now rename php.ini-recommended to just php.ini (remove the existing one) Next step add PHP to the PATH Environment Variable. Then open your php.ini and enable display_errors and make sure error_reporting is set to E_ALL. After find the following line: extension_dir = .\ change it to Change the text in blue Scroll down and find the following line ;extension=php_mysql.dll Remove the ; at the start of the line. Save the php.ini and restart Apache. Rerun your test script. -
Can someone help me connect to mysql?
wildteen88 replied to kidzkit's topic in PHP Installation and Configuration
Then this is the classic signs of the mysql extension is not enabled. Post your server setup (OS version, PHP version and Server version - example: XP SP2, PHP 5.2.6, Apache2.2.6) then we can help you. -
Can someone help me connect to mysql?
wildteen88 replied to kidzkit's topic in PHP Installation and Configuration
What problems are you experiencing? If you're getting a blank page then enable display_errors and make sure error_reporting is set to E_ALL. Save the php.ini and restart server and rerun your script, if you get an error such as "fatal error undefined mysql_connect" then you havn't enabled the mysql extension. if you post your server setup (OS version, PHP version and Server version - example: XP SP2, PHP 5.2.6, Apache2.2.6) then we can help you. -
The more browsers you support, the more you're limiting yourself really. As I said before stick with IE6/7, FF2+, Safari and Opera. If you want to support older outdated browsers use a non-css design, such as frames. For more modern browsers use CSS.
-
From my testing, using single quotes is faster then going in and out of PHP/double quotes. However going in and out of PHP is faster then double quotes. Benchmark script: <?php function timer() { list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } $iterations = 1000; $t1 = timer(); echo '<div style="width:250px;height:200px;overflow:auto;margin:10px;border:1px solid #F00;">'; for($i = 0; $i < $iterations; $i++) { ?> Line #<?php echo $i; ?><br /> <?php } echo '</div>'; $t2 = timer(); echo '<div style="width:250px;height:200px;overflow:auto;margin:10px;border:1px solid #F00;">'; for($i = 0; $i < $iterations; $i++) { echo 'Line #' . $i . '<br />'; } echo '</div>'; $t3 = timer(); echo '<div style="width:250px;height:200px;overflow:auto;margin:10px;border:1px solid #F00;">'; for($i = 0; $i < $iterations; $i++) { echo "Line #$i<br />"; } echo '</div>'; $t4 = timer(); $total1 = $t2-$t1; $total2 = $t3-$t2; $total3 = $t4-$t3; $total = $t4-$t1; echo "in-out PHP : $total1 <br />"; echo "in PHP (single quotes) : $total2 <br />"; echo "in PHP (double quotes): $total3 <br /><br />"; echo "Total : $total <br />"; ?> My Results:
-
In order for the extra/httpd-vhosts.conf file to be read by Apache you need to remove the # on this line in the httpd.conf Save the httpd.conf and restart Apache. Test your virtual hosts
-
Make sure you are editing the correct httpd.conf, and that the line you're editing is not commented out (identified by a # at the start of the line).
-
$array = eval($line); should be: eval("\$array = $line;");
-
You're not explaining yourself properly, What do want it to look like? How are we supposed to know whats supposed to look like if you give us fake urls. If you did: echo file_get_contents('http://www.google.com'); The google homepage will be displayed on your site. The same applies to the urls you're providing.
-
What do you mean strict?
-
Whats the server got to do with it? Whats wrong with my suggestion earlier?
-
Like this. For browser compatibility stick with IE6/7, FF2/3 Safari and Opera. More here.