AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
Well, either way, the .val() method should always be used to get a value from an element. So you are saying that $(this).find("input").val() does not work either? If not, a couple of questions I have just for some additional info: 1. What version of IE are you using to test this? 2. What version of jquery? 3. Can you please post the snippet of code that this script is meant to grab the value from. 4. Would there by chance be any conflicting code? 5. Are there any errors present before reaching this script? IE is known to stop parsing script if there is an error present.
-
well, i'm really not sure since I haven't used localhost to test a site in a while. Your computer acts as the server, so perhaps it's just grabbing the time from it. I am sure someone else will chime in with a solution. But really, if this is localhost, it shouldn't be a huge deal. This problem will most likely not occur on a live server.
-
my suggestions still stand.
-
set the date.timezone directive in the master php.ini of your site. Using the date_default_timezone_set() function is a per-page basis. Is this localhost or a live server?
-
How to validate a specific hyperlink from different links using php
AyKay47 replied to compphp's topic in PHP Coding Help
Depending on the context, you may be better off using string functions for this. $str = "some text http://www.test.com/qs"; $start_pos = strpos($str,"http://"); $end_pos = strpos($str,"/",$start_pos + 1); $substring = substr($str,$start_pos,$end_pos); *untested* -
Refer to my first reply, you have not changed anything according to my recommendations. You need to debug your query and use $_SESSION instead of session_register()
-
Array and foreach Loop problem: Display days of week. Help please
AyKay47 replied to hereisgoes's topic in PHP Coding Help
Homework? -
you sifted through thousands and thousands of posts trying out the code for each one? Impressive..
-
You mean the last 5 rows? A combination of ORDER BY and LIMIT would most likely be the solution, however we would need to see the db table setup.
-
No, mysql_query() returns the resulting table from the SELECT query, not a boolean. Those parts of the code are correct. mysql_query returns a boolean FALSE upon error, and a mysql result resource otherwise.
-
What? This has nothing to do with the triggered error.
-
Are you asking for a good place to find information on PHP or where you can get help with an issue you are having with existing code?
-
The error indicates that the query is returning a boolean FALSE due to an error in the SQL. 1. check for the $_POST values being set before using them using isset 2. Add some debugging in your script, echo the SQL and mysql_error upon query failure. $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql) or die($sql . "<br />" . mysql_error()); 3. session_register() is deprecated, use the $_SESSION superglobal array to set session values instead.
-
Sure, I used whats called a join, which can link two or more tables together based on specific conditions. JOIN docs
-
Instead of having a query inside of a loop, which you should always avoid doing, use a JOIN and filter the results of the join using the ON clause. $event_select_sql = "SELECT e.*,u.* FROM events e LEFT JOIN users u ON (u.id = e.id_user) WHERE e.event_date = '$datum' AND e.id_user != {$_SESSION['id']}"; $event_select_query = mysql_query($event_select_sql) or die($event_select_sql . "<br />" . mysql_error()); while($events = mysql_fetch_array($event_select_query)) { //create table with db fields... } Also, avoid selecting every field from a db table, this will slow down the query. Instead, select only the fields that you are going to use.
-
please tell me that's not an actually beer brand.. heh
-
you know what carbonated piss tastes like?
-
To do that we would need to see the code that is sending the form values.
-
Array ( [Mname] => me [email] => test@testing.com [phone] => 2483200036 [btime] => never [Cname] => my mom [city] => anywhere [state] => MI [age] => 138 [gender] => Female [startDate] => 02/29/2012 [hours] => 15 hours [days] => m-w-f [extra] => please call me now [referral] => google [submit] => Send Now ) the issue is pretty self explanatory, so I will ask you. What do you see wrong with that $_POST array?
-
I said in my post that it depends on a few conditions whether or not my code is viable. But yes this is certainly a better solution.
-
You will have to tweak the padding to make it work. As for the span being next to the user image, it's not because class='icon' has a margin-right of 5px; You will most likely have to create another class or id specifically for the user pic anchor. .user-icon { background-color: red; background-repeat: no-repeat; background-position: center center; padding: 1px 15px 5px 15px; //no margin }
-
I have no clue how this code is set up.. I highly doubt that re-defining a $_POST value is the best way to go about this. But without seeing the entire relevant code, I cannot give a better answer.
-
This can (and probably should) be done in the query itself. Since all I see are SELECT * from a random php variable, I cannot be precise with the query, so I will give you some pseudo code that you can tweak for yourself. Also, it's a bad habit to get into using SELECT *, you should be selecting only the fields that you are going to be using. Using SELECT * is not optimized unless you actually want to select all of the fields for use. Again I don't know you table set up etc. so this code will not be precise: SELECT COUNT(XS) as XS_count, COUNT(S) as S_count, COUNT(M) as m_count, COUNT(L) as l_count FROM canonkickoff WHERE Prevoz = 'Yes' Depending on how you want to go about this, you may want to incorporate this into an existing query using either a join or subquery. Also, I am expecting that the Prevoz field contains the literal string "yes" and "no", if it is a type BOOL, the query will change to 0 and 1.
-
<?php // add a checkbox for delivery charges echo '<span class="form"><label>Delivery Charges</label>'; echo '<input type="checkbox" name="del_charges" id="del_charges" value="1" class="boxes" '; if ( isset($_POST['del_charges']) && !empty($_POST['del_charges']) ) echo 'checked="checked"'; else //do whatever you need to do here to remove the delivery charge echo '/>'; ?>
-
You could store each keyword in an array and then display the count of the array, depending on how many keywords there actually are. This might be better done from the query itself using COUNT(), but without seeing it it's hard. Here's a snippet of what I am talking about for the PHP: $tags = explode("|", $row[0]); $moon = array(); $sun = array(); for($i = 0; $i < count($tags); $i++) { switch ($tags[$i]) { case "moon": $moon[] = $tags[$i]; break; case "sun": $sun[] = $tags[$i]; break; } } echo count($moon) . "<br />" . count($sun);