-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
creating tables in php leads to errors in phpmyadmin....
ginerjm replied to Maze's topic in PHP Coding Help
So now you have some error messages to be resolved. -
Adding Email to registering account + DB + Config File etc
ginerjm replied to Lewis2212's topic in PHP Coding Help
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? -
creating tables in php leads to errors in phpmyadmin....
ginerjm replied to Maze's topic in PHP Coding Help
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. -
Retrieving the data from htmlspecialchars(http_build_query($string))?
ginerjm replied to phpf's topic in PHP Coding Help
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) } -
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.
-
Retrieving the data from htmlspecialchars(http_build_query($string))?
ginerjm replied to phpf's topic in PHP Coding Help
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. -
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.
-
Redirecting My URL after submitting my contact form
ginerjm replied to Megan's topic in PHP Coding Help
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.) -
Creating/Using a Cookie to remember user preference
ginerjm replied to HenryCan's topic in PHP Coding Help
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. -
Redirecting My URL after submitting my contact form
ginerjm replied to Megan's topic in PHP Coding Help
And where is the line that is sending you there? And what is the name of the code you are showing us? -
Try using 'pathinfo' to break apart a fully qualified filename. Then apply your replace work on just the filename portion, and not the path
-
PHP to create new .js file for each registered user
ginerjm replied to vpetkovic's topic in PHP Coding Help
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. -
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.
-
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.
-
Cannot store selected form row items in variables
ginerjm replied to BenjaminDisco's topic in PHP Coding Help
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 -
Wrap your mod test in an if that tests if $I is not 0
-
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.
-
Redirect url after contact form submission and include function
ginerjm replied to Megan's topic in PHP Coding Help
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. -
See my first post?
-
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.
-
htmlspecialchars?
-
Redirect url after contact form submission and include function
ginerjm replied to Megan's topic in PHP Coding Help
Move those vars you have made to $_SESSION and then they will be available to your next script, if you start it there. -
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.
-
How to create a PDF dynamically and send it has email attachement
ginerjm replied to sandeep250299's topic in PHP Coding Help
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.- 2 replies
-
- attachement
-
(and 1 more)
Tagged with:
-
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.