wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Gayner is running an UPDATE statement which doesn't return any results. So these functions will not serve any purpose. What are expecting to be returned from your test() function? What are you trying to do. Functions do not return anything unless you tell it to.
-
This FAQ Post will help you out.
-
Place a .htaccess file in /folder1/folder2/ with the following code deny from all Now now one will be able to browse to any files/folders placed within yoursite.com/folder1/folder2/
-
Well r stands of read only. For writting use w Take a few minutes and look at the manual for the fopen function, scroll to the modes sub section. It lists all the possible modes and what they each do.
-
Changed php.ini file. How do I restart php?
wildteen88 replied to Moron's topic in PHP Installation and Configuration
Make sure the php.ini your are editing is the one php is reading. To check this, run the phpinfo() function and check the line labelled asLoaded Configuration File. If PHP is reading a php.ini, this will show the full path to its location. You only need to restart the HTTP server (in your case IIS) when you have made any changes to the php.ini. -
This is wrong echo '<SCRIPT type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/s/a?url=www.ssa.co.uk'></SCRIPT>'; echo '<SCRIPT type='text/javascript' language='JavaScript' src='http://xslt.alexa.com/site_stats/js/t/a?url=www.ssa.co.uk'></SCRIPT>'; You need to use " around your html attribute values. echo '<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/s/a?url=www.ssa.co.uk"></SCRIPT>'; echo '<SCRIPT type="text/javascript" language="JavaScript" src="http://xslt.alexa.com/site_stats/js/t/a?url=www.ssa.co.uk"></SCRIPT>';
-
Variables are not parsed within single quotes. Remove the ' around $sitename
-
??? Post your question more clearly.
-
I'd use file instead. file returns an array of lines. Then you can use a loop to easily check each line. $lines = file('data.txt'); foreach($lines as $line) { $bits = explode('||', $line); echo '<pre>'.print_r($bits, true).'</pre>'; }
-
I would recommend you to take a look at regular-expressions.info for common regex patterns. It helped me understand regex when I was learning.
-
You wouldnt need to change the code much. You'll first need to connect to mysql at the start of the script. Then to insert the file in to the database you'll place your insert query where these lines are move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; I'd store just the file name within the database not the file itself. So as an example I'd replace the three lines above with this $mp3_name = $_FILES["file"]["name"]; $mp3_path = "upload/$mp3_name"; move_uploaded_file($_FILES["file"]["tmp_name"], $mp3_path); $sql = "INSERT INTO mp3_files_table SET name='$mp3_name', path='$mp3_path'"; $result = mysql_query($sql); if($result) { echo 'MP3 Upload successfully'; } else { echo 'ERROR: Upload Failed'; }
-
Storing logins in text files is not recommended. It is very insecure. You are better of using a database.
-
Why do that when that is what nl2br is for?
-
The line breaks are there. Web browser ignore whites space, such as newlines. if you look in your page source you'll see there are in fact there. In order for a web browsers to render a new line you must use the line break tag --<br /> nl2br converts the newlines to line break tags for you. You use nl2br on the variable that contains the text with the new lines. Example <?php if(isset($_POST['text'])) { echo '<b>Without nl2br</b><br>'; echo $_POST['text']; echo '<br ><br >'; echo '<b>With nl2br</b><br>'; echo nl2br($_POST['text']); } ?> <form action="" method="post"> <textarea name="text">text with new lines!</textarea><br /> <input type="submit" name="submit" value="Post" /> </form>
-
Use nl2br
-
For IIS you should download the version labelled as VC9 x86 Thread Safe. Download the zip package not the msi installer. Extract the contents of the zip to C:/PHP. For setting up IIS6 with PHP read this article
-
You cant disable that error. You're running PHP5.3, which no longer supports eregi. You'll want to use the preg_replace function instead.
-
By this they mean the use of defining variables as global within functions. If I didn't see the code for your find_selected_item_id() function how would I know where the variable $sel_sec, $sel_cat, $sel_pag and $sel_usr are being defined? I would have to hunt through masses of code to find out.
-
It should actually be printf("Incorrect response %s<br />", $row["incorrect_resp"]); As per the manual on printf
-
Dreamweaver - Indent with 4 spaces
wildteen88 replied to xenophobia's topic in Editor Help (PhpStorm, VS Code, etc)
If I remember correctly from using Dreamweaver CS you can change this via a setting somewhere in Edit > Preferences -
They wrote their replies backwards
-
[SOLVED] Parse Error that I don't understand.
wildteen88 replied to frostyhorse's topic in PHP Coding Help
Look at ReKoNiZe's post that will fix your error. -
$_GET[' c '] should be just $_GET['c'] PHP will see $_GET[' c '] as a completely different variable.
-
Check Apaches error log to see why you're getting that error.