-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
there are multiple foreach statements. which line is line 73. also wrap your code in code tags next time, especially if you have that much. also, the following area of code if (empty($_POST['work_phone'])){ //die ("ERROR: Please add your WorkPhone.."); header("Location: form.php?msg=ERROR: Please add your WorkPhone.."); exit(); } else{ might not be doing what you think its doing. That else statement is only connected to the if statement above it, and is not connected to any other if statement in that code. If you want it to be connected to the rest, you have to use else if statements. This won't make a huge difference, or really any difference the way your code is now, but may cause some problems in the future.
-
oops, didn't think it had an underscore, but thought I saw it somewhere. yeah sorry for incorrect code
-
PHP Contact Form mail script launching new page after sent
mikesta707 replied to solarparadox's topic in PHP Coding Help
<form id="form" method="post" target=”_blank” action="scripts/mail.php" name="form" > setting the target attribute to blank will launch a new window -
if you want someone to write the script for you I suggest you go to the hire a programmer forum. If you need help with a script we would be glad to help, but post the script you are having problems with, and what problems those are
-
I would just use strpos() or stristr() to check if there is a comma in that string, as they are faster. $cityandstate = "New York, NY"; if (str_pos($cityandstate, ",") === true) { echo "true"; }
-
[SOLVED] downloading from DB doesnt work
mikesta707 replied to LearningKid's topic in PHP Coding Help
the parse error is because of the following line if(!is_numeric($_GET['id']){ which needs to be if(!is_numeric($_GET['id'])){ ahh damit Adam get here first -
[SOLVED] printing individually selectable mysql rows to screen
mikesta707 replied to debuitls's topic in PHP Coding Help
You will want to set a get variable to the primary key of the specific entry of the row. for example, if your primary key was the column "id" you would make the link like: <td><a href=\"data.php?id=" . $row['id'] . "\" >" . $row['county'] . "</a></td> hope that helps! EDIT: sorry forgot the second part on the other page (in my example, data.php) you would do a simple SQL query looking for the row with the ID of $_GET['id'], and voila! Hope that helps! -
well assuming that the perl script and php script are the same, you should be able to pass an array in that function normally
-
no HTML hidden fields http://www.tizag.com/htmlT/htmlhidden.php
-
make your own function <?php function my_mysql_query($query, $link){ if (empty($link) && !isset($link)){ die("NO"); } mysql_query($query, $link); } ?>
-
submit the page 1 form to page 2. have the page 2 form submit its forms to page 3, and put the page 1 forms data into a hidden field on page 2, and submit that also. then on page 3, have the page 1 and page 2 data in hidden fields and submit the other forms normally hope that helps!
-
[SOLVED] mysql_real_escape_string() question
mikesta707 replied to RyanSF07's topic in PHP Coding Help
post the string you are inputting, and what you are expecting the output to be -
post the if statement that you have. its a simple process of if this echo this or if this echo this
-
... in $query = "SELECT * FROM locations $extrapart"; $result = mysql_query($query); instead of extrapart variable, use the session variable (in my code's case, $_SESSION['extra']) or set the $extrapart variable to $_SESSION['extra']
-
awesome! remember to click the topic solved button at the top of the page
-
in index.php $extrapart = (isset($_GET['county'][0]))?"WHERE County='".mysql_real_escape_string($_GET['county'])."'":""; $_SESSION['extra'] = $extrapart;//or just set the session var to the above then in your locations page either use the session var or set the variable to the session var's value. also, I don't know if you want to select everything from your database if the county isn't set, but currently your script will only select entries of a certain county if it's set, and everything from the table if the county isn't set. you may want to change this if this isn't desired
-
[SOLVED] PHP code not fetching all values from mysql db
mikesta707 replied to snorky's topic in PHP Coding Help
interesting. hmm, i'm at a loss then. The rest of the results are different right? as in row 0 in the table shows up as the first row, row 1 as 2nd row etc. It COULD be only returning 1 row, and the table gets populated with the results from that row, and that row has null or empty values for the fax and room columns. but I don't know how that would even be possible also, it appears that the fax column is all uppercase. try replacing "fax," in your query with "FAX," and check the case of room also. As you probably already know, SQL is case sensitive, so this may be causing problems also -
what are you talking about? he has 20 pages... and if he puts them into 1 array, the lines of code it takes to include every page is like 3-5
-
why wouldn't you just use the include function... make an array of your pages you want to include, and iterate through the array foreach ($pageArray as $page){ include($page); sleep(1); } is the eval function better in any way? faster perhaps?
-
Um, GET data is no more/less secure than POST data. A user can modify POST data just as easily than GET data. If you are not validating/cleansing ALL user data (GET, POST & COOKIE) you are not secure. yes true, but modifying GET data is, for lack of a better word, easier for the end user in my opinion. since it is right there on the URL line, most anyone can figure out how to change the data in a few seconds. then again, if he validates the data it doesn't really matter in the end anyways.
-
[SOLVED] PHP code not fetching all values from mysql db
mikesta707 replied to snorky's topic in PHP Coding Help
are you sure that those columns don't have null values in your table. If so, and your query works as expected, I don't see a problem in your code. there were no query errors or anything like that correct? -
serializing the array is probably a bad idea, especially if you are putting it in the URL, as anyone can simply alter the data in the variable. I would use either the post method, or the sessions method.
-
[SOLVED] PHP code not fetching all values from mysql db
mikesta707 replied to snorky's topic in PHP Coding Help
can you post your query?