wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
If there are spaces between each column then it may require a bit of regex in order to convert mulktiple spaces into one. Trim only rmoved space form the start and end of a string.
-
Sorry I didn't reply to your message the otherday. Is the spaces at the start of each line before the first column? (the id coloumn). If it is you can use a function called trim within the for loop which will get rid of any space before and after a line. So change this: [code]list ($id, $price, $qty) = explode (" ", $row[$i]);[/code] to: [code]list ($id, $price, $qty) = explode (" ", trim($row[$i]));[/code]
-
I think you need to the place date in the perenthesis like so: UNIX_TIMESTAMP(NOW())
-
Yeah, get rid of that blue background! Swap that background with a lighter more appealing colour. Dont use defualt fonts. Also what on earch is a source code artist or html artist? Do mean a programmer/coder?
-
Something like this: [code]<?php $str = '<table border="1" width="500" cellpadding="5" cellspacing="5"> <tr> <td>Some data</td> </tr> </table> bal'; if(preg_match("#<table ([^>]*)>(.*?)</table>#is", $str, $matches)) { #echo '<pre>' . htmlentities(print_r($matches, true)) . '</pre>'; // get our table attributes $attr = explode(" ", $matches[1]); // echo out our attributes echo '<pre>' . htmlentities(print_r($attr, true)) . '</pre>'; } ?>[/code]
-
Thread closed you already posted this problem in the PHP Installation forum. Please do not post duplicat threads around the forum. [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=96797&pid=387967&st=0entry387967\" target=\"_blank\"]Link to post[/a] Also I would recommend you to download the zipped binaries rather than the MSI package for PHP. PHP doesnt need an installer if you're using Apache. With the zipped binaries you can just extract the contents of the file to where you want php to be installed to. Also reason why you are getting that error is because there was a license change between PHP and MySQL. Thats whay PHP no more comes with built in MySQL support. In order to use mysql functions you need to enable the mysql extension.
-
I would suggest you use htmlentities when the data is pulled into the textarea like so: [code]<textarea ... blah ...><?php echo htmlentities($file_contents); ?></textarea>[/code] then when you got to save the changes use a function called html_entity_decode This will undo the changes htmlentities did, like so: [code]$file_contents = html_entity_decode($_POST['textareaName']);[/code]
-
linuxforum.com mysql error
wildteen88 replied to x86processor's topic in PHPFreaks.com Website Feedback
This problem should rectify itself. its a result of too many connections to the database. The server should restart itself or the site should come back once the connections have timed out, we get it here sometimes. It should backup in an hour or so. -
There is a an FAQ on this subject [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=95378\" target=\"_blank\"]here[/a].
-
If you have Apache2 add this line to your httpd.conf file: [code]PHPIniDir "C:/php5"[/code] Once you have added that save your httpd.conf file and restart Apache.
-
Most of those keywords you have stated are reserved words. [a href=\"http://www.php.net/manual/en/reserved.php\" target=\"_blank\"]Click here[/a] to read up on them. It wont explain what each one does but it'll show where you use them. Also any one that states RTFM agian will be given a warning instantly, If you want someone to read the manual point them to it.
-
We got there in the end! I'll mark this as solved!
-
The .DS_STORE file is MacOS X file. It holds the information which controls the way a folder will be opened; i.e., the shape and size of the window, the position of the window on the desktop and whether file, folder or icon view has been selected. If you were to delete the .DS_Store the folder would revert to the system default next time it is opened and a new blank .DS_Store would appear (invisibly). Have a read of [a href=\"http://filext.com/detaillist.php?extdetail=DS_STORE\" target=\"_blank\"]this[/a] for more info. This has nothing to do with MySQL. [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]
-
By looking at the [a href=\"http://members.lycos.co.uk/wipe_out/automysqlbackup/\" target=\"_blank\"]homepage[/a] of that script it is "cron job" code, if there is such as thing. And it looks like you may need root access to use it. Have a look at the installation part (bottom of page). Umm, it looks like we are failing you! :( Would you believe it! We have a premade one here! [a href=\"http://www.phpfreaks.com/script/view/11.php\" target=\"_blank\"]CLICKY[/a]. It looks like there is very few scripts on this! Or I'm putting in the wrong keywords to search for such a script!
-
Inserting data into MySQL using a form with checkboxes
wildteen88 replied to joelphil's topic in PHP Coding Help
Thats because you need to add the code in for that! Which is the following: mysql_query($sql) or die(mysql_error()); I thought you had that, thats why I left it out. -
Inserting data into MySQL using a form with checkboxes
wildteen88 replied to joelphil's topic in PHP Coding Help
Something like this: [code]<?php if(isset($_POST['submit'])) { for($i = 0; $i <= 3; $i++) { $choice[$i] = isset($_POST['choice'][$i]) ? $_POST['choice'][$i] : 'NULL'; } $sql = "INSERT INTO tbl_name (choice1, choice2, choice3, choice4) VALUES ('" . implode("', '", $choice) . "')";# echo "Query built: <code>" . $sql . '</code><br /><br />'; } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" METHOD="post"> <INPUT type=checkbox name="choice[0]" value="one">One <INPUT type=checkbox name="choice[1]" value="two">Two <INPUT type=checkbox name="choice[2]" value="three">Three <INPUT type=checkbox name="choice[3]" value="four">Four <INPUT type=submit name=submit value="Submit">[/code] Probably a long route but it does what you want to do. -
Your HTML is a complete mess! Also you have two style sheets which are the same! But they have different values! You do know that deviantcore_v2.css is over ridding the styles set in style.css! Seems pointless to have them like that!
-
Yes. You can style any html that you specify after .div_name, like so: .div img { // style here }
-
If you want to remove ' from s users username use str_replace instead: [code]$username = str_replace("'', '', $username);[/code] If you want to remove other characters from the username, such as double quotes you can do this: [code]$username = str_replace(array("'",'"'), '', $username);[/code]
-
Thos \r or \t chars are shortcuts for manually entering in a return or entering in four spaces etc in PHP. However you will still need to use the \ character to escape quotes incase your Java code has double quotes in etc. So you can it like this: [code]<?php $java = "class HelloWorld { public static void main (String[] arguments) { System.out.println(\"Hello World\"); } }"; $h = fopen ("hello_world.java","wb"); fwrite ($h, $java); fclose ($h); ?>[/code] However when you file is written those backslashes or whitespace characters (\r\n) etc arn't going be seen in the file it is being wrtitten to. They are only there for PHP, especially the escaping of the double quotes. Becuase when you start a string with a double quote, and you have a double quote half through your string PHP will think you have finished defining the string. When the you escape the double quote it'lll continue on until finds another unescaped double quote, which should be the last one you have finished defining a string. Hope that helps.
-
No one can see your source code of your PHP scripts. It'll only display the output. The only way a person can see the source code to your scripts either the following: * You save your script in either .phps which highlights the source code (the server must be configured in order for this to happen), or if you save your files with a file extension other than .php. But if you are saving your files as filename.inc everyone can see the source code. UNLESS your server is configured to parse .inc files as PHP * A hacker manages to obtain your FTP/Web site control panel details Thats the only way of someone managing to view the source code of your PHP scripts. Now the reason why people may encode thier source code is because they may be selling thier scripts and dont want thier customers to edit the script in anyway, such as removing the copywrite from the script. Encode/Decoding PHP source code can be very expensive, unless the hacker has a few $1000+ hanging about in order to decrypt the source code.
-
[!--quoteo(post=387358:date=Jun 24 2006, 04:21 AM:name=hvle)--][div class=\'quotetop\']QUOTE(hvle @ Jun 24 2006, 04:21 AM) [snapback]387358[/snapback][/div][div class=\'quotemain\'][!--quotec--] i think so too, but look at how Session handled this issue. session_register($somevar); and you can recall this $somevar in the session array: $_SESSION['somevar'] [/quote] No that is not how sessions handle it or anyother function in php. It doesnt create a session var [b]somevar[/b] if your variable is called $somevar. It creates the session variable based on the [b]value[/b] of $somevar. So if you had this: [code]// assign $somevar the value of 'hello' $somevar = "hello"; session_resgister($somevar);[/code] It'll create a session variable based on the [b]value[/b] of [i]$somevar[/i] which will be [b]hello[/b] and so the variable created is this: [i]$_SESSION['hello'][/i] It is not chopping of the dollor sign or anythink like that, it replaces the variable with its value. Thats how variables work.
-
You have output around line 2 in member.php5 What on lines 1 - 3 in member.php5? Post those lines here.
-
If you want to change the colour of the scrollbars in FF you cant. FF doesnt support this. Also as moberemk pointed out. You have two periods for your class names. It should be one period like so: [i].className[/i]
-
Hi, SA I found out you can put space before the opening parenthesis on functions: [code]fopen ();[/code] and it'll allow you to post your code, but the good thing is PHP still parses the code with the space before the perenthesis. I modified your post. I hope you didn't mind, :)