akphidelt2007
Members-
Posts
174 -
Joined
-
Last visited
-
Days Won
2
Everything posted by akphidelt2007
-
Ok, so let me just clarify what you're saying. When I go to ESPN.com and they have me logged in and are connected to my Facebook account through cookies that are located on my computer that they are accessing. When I use Curl to access ESPN through my localhost, ESPN does not have any cookies they can use to access from my computer like if I'm just using the browser myself?
-
I might be missing something here. But I'm talking about being the client and cookies that other sites have stored on my computer or server. Is there a way to check those through php to see if they exist? Like to check if I have a Cookie from ESPN and want to delete it before making a curl request. Not sure if it's possible or even makes sense.
-
Alright, this might be a dumb question, but I've been messing with Curl and testing out different functions. One thing, I'm wondering is if there is a way to use curl to access a site and check to see if that site already has a cookie. For instance, if you access ESPN and you see that they have your Facebook info set up. Is there a way to use Curl to check to see if that Cookie exists. I'm using a localhost right now. So I might be missing something here about how to access cookies on your own computer/server. I would post some test code, but I don't even know where to begin. I know how to set cookies and check cookies for users accessing my sites, but for some reason can't figure out if a site I'm accessing through Curl has a cookie on me. Any help will be appreciated. Thanks.
-
Alright, I've been doing this for too long to not understand what is going wrong here. This is pretty straightforward. I have one table with the columns... ID | Year | Away_Team | Home_Team -1---2010-----tacoma--------puyallup -2---2010-----puyallup-------renton -3---2010-----renton---------tacoma -4---2010-----puyallup-------tacoma What I want is just a simple count of the total # of games played by year and team regardless of it being an away or home game. Year | Team | Games -2010--tacoma---3 -2010--renton----2 Any help will be appreciated. Thanks
-
Fetching table info based on array values
akphidelt2007 replied to lquidsilver's topic in PHP Coding Help
Well array(1,2,3,4) is really array(0=>1,1=>2,2=>3,3=>4). And the names are array(0=>Bob,1=>Joe,2=>Tom,3=>Bill). There's multiple ways you can do this. You can use array_search to find the key based on id. But this is just based on the information you have given. There's probably easier ways to do what you are trying to do if we knew what you were actually doing and how you were doing it. -
Someone might be able to spot the problem, but I for one can't at first glance without knowing more information. If I have problems in my code I like going section by section using echo "here"; exit; Or if you think there should be data than echo the variable or print_r($yourdata); exit; Like what does $matches show, what does $comments show?
-
What does function get_comments look like?
-
You can work this through preg_replace... $str = '<div class="text"> <mofish id="testing" type="testing" title="true" /> </div>'; $pattern = '/<mofish[^>]*>/'; $replace = 'whatever'; $newString = preg_replace($pattern , $replace , $str);
-
Edit:: nevermind... scootstah is right.
-
By no means am I telling you this is what you "should" do, but this would bypass the authorized section and prevent the redirect //after $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $mypassword; $_SESSION['importantnumber'] = $importantnumber; //put $_SESSION['authorized'] = false;
-
Is $_SESSION['authorized'] set to false anywhere in your script? Otherwise, this redirects you back to the index.php page where your form is. session_start(); if ($_SESSION["authorized"] == true) { header("location:index.php"); }
-
$_SESSION['myusername'] = $myusername; ...
-
Unless there is more to the code you aren't showing. How is the form submitted? Also... <a href="#" class="remove">Excluir</td> The <a> needs to be closed both in the html and the javascript that adds a new row.
-
It's probably generating an error here but error capturing is not set to display the error so it just pops up with a white page. This should bring up a fatal error as it tries to run these as functions because of the parenthesis. $_SESSION("myusername"); $_SESSION("mypassword"); $_SESSION("importantnumber");
-
Where does $order_id come from? Is it set above the script you showed. All I see is $id = $_GET['id']. Should it be $result->order_id? And when you have you problems with POSTS, print_r($_POST) will help you figure out what is actually getting captured, then you can debug the script at each point to see where the connection is being broken.
-
Post variables from a while loop from a second table in form
akphidelt2007 replied to jgreen's topic in PHP Coding Help
Where is the form script that you are using to submit these POST variables? -
Reconciling Data from two Imports without Unique Identifier
akphidelt2007 replied to akphidelt2007's topic in MySQL Help
I've been doing this long enough where I should know this, but I cannot figure out how this would be done with a query to find entries that do not exist between the two tables using their fields without concatenating? What would be just the basic structure of the query? All I can think of is joining the two but I do not know how I can have a join and find entries that don't match at the same time. -
Reconciling Data from two Imports without Unique Identifier
akphidelt2007 replied to akphidelt2007's topic in MySQL Help
So pretty much I have to create a new field that concatenates those values and searches for them between the two tables? I guess that makes sense as a unique identifier is necessary and as I need to make sure all those fields match the new import, that is the only way. Just sucks to have a uid that could be up to 100+ characters long. Thanks. -
You have to check to see if $i = the current page. Something like this... //for ($i=1; $i<=$total_pages; $i++) { echo "<a href='pagination.php?page=".$i."'>".$i."</a> "; }; //make sure the page variable is set than check to see if the current iteration equals the page. If so just echo out the page # for ($i=1; $i<=$total_pages; $i++) { echo (isset($_GET['page']) && $i==$_GET['page']) ? "<span style='background-color:red;'>$i</span>" : "<a href='pagination.php?page=".$i."'>".$i."</a> "; }
-
Alright, so I have a little project I'm trying to work on. I get handed an expenditure report every week, here are the pertinent fields. Table Name: project_data Project_Num | Employee | Expenditure_Type | Expenditure_Date | Hours | Revenue 123456 | John Doe | Labor - Straight | 2015-01-01 | 1.5 | 255.00 Now, there is no unique identifier in this data. What I want to create is a way the accounting team can import any file they want and it will reconcile the data with what is already in the database. I know how to do right outer joins with ID's to find the differences but I can't seem to figure out the most effective way to do this. Another think to keep in mind is an import can have up to 20,000 rows in it. So if I concatenate all the fields and check the strings I'm afraid it might be a little too slow. I'm thinking of creating a temporary table called: project_data_temp Storing the upload, then the next step is comparing the two tables to figure out what is different from both tables. All my searches on Google have come up with matching unique ids, whereas here there is no unique id. The only way I would know how to do it is to create a new column that concatenates these values in both tables and comparing them. Not sure how efficient that would be or if it is needed. Any help would be appreciated, thanks in advance.
-
Disappearing info when browser back button is hit
akphidelt2007 replied to CloudBreaker's topic in PHP Coding Help
Just from a quick peak... on the landing page you are creating the $userid = $_SESSION['id']. On the project page you are changing the $_SESSION['id'] to $row['id'] which I assume is the row associated with the project. So when you hit the back button, the $userid is now different and picking up whatever ID was associated with the project from the project page. I think. -
You create the $userid only when the request method is POST. So when you see the form the $userid is empty and you aren't getting any results until you post the form. Seems like you might not have error checking set to show when a variable has not been set.
-
Alright, I've been assigned a project at work. I did not develop the application and the individual who did used CodeIgnited framework and mysql as the db. Here's the problem, I'm not given much OT to do this and in our meeting the best way to proceed was to replicate the database for different parts of the organization. Basically we are a subsidiary and have been using an application that other groups within the organization want to use. Usually I would reconfigure the db schema and add org ids and in the user table add the appropriate organization to go to. However, they are not giving me enough time to do that. So what I'm thinking is to just create a copy of the database we use (just the structure) and create a new database. What I want to know is how to use mysql to check to see if a user exists in one database and if they don't then to go on to the next database. I understand this is a very sloppy way to do it, but it's the way we are moving forward. I found the code to connect to the db in CodeIgnitor... how can I connect to a database, check to see if the user exists, then close that db connection and try the next database? /** * Select the database * * @access private called by the base class * @return resource */ function db_select() { return @mysql_select_db($this->database, $this->conn_id); } Thanks in advance.
-
PHP GD Image Graphing problem with color running out
akphidelt2007 replied to akphidelt2007's topic in PHP Coding Help
Still can't figure it out. I echoed out the code that the function I use to draw the lines is using and it comes out with the right coordinates, right color, and everything else. It's just weird you can see the line being drawn in "white" if you look closely. And any color I try does the same thing at the same spot. To me this has to be some kind of memory or size limit issue. I can't find it through googling either. Very frustrating.