wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
There is nothing wrong with that calendar. Clicking the <- and -> buttons cycles through the months/years correctly.
-
SELECT * FROM $variable instead of the tablename possible?
wildteen88 replied to Bentley4's topic in PHP Coding Help
Because your concatenating the string. The . (period) is the concatenation operator. -
You mean something like this $str = '$#La souri$<<>-//s a été mangée par le chat '; $str = preg_replace('/[^\p{L}\s-]/u', '', $str); echo $str; //Outputs La souri-s a été mangée par le chat This is not my code. I found a similar question here http://stackoverflow.com/questions/3436746/help-with-preg-replace-and-special-chars
-
Or you can use array_map function convertZero($value) { return ($value === 0) ? 1 : $value; } $array = array(15,22,0,43,0,6); $array = array_map('convertZero', $array);
-
If you need the file to be created by your code then apply write permissions to the folder that the file skata is in (0777). If you have already created the file then just apply write permissions to that file (0666 should be enough).
-
At the moment you're using absolute file paths for including the bbcode parser. However the parser itself is only using relative file paths. Example @include_once 'HTML/BBCodeParser/Filter/'.$filter.'.php'; Maybe try adding /home1/elvonica/php/ to your include_path. Eg ini_set('include_path', ini_get('include_path').':/home1/elvonica/php'); require_once 'HTML/BBCodeParser.php'; $parser = new HTML_BBCodeParser();
-
This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=334386.0
-
Does the file Basic.php exist in /home1/elvonica/php/HTML/BBCodeParser/Filter The function HTML_BBCodeParser() is trying to load the basic filter. For some reason PHP is unable to read/find the basic filter. This is why you are getting the error message.
-
When the form has been submitted use the $_POST['color'] superglobal variable. This will return the value of the selected radio button
-
Use extract list($month, $day, $year) = explode('/', $row['date']); EDITED
-
Your while loop is not constructed correctly. $i = 0; should be on the line before the while loop. Also you could just let MySQL add up the followers using the SUM() mysql function $query = "SELECT SUM(followers) AS total_followers FROM user_profile"; Then you can get the total using $row['total_followers']
-
Or use pathinfo $ext = pathinfo($image, PATHINFO_EXTENSION);
-
You would only pass $last_id to a hidden form field if wasn't going to use sessions. Since you are now using sessions then there is no need to have it within your form.
-
When using the serialized array in your query you should first pass it to mysql_real_escape_string. $abc= mysql_real_escape_string( serialize($real) ); $dql = "INSERT INTO countrytype (`ID`,`fromcountry`,`tocountry`) VALUES ('','".$abc."','".$abc."')"; When you are retrieving the serialized array this line is not needed, remove it. $des=explode(",",$row['fromcountry']); This line $des=unserialize($row['fromcountry']); Will restore the array.
-
need help please putting together a mysql query in php
wildteen88 replied to gibsongk55's topic in PHP Coding Help
The query I posted most probably wont work. I only posted an example SQL Query of how to query multiple tables using joins. You cannot define (PHP) variables within SQL code. You first need to run the query using mysql_query and then retrieve the results using one of the mysql_fetch_* functions (eg mysql_fetch_assoc). No. Because that is invalid MySQL syntax. -
need help please putting together a mysql query in php
wildteen88 replied to gibsongk55's topic in PHP Coding Help
As you're needing to query multiple tables to get the necessary values you'll want to use a JOIN in order query these tables at the same time. Reading your post I have came up with this untested query. SELECT domain.manual_approve register.username FROM alldomain LEFT JOIN domain ON (domain.id = alldomain.id) LEFT JOIN register ON(alldomain.userid = register.id) WHERE alldomain.domain = '$link_url' I don't know how you're linking the records in the domain table with the records within the alldomain table. I have guessed you're using an id field LEFT JOIN domain ON (domain.id = alldomain.id) -
How to delete lines from a txt file based on checkbox selection
wildteen88 replied to anzacdan's topic in PHP Coding Help
How are your users stored within your text file? I guess they are sperated by a : -
Is this fltAccessories being set by a form the user submits? Maybe you should use post rather than get. Or if it is being defined from a link the you use urlencode when defining the value to fltAccessories.
-
if the posts are being saved to mysql database then setup an auto_increment id field. MySQL will then assign each post you add to the database its own unique id number. You'd use HTML/CSS to position the content in the pages. Just use PHP to output the text/image.
-
By the way you may want to look into using ternary operators (eg: ( condition )? true : false ). You can recode the if/else statement with just two lines $selected = isset($_POST['industry']) && $industry['industry_id'] == $isset) ? ' selected="selected"' : null; echo "<option value=\"{$industry['industry_id']}\"{$selected}>${industry['industry']}</option>\n";
-
I guess you mean if (isset($_POST['industry']) && $industry['industry_id'] == $_POST['industry'])
-
Because you are reloading the page PHP will not carry over the $last_id variable. In order to send this variable to the next page you need to either include it within your form as a hidden form field. Or set it as a session variable $_SESSION['last_id'] = $last_id; IMPORTANT make sure you call session_start() as the first line in your PHP files that uses sessions.
-
Post the code you're using to store the serialized array within the database.
-
sort decimals least to greatest and vice versa?
wildteen88 replied to devWhiz's topic in PHP Coding Help
Use arsort($ratios); instead of $highestRatio = max($ratios);. Then use a while/each loop (look at example 2) to out out each property. EDIT Or just use a foreach loop on the $ratios array, eg foreach($ratios as $propertyKey => $ratio) -
Are the passwords in your database stored as md5 hashes. Also make sure the password field is set to at lease 32 characters. md5() will return a 32 character hash, if the password field does not store enough characters the query will always fail.