Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. So now you have some error messages to be resolved.
  2. Way too much code here to look at. Is that a dump of your data? Uhh....... Exactly what is not working? Are you getting errors? PS - tried to copy your code into my ide and find it has no carriage returns/line feeds. Can you perhaps post something a bit more presentable?
  3. Something is wrong with the code you are showing. Your assignment of $username is NOT in your query statement so what you are showing makes no sense since it can not be an sql error. We need to see the code before the $username= line to see how the interpreter is seeing it. For some reason it thinks that line is part of a query, so I think you have some previous code that has not been entered correctly.
  4. You can use explode to split up the query string into each "var=value" component. Then loop thru the resulting array and explode each of them into the var name and the value. $args = explode("&",$the_url_string); foreach ($args as $arg) { list($var,$val) = explode("=",$arg); (do something with this var/val pair) }
  5. I see a bunch of code that is apparently the contents of your html form (php does not have forms). So - why are you not adding the necessary 'table' html to this? Isn't that what you want to do? This chunk of code seems disjoint. You prepare a form and then you send an email. Odd stream of acitions.
  6. 1 - the two lines of code you show do not make sense to me. These are not proper url strings, nor are they proper php code. Please show the entire line in your script that generates this if that is what you are showing us. 2 - When you say you can echo stuff and see correct stuff, just where and when are you doing that echo? In the same script that creates it or in the script you are calling with this url? 3 - retrieving the data from the url? I assume you are now talking about doing this in the script that you mention in the url itself (as you have showed us). $_SERVER['QUERY_STRING'] would be the value you can use for that I believe. Perhaps with a urldecode command added to the result also.
  7. Is that supposed to be '?php=Contact-Us' ? Look for lines beginning with 'include' or 'require'. Those are files of code being injected into the main script that probably contain what you are looking for. Add an echo statement in front of each include and then run it in your test environment to see what shows up before the content you want to edit.
  8. I wanted to know the name of the script you showed us in case IT was the script that was what you were seeing unexpectedly. (Since your form tag didn't tell me.)
  9. One question at a time. Where to put the code in your web page?? Well - technically you don't. You place it in your php script. And that can be done wherever your logic dictates. It's up to you. Just realize that you won't 'see' the cookie until your script loads the next time. You receive the page, grab any inputs that arrive in the POST/GET array, decide what needs to be done, and if that decision includes setting a cookie, then you set it.
  10. And where is the line that is sending you there? And what is the name of the code you are showing us?
  11. Try using 'pathinfo' to break apart a fully qualified filename. Then apply your replace work on just the filename portion, and not the path
  12. Wrong. 1 - programming is all about writing a program to handle data and produce from one place the desired results. It is not about writing a custom piece of code for each user. 2 - What you are describing is data that will drive the client's experience. Store that data in a db and use the user's id to identify it. User logs in; script gets login (and validates it!!) and then uses that login id to go query the db for all the data pertaining to that user and outputs it to a webpage from a common script using variable data.
  13. What IS wrong? You don't give us any reason to suspect anything is wrong with this code. Do you have messages or results of any kind? Put some echo statements in the code to see what is happening. PS - Turn on PHP error checking to see if you have something in your code that doesn't work in your new php environment.
  14. Why do you have display errors on? Won't that display to your console as well as your log? Why do you have @ in front of those commands? You don't want to know about any error that may occur? Are you sure your script has access to the desired error log location? Is there in fact a log file to view? How about logging your progress as your script proceeds? Maybe it's a particular site that is killing your script somehow.
  15. This code is : 1 - too incomplete to analyze your problem. Where was $users defined? Dont' see it. 2 - for a newbie you sure have some knowledge of little-used syntaxes. Why don't you use the more common (and preferred) syntax for 'foreach' and 'if' instead of the ones you are using? Would make it easier for you to read and follow as well as for others. 3 - please post code properly should you decide to give us what we need to see
  16. Wrap your mod test in an if that tests if $I is not 0
  17. You also need to turn on php error checking so you can be warned about your syntax errors. This statement: echo "<b>"$row['name']. " - ". $row['age']"</b>"; is faulty. You have a string followed by a var name which the php interpreter is not going to recognize. You have a var followed by a string at the end. The interpreter is not going to accept those situations. This: echo "<b>" . $row['name'] . " - " . $row['age'] . "</b>"; will work.
  18. You really need to do some reading to learn a little bit about php and html processing. Your code shows that you have no clue. Your code shows you placing some values into some session vars. Can I ask you where those values are coming from? Do you know? To us, looking at your script sample, those are undefined values. If you php error checking turned on you would be seeing error messages.
  19. See my first post?
  20. Why are we even debating this? The OP has to get used to a new environment. Let's let him get used to it instead of finding fault with every nuance that is 'nu' to him.
  21. htmlspecialchars?
  22. Move those vars you have made to $_SESSION and then they will be available to your next script, if you start it there.
  23. I'm gonna guess that your provider gave you a uid/pswd to access the administration function of your site - cPanel perhaps? That gives you access to the phpadmin tool where you create dbs and tables in your dbs. Each db that you create has to have a userid and pswd created for it since in the long run not all users are going to have access to all your tables in all your dbs (in most situations). Be sure that you have done that before trying to connect. You may have missed that step when creating the db. I use just one set so that all of my connections use the same ones and I only have to create one standard module to do the connecting in any of my scripts. PS - Keep that uid/pswd that logs you into cpanel/phpadmin extremely private. It should not be used anywhere else (meaning don't use the same creds again for a db or an email account).. Period. It is the single most important of data you have that controls your entire site.
  24. Know first that FPDF, while great, still requires work to generate the pdf document. I have read (in posts) of other tools that can take an html page and create a pdf (sorry - you'll have to research them yourself) but I don't know how 'neat' those docs will look. Personally I love FPDF - gives me pretty much total control over my output and with a little experience has become a very handy utility for my apps.
  25. I find it most useful when I want to remove a session variable. Obviously php won't clean those up and at times some of them need to be deleted.
×
×
  • 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.