premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
[SOLVED] IF Statement using OR instead of Else If with AND involved?
premiso replied to Stryves's topic in PHP Coding Help
That is how it should be done if that is what you want. Way to solve your own question -
PHP Curl Send Post Data
-
Look into curl as that will allow you to send data via POST to an outside website.
-
strtotime would be the function to look into. You may have to convert that date into a different format however using explode or a similar method to re-construct into a format that strtotime will take.
-
[SOLVED] Sending my html page using PHP mail function
premiso replied to matt.sisto's topic in PHP Coding Help
Your code is honestly a mess. You have the whole HTML in the body, however you go in and out of PHP inside of the string variable. This is not kosher, look at the code you posted on reply #6, you will see where the highlighting goes haywire and yea. I would suggest using ob_start and remove the string definition of the $body. You will have to unescape all the " quotes but it will make it work for you. $subject ="SRC: Invoice"; ob_start(); ?> <!-- your html/php code here --> <?php $body = ob_get_contents(); ob_end_clean(); if(!mail($to, $subject, $body, $headers)){ die("Error sending message"); } ?> You should also look up into variable definitions and proper syntax as well. As it is just a massive mess and clear that you do not fully understand how it should work. -
[SOLVED] Create a MySQL INSERT from a previous SELECT with 2 values changed
premiso replied to SoWhy's topic in MySQL Help
Ok, so what exactly are you asking here? $result = mysql_query("SELECT * FROM table_name WHERE uid = " . $userid); while ($row = mysql_fetch_row($result)) { $newSQL = "INSERT INTO table VALUES ('', {$row[0]}, '{$row[2]}', {$row[3]}, '{$row[4]}', {$row[5]}, {$row[6]}, '{$row[7]}')"; mysql_query($newSQL); } Is that what you are looking to do? -
[SOLVED] Creating multi-dimensional arrays in a loop
premiso replied to Doug_M's topic in PHP Coding Help
// perform query $result = $mdb2->query($sql); $apps = array(); // get results if ($result != null) { // build app array while ($row = $result->fetchRow()) { $apps[] = $row; } print_r($apps); } Should produce a multi-dimensional array. -
[SOLVED] password protected site vulnerability
premiso replied to kcp4911's topic in PHP Coding Help
lol I do not get paid that much. It would be nice, but oh well. And actually this forum is run off of donations, so I just donate my time here. -
[SOLVED] password protected site vulnerability
premiso replied to kcp4911's topic in PHP Coding Help
To answer why you would use sessions to store user data over a cookie is that session files are stored on the server. Thus you have to authenticate to that sessionid in order to retrieve that data. With Cookies anyone can potentially steal the cookie with a trojan or spyware and use that to authenticate to the site and viola they have all your information. So it is generally better to store the data on the server, where it is less likely to be hacked etc. But as neil suggested, cookies should be used to provide a means of authenticating a user and then you can store the user data in session for that session. -
display paragraph of text save to database through textarea
premiso replied to orange08's topic in PHP Coding Help
Post the code where the data is entered into the DB. get_magic_quotes_gpc if that returns true magic quote are on, if false they are off. -
When you view the source of the page that the iframe is on, what is the html code returned?
-
Change this: <?php echo (!$sitestyle)?'orange':$sitestyle ?> To be: <?php echo $sitestyle; ?> Because you set the default value with the code ignace provided to you. See if that gets you up and working.
-
Nope, your script will know where the temp folder is. To use the move_uploaded_file function you need the temp filename, which on your processing part should be something like $_FILE['tmpname'][0] or something similar, this can be looked more in depth at PHP.NET File Upload for the proper calling/usage. I am sure the user contributions will answer most of your questions. Your best bet to get answer to your questions is setup your script and try it. I honestly do not know what happens on a duplicate, cause I rename any files uploaded to a hash and store that hash in the DB with it's name to avoid issues like this.
-
<iframe frameborder="0" src="http://clients.mindbodyonline.com/ws.asp?studioid=<?php echo $_GET['studioid'];?>&stype=<?php echo $_GET['stype'];?>&sView=<?php echo $_GET['sView'];?>" title="Gentle Journey Online Booking System" width="915" height="1000" align="middle"> </iframe> Try that. Notice you were echoing the assignment. Not sure why it would work sometimes and not others, but hopefully that fixes your issue.
-
To me it sounds like a Caching problem on the box where you are noticing this issue. Clear your browsers cache and temporary files and see if that helps.
-
The point is, you strip out/replace all non-numeric characters. What this will do is give you just the numbers. If someone enters something like you have above, it would be valid, and it would just pull the numbers. It would be the exact same if they just typed in 1234432565 which would be valid. They key is the honest people will enter in the number how they want without fuss and the ones who do not want their number entered will enter in a fake number anyway. This way accommodates both people and does not tick off the honest person because they have to follow a set mask, which is annoying. However, the field should be limited to x characters on the form side so like 15 or 16 characters max. But as long as you get 10 digits out of it, thats a phone number and it is validated. EDIT: I mean honestly how are you going to tell if the phone number is truly a number? Find a webservice or database of numbers/area codes and match them to their zipcode ??? I highly doubt it. Entering phone numbers is more on the lines of the "honor policy" than anything.
-
If register_globals was turned off, which it would be a good thing if it was, then you are going to have to convert any item that comes from a form/cookie/get/server variable to the new standard: header("Location: {$_SERVER['HTTP_REFERER']}"); Would be the correct way to write that statement.
-
I always use sessions. The way users block sessions is by having cookies turned off or disabled. I do not think you should worry about this, at that is a small amount of users and they tend to know it is an issue. Alternatively, you can configure apache/.htaccess to append the sessionid to GET data, which is not SEO friendly but would allow anyone browsing to not have cookies turned on. But as stated above, it is really not an issue at all.
-
You have 2 href's inside of that one anchor tag. You are using single quotes within single quotes, which will cause a syntax error in Javascript. $link = "<a href='javascript:void(0);' onclick=\"window.open('xxx.php?rec=$record', '', 'width=800, height=1000, scrollbars=no')\" class='CT'>View Record</a>"; Should fix it.
-
[SOLVED] Sending my html page using PHP mail function
premiso replied to matt.sisto's topic in PHP Coding Help
$headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $headers .= "From: Admin <admin@salmonsreach.org>"; You were missing the .= on the 3rd header statement. Also I find that \r\n is better for sending header information. Why it was not working as the 3rd header statement was wiping the previous, so it was not sending the right mime-version or content-type. -
Not exactly. It should be used on any textual user input. If the input is suppose to be numeric, you should check for that and make sure it is the type that it should be.
-
Well your form is not setup properly as you do not have a <input in it. It seems like you may want to read up on some HTML Form Basics. I would recommend looking at one or a few tutorials on PHP Contact Form to help get you rolling.
-
If you are not receiving the mail, and you are using GMail, Hotmail, Yahoo, AOL etc, they are simply filtering it as SPAM. I highly doubt you can get around it, but you should contact your host and ask them what they suggest for you to use as headers etc for the mail function. If wipro.com is your domain name, I have had issues on my server of mail not being sent to any address @mydomain.com. I still have not found a resolution, but yea. Maybe your host will know why.
-
hw.php <?php echo "<?xml version=\"1.0\" ?> <title>Hello World</title>"; ?> On the remote site call: <?php $hw = simplexml("http://www.othersite.com/hw.php"); echo $hw->title; ?> I am unsure if that works, but that is the basic gist of what I know of a webservice. simplexml is how you would read it out, and I do not know if I setup my XML right or echo'd the object property right. So yea. The above is a real rough example that is untested. WebService on Wikipedia EDIT: For a more (much more) advanced webservice look into soap. The method I have shown, is not really a "webservice" per say. But for something simple, that would work. If you are looking for a real-world solution SOAP is definitely what you are going to need to use/look into.