Brian W
-
Posts
867 -
Joined
-
Last visited
Posts posted by Brian W
-
-
use this instead, its cleaner and likely will fix your problem...
// Let's mail the user! $mail = "email@address.com>\r\n"; $subject = "Quote: Web Design - $domain"; $message = "Name: $fullname Company Name: $company E-mail: $email Phone: $phone Quote Type: $quotetype Domain Name: $domain Desired Pages: $pages Organization: $comments_organization Competitors: $comments_competitors Appealing Sites: $comments_appeal Status: $comments_status Do: $comments_do Comments: $comments"; $header = "From: $fullname<$email>\r\n"; $header .= "X-Mailer: PHP/" . phpversion(); mail($mail, $subject, $message, $header); echo "Confirmed email sent";
-
is backslash, example: Sue\'s
forward slash won't hurt anything
mysql_real_escape_string() will prevent sql injection, correct.
To remove spaces and non letter characters, use:
$string = preg_replace('/\s+/', '', $name);//get rid of spaces $reference = preg_replace("/[^a-zA-Z\s]/", "", $string);//get rid of anything but letters.
-
URL string variables are accessible through $_GET, not $_POST...
$question = $_GET['question']; $firstname = $_GET['name_first']; $email = $_GET['email'];
use this to find out the array keys to use in a very readable fashion:
<?php die("<pre>".print_r($_GET, TRUE)."</pre>"); ?>
-
Something like:
if(!isset($_SESSION['unique'])){ $unique=rand(10000,99999); $_SESSION['unique'] = $unique; } else { $unique = $_SESSION['unique']++;//increment by one }
But I think I'm really lost as to what you plan on doing here.
If you need to keep track of data someone filled out, you don't want to increment because then how are you supposed to pull their info again?
-
why don't you just save a unique identifier as a session and also save it in the db?
-
<?php include 'dbconn.php'; $result = mysql_query("SELECT * FROM picks WHERE expiredate = CURDATE() AND CURTIME() < expiretime AND starttime < CURTIME()" ,$conn); $showResults = true; if(!mysql_num_rows($result)) { unset($result); // there are no matches echo "<div align=\"center\">There is no pick available at this time ".$edate."</div>"; // run a second query $result = mysql_query("SELECT * FROM picks WHERE expiredate > CURDATE() ORDER BY expiredate ASC LIMIT 1",$conn); // check results if(!mysql_num_rows($result)) { $showResults = false; } } // display the results from either the first or second query if($showResults) { while ($row = mysql_fetch_assoc($result)){ $pick = $row['pick']; $event = $row['event']; $starttime = $row['starttime']; $endtime = $row['expiretime']; $enddate = $row['expiredate']; $etime = ( date("g:i a", strtotime($endtime)) ); $stime = ( date("g:i a", strtotime($starttime)) ); $edate = ( date("m/d/Y", strtotime($enddate)) ); } } ?>
???
-
Resets how? I'm unclear as to what you mean by that...
btw, that date format is:
date("l F j, Y");
but the "st", "nd", "rd", "th" endings I don't know how to get. Possibly one of our gurus would.
-
well, as long as what we gave you helped... I guess it works. But if your outputting the selection with php, wouldn't it be easier/more logical to simply not output the other radio boxes if they don't have options?
If you want to present to the user that there is sometimes options, but not in this case, you can disable the options.
One:<input type="radio" name="Radio" value="1" id="Radio1"><br> Two:<input type="radio" name="Radio" value="2" id="Radio1" disabled><br> Three:<input type="radio" name="Radio" value="3" id="Radio1" disabled>
-
you need a conditional statement to determin whether to print "checked=\"checked\"" or not. The condition will likely be something like
<?php if($_POST['gender'] == "Male" || $rows['gender'] == "Male"){ echo "checked=\"checked\""; } ?> -
why do you need it be invisible?
<input type="radio" name="Radio" value="1" id="Radio1" style="display:none;">
to undo the hide:
<a href="javascript:void();" onClick="document.getElementById('Radio1').style.display='';">Show</a>
-
well, if you know where it is you can use file_get_contents() to pull the image's code and then use headers to force it out as an image:
header('Content-Type: image/jpeg'); -
Can you post the code for the entire page?
PFMaBiSmAd may be onto something... try pasting the code into a new txt file and then save it over your old php file.
-
it would help if your told us what the error message said...
Also, your brackets are not balanced... but that very well could be due to it being only a chunk of your code.
-
if index.php is your default document, it should be used automatically for www.mydomain.com
But if it isn't, it is more likely some server configuration you'll have to mess with.
btw, if it is forwarding you to www.mydomain.com/index.php with the URL string "?www", that may be a mod_rewrite issue...
-
if you use the code tags around your php or even html snippets, you will likely get more help
[ code ]Like this but without the spaces in the tags[ /code ]
would be
Like this but without the spaces in the tags
-
Something like this
<?php $to = "johndoe@thesite.com"; $subject = "Hello"; $body = "<span style=\"font-size:12pt\">HI!</span>"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=utf-8\n"; $headers .= "From: Your Pal <yourname@yoursite.com>\n"; if(!mail($to, $subject, $body, $headers)){ die("Error sending message"); }
The header Content-type specifies to use html. Some tags aren't supported, but they are far and few so no worries there. No JS and I don't believe CSS is supported usually.
-
example for doing this in the code
<?php session_start(); if((time() - $_SESSION['last_access']) > 5){ $_SESSION['last_access'] = time(); die("Session timed out"); } else { $_SESSION['last_access'] = time(); die("Good, you refreshed before 5 seconds"); } ?>
-
fine, you've bested me this time by technicality. On guard! lol
-
Theory, 'hint' isn't the name of the field... idk, maybe way off. (remember, if its 'Hint', 'hint' wont work)
while($b3 = mysql_fetch_array($w3)){ die(nl2br(print_r($b3, TRUE)));//This will kill the application and feed out the variables, copy and paste the output into a reply. $id = $b3['id']; $end = date("Y-m-d h:i:s", strtotime($b3['exp'])); $id = $b3['id']; $name = $b3['name']; $package = $b3['package']; $start = date("Y-m-d h:i:s"); $hint = $b3['hint']; $price = $b3['price']; }
-
"thispage.html" won't work, "thispage.php" assuming your server supports php.
Secondly, I'm going to venture a guess you asked this somewhere else and they suggested php but you aren't familiar with php at all. right?
If so, consider paying someone to do it or starting by reading some tutorials for beginners. Most of the members of this website have recommended reading material.
-
I've thought about it and am expanding my offer to organizations that provide a free service to the public. This does not include friends/dating social networking, game sites, or open source projects. This may include a website for your daughters soccer team, a church website, or some other free service, etc.
-
Let me further express that the offer of free development is ONLY FOR NON-PROFIT ORGANIZATIONS. Questionable requests will need to show evidence of their legitimacy.
-
Free application development for non-profit organizations including simple websites and even complex, database driven websites. 3 tier applications accepted. I'm interested primarily in ground up development, but I will consider doing repairs and expansion to already existing applications.
I'm also available other freelance work, inquire for rates.
-
If I raise the font size, wouldn't you agree the image would likely need to have a larger width to compensate? What do you think the max width should be to be comfortable on most forum signatures?
On a previous version I had some examples, there was an overwhelming response that it was not web 2.0, too cluttered. I do agree, when I have it pulled up on my coding system at home (about 29 inch LCD monitor), things get a little spread out...
Why not hybrid? Sorry, I'm not really on top of current industry standard per se.
Added label tag, not sure what they do besides allow for users to select fields by clicking on the adjacent text.
wouldn't it be easier to use a single table for the tabular data?Are you talking about the results from the query?
[SOLVED] Javascript variable to php?
in PHP Coding Help
Posted
use javascript's window.location to send the variable via query string... example (not tested):