Jump to content

jdock1

Members
  • Posts

    210
  • Joined

  • Last visited

    Never

Everything posted by jdock1

  1. Oh, I didnt even read the last few replies. Those are all great ways that would have probably worked as well. I made it way more complicated than it should have been! But thanks guys, I love this site you guys are awesome.
  2. OMG nevermind!! Topic solved. I forgot to switch the form method from "post" to "get". Thats why it didnt work!
  3. Ok so its still not working. I tried using what HDfilmmaker suggested, but at first obviously php parsed header('Location: http://mysite.com/start.php?offer_pgid=071691&email=$email'); as email being $email instead of the variable data. So, I tried this: <?php if(@$_GET['continue'] == "Submit") { $email = $_POST['paypal_email']; header('Location: http://mysite.com/start.php?offer_pgid=071691&email='.$email.''); } ?> But it still didnt work, its redirecting me to the page but the variable $email is just not registering, it came up blank. WHY!??? WHY CANT I GET THIS!??!!! Its SO simple all I am trying to do is pass that variable to the next page!!! I think its becuse Im using an image input type instead of submit because I have NEVER had this problem before!!! Any help at all is GREATLY appreciated at this point! Thanks guys!!
  4. Idk. Like I said, Im just on some dumb stuff right now. I havent coded in a while and I think I have "writers block"! I really need to refresh my memory with my php reference book
  5. Haha, wow, that could work. I am going to try it out. I will post back here. See, thats what I mean, I would have probably eventually came up with that, but sometimes I just get a complete "block" and can not think of any solution. There is always a solution and alternative way to do ANYTHING in PHP, thats what I love about it! My problem is I was trying to get the variable $email to set before the form is submitted so it will post to a URL with the $email variable in the URL. Im just on some dumb shit right now!
  6. Yeah, I would do that, but I need to capture their paypal email address which they fill out in a form that submits to the next page. For some reason it just isnt registering it. I think it could be because I am using an image as the input type, rather than a submit button. Idk, im really confused, I cant believe i am even having trouble doing this. I have done this so many times before IM just so lost. Its been a few months since I coded
  7. Ok really all I was trying to do is register a variable then redirect to the next page, kind of like a form would do. I guess its a pretty shoddy way to go about it. This is what IM doing, can anybody tell me an easier way to do it? Im not that new to PHP, I have been coding PHP for years now, I am just not a great thinker. This way is new to me because instead of using a form submit button I am using an image instead. So, my problem is I need to register $email which is $email = $_POST['paypal_email']; because the next page will need this variable in the URL. I have a form where the user enters their email and clicks a button to submit the form to get to the next page which is the URL with the email var. Here is the code: <?php $email = $_GET'paypal_email']; ?> <form action="" method="get"> <p><input type="text" style=" width:230px; height:60px; border:2px dashed #D1C7AC; font-size:18px;" name="paypal_email"></p> <p> </p> <input type="image" name="continue" src="images/arw_submit.png" alt="submit" value="Submit"></form></div> <?php if(@$_GET['continue'] == "Submit") { $email = $_POST['paypal_email']; header('Location: http://mysite.com/start.php?offer_pgid=071691&email=$email'); } ?> Thats what I was currently trying to do. Before, I just simply did this: <?php $email = $_POST['paypal_email']; ?> <form action="start.php?offer_pgid=071691&email=<?php echo $email;?>" method="post"> <p><input type="text" style=" width:230px; height:60px; border:2px dashed #D1C7AC; font-size:18px;" name="paypal_email"></p> <p> </p> <input type="image" name="continue" src="images/arw_submit.png" alt="submit" value="Submit"></form></div> And obviously, that didnt work because paypal_email was not registered yet before submitting the form. I think... I just never had this problem before for some reason? I have done this THOUSANDS of times before! Im really not this stupid guys, I just dont know, I cant think right now. Im sure I will kick myself in ass once I get the right code!
  8. Ok I am getting SO ANNOYED with the NOTORIOUS STUPID header error. All I am trying to do is use header location later in the page. There is absolutely NO php before it. None at all. Its just HTML, and at around line 200 I am trying to use header location to redirect to a page. Of course, I am getting the header error. I just dont understand WHY I cant use header location unless its before everything!? Im not even using any PHP except for the header location in that file!! I will never get the whole header thing. I dont care either. I just want to be able to use header location anywhere as long as Im not sending any cookies or anything before it. Is it even possible to use header location unless its on the first damn line!? Thanks guys!
  9. Awesome! Thank you! Very good information to know, I learned alot. I will definitely use this and apply it in the future!
  10. Ok, so now I have that floating to the left, and I put another one right next to it, but I set that to float right. Now, how in tarnation do I allow text to go under it??!! Maybe I am not that great at HTML/CSS!? CSS is a little rusty to me. I still havent learned it all.
  11. Hi! This is probably so dumb of me, but I can write HTML pretty well, but I have never came across this problem before. I am trying to display an arrow image to the right side of a text box that I have on the left side in the middle of the page. I want to position it in the center, to the right. See here http://fastdollar.us See the text box labeled "step 1"? Then you see the arrow underneath it? I am trying to display that to the right center of the text box. It just keeps wanting to display underneath it. I have never ran into any problems like this before! Very odd. Probably some css hack could achieve this? Thanks!
  12. Oh ok. Thanks for the info. So now I have another question. I need to set a cookie after the database operations and the email has been sent. I cant do this because of that, I will get header errors. So how can I do this? Thanks!
  13. Thanks! I figured it out. For some reason I was putting the $link var in the mysql_query instead of the actual $sql variable. I got it working. Thanks guys. And GOD php is such a little girl whining about some whitespace! They need to fix that!
  14. Ok well I deleted the whitespace and now there are no header errors, but now Im getting the custom error message, basically meaning the database was unable to insert anything and the email was not able to be sent. I added mysql_errno and got 1064. Now I cant find any where online what the error is for this code. Does anybody know what the mysql error number 1064 is? Thanks!
  15. Absolutely nothing! Thats why I dont get it. There is nothing at all before the php tag. Just whitespace. Could that cause this?!!
  16. I ABSOLUTELY HATE header errors! I CAN NEVER use session_start() because I ALWAYS get this error. I have looked everywhere and still cannot find a solution to my problem. All I am trying to do is add session_start(). Its on the VERY first line of the page, and there is no code before it at all. Here is my code: <?php session_start(); $txnid = session_id(); if(isset($_GET['email'])) { /* * include database connection page */ include("db.php"); /* * insert to db */ $sql = "INSERT INTO `TRANSACTIONS_TAB` (PASSWORD,USER_EMAIL,PAY_STATUS) VALUES ('$txnid','$email',0)"; if(mysql_query($link)) { echo "Session stored!"; $subject = "Your Cash Code From mysite"; $message = "Hello, <br/> Your cash code is ".$txnid."<br/> Please do not share with anyone. This code can only be redeemed once. Once redeemed successfully, the PayPal transaction will be initiated and payment sent to the email address you provided. If you did not recieve the payment, please contact support. "; $from = "admin@mysite.us"; // include from email address $headers = "From:" . $from; mail($email,$subject,$message,$headers); echo "Your cash code has been sent to your email address!"; } else { echo "An unknown error has occured. Please contact support and mention error ID CCF1."; } } ?> Here is the errors Im getting: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/mydock/public_html/mysite/genCashCode.php:3) in /home/mydock/public_html/mysite/genCashCode.php on line 4 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/mydock/public_html/mysite/genCashCode.php:3) in /home/mydock/public_html/mysite/genCashCode.php on line 4 An unknown error has occured. Please contact support and mention error ID CCF1. I kind of now just realized it could be caused from sending the email. How can I make this work then if this is the case? Thanks
  17. After reading through the manual I still just dont get it. I dont understand WHAT its ordering by when I order it by a certain value. For example when I "ORDER BY date ASC" what is it going by? It just orders it in some damn random fashion? Its so confusing I just want to be able to order from the most recent added. I dont get ordering because when you order by a value it just orders it randomly, like if I wanted to sort it through highest value to lowest how the hell would I word that? Would I have to do something like this: "ORDER BY pointsvalue WHERE pointsvalue = 5 DESC" where 5 is the highest value. Sorry if Im being vague and making no sense I just am frustrated this makes no sense to me its so damn hard to order something!
  18. I have an offer database that I want to order by a few different factors. I would rather order them from top to bottom, top being the most recent added value in the table. I was just wondering what are all of the ordering options? I know you can order by certian values in the table either desc or asc, but when I order from desc by the value in my table "date" its never right. I was kind of hoping that there is a built in function that orders them from most recently added? I would also like to have the option for a user to sort them through the credit value, which is a number from 1-5, with the highest to the lowest descending. It never seems to work when I order them from the number value, its always just random. I'm confused and if anybody can give me some insight I would appreciate it! BTW, Im not a noob I just have never really worked with ordering SQL!
  19. As I already told you in my first response - just append the session variable to the end of the links. I'm really struggling why either you are not understanding what I am saying or why I am not understanding what you are asking. //Query the links in the DB $query = "SELECT link FROM links_table"; $result = mysql_query($query); //Output the links with the session variable while($row = mysql_fetch_assoc($result)) { echo $row['link'] . $_SESSION['login'] . "<br>\n"; } LOL!!!! Thanks bro! Haha wow why didint I think of that? Lol I dont know why I didnt understand what you were saying until you provided the code. Haha Im an idiot. Thanks again!
  20. supposed to mean? Are you wanting the replacement to happen when you output the values to the page, are you wanting to change the values in the database, or what? You are not making any sense. If you are wanting to make the replacements as you output to the page, then str_replace() is a viable option. But, as I stated above, if the values from the DB are only the links, you don't need any special handling, just append the session value as you output the URLs. If you are trying to update the values IN the database there are a couple of simple solutions - but again, I would need to know if the "values" consist of only the URLs or if the URLs are embedded within more text of the DB value. In other words, would http://mysite.com/index.php?page=offers&blah=blah&sid= be the entire DB value for the field, or would it be something like Text before the link http://mysite.com/index.php?page=offers&blah=blah&sid= text after the link? Im sorry I know its hard for me to explain to make any sense. I am inputting links into a database which I will display all the links on a page the user gos to. So Im wanting to be able to take all of the links and have it automatically append the session on the end of the link after sid=. I could just do it manually but it would take for ever bc I have hundreds of links in the database.
  21. Thanks, but str_replace isnt what Im looking for. I simply need a function that will find all instances of the string I enter & replace it with the new string I enter. I cannot put into a variable & echo it, It needs to automatically do it. Wait, would this even be possible? I dont know.. but what I will be doing is fetching all of the results in a table & use a while loop to display them. They are links like above, but since I cant echo php code through mysql I need to replace the last variable in the url with the session by using this replace function. So I wouldnt be able to put the replace results in a variable then echo it, it would never work for me. Is this possible??!
  22. Im dealing with html links in a database where I need to execute a small piece of php code. Well mysql doesnt execute php code thats held in a table. The easiest way for me to do this is just add the links without the code, & set up a function that will replace anything I set to for example in my case a link lookin like this: http://mysite.com/index.php?page=offers&blah=blah&sid= needs to look like this; http://mysite.com/index.php?page=offers&blah=blah&sid=<?php echo $_SESSION['login']; ?> so I would need a function like <?php $replace('sid=','sid=<?php echo $_SESSION['login'];?> ?> something like that. And I know its possible & I could create a function like this but honestly right now I am so tired after working 12 hours im lazy dont want to think to hard while I know there are a lot of people out there that have a function like this already. If you dont have one & dont feel like writing one for me could you atleast point me in the right direction so I dont have to think to hard?! Thanks!!
  23. Ic. Thank you. So my new question would be, how can I possibly do this? The code is not executing. I need the session appended to the end of the URL. This isn't possible then? PHP cannot execute through echoing the database results?
  24. PHP code won't execute from within a database though. It's just a string. Why are you passing the session id around through the querystring anyway? Yes your right I just realized that. I inserted the code through PHPmyadmin successfully but when I echod the results on my site I saw that it didnt execute. Im just passing a session variable because the links Im using through my advertising network needs the userid appended to the URL so it can postback to my site saying userid completed the offer so my script can credit the user. Its for my "points" site. Im just looking for an easier way to add offers.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.