- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 13
- Posts with Upvotes
- 12
- Upvoting Members
- 12
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 1
Avid enthusiast of CakePHP, hopelessly addicted code junkie, legend in my own mind
128 Posted Topics
I'm using Ubuntu server 12.04 LTS, nginx, PHP5, PHP5-fpm Recently I upgraded my PHP from v 5.3 to what I thought would be 5.4 but the package I used was further along than I thought and I ended up with v 5.5. It upgraded with no issues but I really … | |
Re: Been a while since I used Vbulletin but this may help. Go to: >Vbulletin Options >User Registration Options Untick the "Verify Email address in Registration" | |
I'm receiving an 'undefined index' error when calling a new window and I can't quite figure out why. Seems to me like the variable is not being passed, or holds no value, and again I can't figure out why. I use an identical code for 'state' with no issues. Here … | |
Does anyone feel that Cake is worth the trouble it takes getting used to it? I don't mind putting the time into learning it as long as it pays off in the end. They claim you are up and running faster and spend less time re-inventing the wheel and while … | |
Re: A simple query would easily accomplish that, or am I not following what you are looking to do? [code] $fruits=mysql_query("SELECT atitle FROM table2 WHERE qid='1' "); while($row=mysql_fetch_array($fruits)){ $fruit_type=$row['atitle']; echo ''.$fruit_type.'' ; } [/code] That would output a list of fruits from your table. You can do the same for vehicles. | |
Re: What is the situation where you wouldn't want some sort of user input? Java/Ajax could do something like that but that's not really my dept. I wouldn't be much help there. | |
I'm trying to output the results of an array to a table. To be more specific, I'm trying to output pictures ... let's say 5 pics per row for example. Below each pic I'd like to display a few options like delete, etc. I'm not looking for the answer, just … | |
Re: Just throw the username into a variable and escape it that way. [code] $username = mysql_real_escape_string($_POST['fusername']); $cxn = mysqli_connect($host,$user,$password,$database) or die("Query died: connect"); $sql = "SELECT username FROM Member WHERE username='$username'"; $result = mysqli_query($cxn,$sql) or die("Query died: fusername"); $num = mysqli_num_rows($result); [/code] There are some functions to help with preventing … | |
Re: Use your where clause to filter out the data. [code] $gender = $_SESSION['gender']; // or how ever you are accessing the gender data $query ="SELECT id FROM databasetable where gender <> '$gender' "; // Will select id's of the opposite sex [/code] ![]() | |
Re: There may be a better solution to this but a really quick way to get around it (I think) would be to nest one loop inside of the other (wouldn't be my first choice). [code] <?php $sql_list = mysql_query("SELECT DISTINCT BCountry FROM tblblogs"); while($row_list=mysql_fetch_array($sql_list)){ echo $row_list['BCountry']; $get_town = mysql_query("SELECT DISTINCT … | |
Re: If you are dealing with a single record, ticket #, link, etc. [code] <a href="http://mysite.com/view_ticket.php?id=<?php echo $row['_ticketNum']; ?>">Click Here</a> [/code] On the next page (view_ticket.php) [code] $ticket_id = $_GET['id']; [/code] If your are dealing with multiple ticket #'s and hyperlinks at the same time the process would be the same … | |
Re: You have onChange set up to submit the form when Category changes, what is it that you were expecting it do? | |
I'm toying around with a script to allow users to search for other users based on certain criteria contained in their profiles. Anyhow, some of the attributes on the user profiles are things like what they are seeking like dating, someone to talk to, etc. I decided to serialize the … | |
I'm toying around with a script to allow users to search for other users based on certain criteria contained in their profiles. Anyhow, some of the attributes on the user profiles are things like what they are seeking like dating, someone to talk to, etc. I decided to serialize the … | |
All arguments aside from using $html->tag() instead of <tag> ... I'm a trying to create a table to display photos I'm pulling from the database and something is amiss. When I was testing this I changed $num_cols to 2 and it ended the row and started a new one after … | |
Re: Your setup will either echo "hello" or echo "world", but the way it's set up it will never output "hello world." So what was the question? | |
Re: I think this is what you are looking for: [CODE] for($i = 1; $i <= $round; $i++;) { /*** connect to db ***/ $conn = dbConnect('admin'); /*** set the error mode ***/ $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "INSERT INTO round (id, team, round, time, result) VALUES (?,?,?,?,?)"; /*** our sql query … | |
Re: This should work for you. [CODE]if($row->played_time >= 60){ $time = round($row->played_time,2) / 60 .' mins';} elseif($row->played_time >= 3600){ $time = round($row->played_time,2) / 60 / 60 .' hours';} elseif($row->played_time >= 86400){ $time = round($row->played_time,2) / 60 / 60 / 24 .' days';} else{ $time = round($row->played_time,2) .' secs'; }[/CODE] ![]() | |
Re: The value and names of your radio buttons are going to be numbers, not names (or text). [CODE] //This will not do anything for you: if(isset($_POST['ed']))[/CODE] | |
Re: Your query doesn't look quite right to me. Here is the syntax for using an inner join. [code] SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name [/code] | |
Re: I seems like you might have your error reporting set to show E_NOTICE level errors. When error reporting is set to this level it will pester you about trying to use unassigned values amongst other things. If this is the case changing your error reporting level would correct this. [code] … | |
Re: Have a closer look at your use of quotes. Try this: [code] foreach($rows as $row) { $result .= '<li><a href="javascript:void(0)" onclick="javascript:chatWith('.$row->username.')">' .htmlspecialchars(getNameFormatOnline($row->name,$row->username,$ueConfig['name_format'])).'</a></li>\n'; } [/code] | |
Re: It sounds to me like your are storing your passwords as plain text. If this is the case it's always a very bad idea to store your passwords this way. Hashing your passwords before you save them to the database will keep curious admins or mods from being able to … | |
Re: My two cents would be that the errors are coming from the way the single and double quotes are structured. Some are missing and others need to be escaped. Perhaps it should look something like this: photo.php [code] .'<a href="viewAlbum.php?aid=$row['aid']">'; .'<img src="$row['filepath'].$row['filename']" border="0"/>'; .'</a><br/><span class="thumbText">'; .'<a href="viewAlbum.php?aid=$row['aid']">$row['stitle']</a><br/>'; ."$row['photog']</span></div>"; } mysql_close($con); … | |
Re: The query looks fine, what is the difference between $poster and $user ? | |
Re: What do you mean when you say it is giving you infinite results? It is not limiting your result set to 2 ? | |
Re: I'm not quite sure I understand what you mean by [quote]how to make a browser game map [/quote]. I've spent a lot of time in the past working with the Google Map API and it's capable of some really cool things if you take the time to work through it … ![]() | |
Re: Make sure that this is the correct path to the application.php file and that the file actually exists in that location. [icode]../../GrBx/cw3/admin/application.php[/icode] <--------- It's looking for the the application.php file and it's not finding it. Some common reasons for this error are the filename is misspelled, the path to file … | |
Re: Not too sure what type of "Calculation" you are looking to do but in any case it's not difficult. [code] <form method="post" action="some_page.php"> // assign a page the form will submit to, it can the same page or a different one. <input TYPE="checkbox" NAME="Saturday" VALUE="1" > <input TYPE="checkbox" NAME="Monday" VALUE="2" … | |
Re: It doesn't look like you are executing your query. Tacking an [icode]or die(mysql_error());[/icode] on the end of the query will give you an immediate heads up if there is an error in your query. There are a few other possibilities why it's not working but I would start here. Try … | |
Re: For my html mail the only thing I did was alter my headers and there was really no problem. It's not that much different from what you already have. I suppose this is something I could stand to learn a little more about ... once I got it working I … | |
Re: Your pulling this [icode] $row_rsCWResults["product_ShortDescription"] [/icode] from a separate page in your script. The best option for what you have going on is to query the db again to pull that value for the page where it's needed. A generic query would look something like this ... you can fill … | |
Re: You're a bit confused with how $_GET works. On your content.php page if you want to pull the 'id's from the db and use them in a hyperlink it would be done like so: [CODE] $query=mysql_query("SELECT id FROM table_name WHERE id <> '' "); while($row=mysql_fetch_array($query)){ $id=$row['id']; echo '<a href="content.php?id='.$id.'">Some Text</a>'; … | |
I've noticed a lot of posts lately with "how do I do this?" and "how do I do that?" You've somehow managed to end up with an entire db full of data and not the slightest clue what to do with it or how to use it. Rome wasn't built … | |
Re: It can be done using AJAX if you don't want the page to reload. | |
Re: [code] session_start(); // INSERT query here $_SESSION['last_insert'] = mysql_insert_id($link); [/code] That should give you the gist of it. | |
Re: It's not hard to figure out ... all you have to do is TRY. [url]http://www.w3schools.com/PHP/php_file_upload.asp[/url] | |
Re: The first thing that comes to mind is that [icode] $_POST['register'][/icode] is not set. Have you tried anything to verify a value is being posted? ie. [code] if(isset($_POST['register'])) { echo 'IS SET'; die; } else { echo 'IS NOT SET'; die; } [/code] | |
![]() | Re: I'm with Ardav on using a framework for your JS / Ajax requests. It does pay to write out your scripts the long way in the beginning when you are learning just to get a feel for what the script is doing but you can literally turn this: [code] function … ![]() |
Re: Have them enable and allow pop-ups from your site ?? | |
Re: [code] if(in_array( $_GET['value'], $array)) { // Do Something } [/code] | |
![]() | |
Re: You have a syntax issue .... Try this and notice the changes I made: [code] echo"<tr><td>$row[0]</td><td>$row[1]</td><td><a href='myform.php?mode=edit&coursecode=$row[0]'>edit</a></td</tr>"; [/code] | |
Re: I think I can see what you are trying to do but just to be sure, why are you defining your $_SESSION variables again at the bottom of the page? Try dropping the $_GET and $_SESSION variables at the bottom of the page and rewrite the top where you initially … | |
Re: [quote]whenever I use a submit button only the selected value in the select box is posted[/quote] That's kinda' the way it works. Why would you want to post ALL values in the list ?? You already know the values the list contains so there is no need to post them … | |
[code] if( $_SESSION['user_id'] <> 1) { $ref = $_SERVER['HTTP_REFERER']; header( 'refresh: 5; url='.$ref); echo $_SESSION['user_id']; // <----- echoes '1' echo "<h2>Some feature is currently unavailable.</h2>You will be redirected to $ref in 5 seconds"; die; } [/code] I've written this a hundred different ways and it still redirects even though the … | |
Re: If you are using a cookie just to identify a user why not use [icode]$_SESSION[/icode] to hold the user id ? | |
I'm working with Google API trying to plot multiple points on a map. I can't find really good documentation on how I need to do this so I'm sort of winging it at this point. Obviously what I have is not working. The map is displaying and centered where I … |
The End.