-
Posts
1,903 -
Joined
-
Last visited
-
Days Won
3
Everything posted by mrMarcus
-
Registration pages validate in Iexplore but not Safari
mrMarcus replied to darrenwindle's topic in PHP Coding Help
This is why you don't skimp on hiring an experienced developer to create the online image for your company. Your website is your face on the internet. How are you certain that it's a browser issue? If you replicate the process in a complete identical manner on IE and then on Chrome, do you always, and I mean always get an error in Chrome? I don't see anything off-hand that would cause an issue in one browser and not the other. However, your code is a disaster and it hurts my eyes just looking at it. -
Change: "<br>website: <a href='$website' target='_blank'>" . $row['website'].'</a>' ; to: "<br>website: <a href='http://". $row['website'] ."' target='_blank'>" . $row['website'].'</a>';
-
You can have a script run 24/7 in the background without issue. Just make sure that the script is efficient and isn't hogging valuable resources. If it does, you'll need to rewrite it so it's not even a dot on the radar.
-
Wowza's. I wasn't expecting that reply. I just meant for you point post the single line that has the anchor tag on it so I don't have to go sifting through a bunch of lines of completely irrelevant code. I just want to see what's being outputted to the page to see what the issue might be. In fear of this going back and forth for 20 minutes, I believe this is the line in question: <h1>Tennyson Lodge,<br>12 Tennyson Road,<br>Worthing,,BN11 4BY<br>phone: 01903201111<br>email: [email protected]<br>website: <a href='' target='_blank'>www.a1worthingmoves.com</a></h1> And even more specifically: <a href='' target='_blank'>www.a1worthingmoves.com</a> As you can see, the website is not being included within the href='' attribute. That's why when you click the link it just takes you back to the same page... 'cause leaving that blank makes a reference to the current page.
-
If you view the browser source, what does it show? Post here, please. (just the <a> reference, and not a million lines of code)
-
Registration pages validate in Iexplore but not Safari
mrMarcus replied to darrenwindle's topic in PHP Coding Help
What are the errors? Is this a javascript issue or PHP? PHP is server-side, therefore, is not biased towards different browsers. -
Probably because your array is within a condition. Move it outside your if(isset($_POST['submit'])) condition, and the error should go away.
-
How do I restrict people from spamming a like button?
mrMarcus replied to Shockdot's topic in PHP Coding Help
Could have condition where user's must also be logged in to "like" as user could simply delete the cookie and abuse the system. Check against IP/username. -
There should never really be a point in which you are populating an array with keys/values that are completely unknown. Know what I mean? Do you have an application that you are currently working on? Post some code and the intentions behind the code. You don't need to know the value. You need to know the key. If you are, for whatever reason, unsure what the key's might be, stick with an indexed array instead of an associative array. But I still fail to think of an application where one would not know the structure of their array.
-
array[0][1] wouldn't work for obvious reasons. $str = array( 0 => array( 'something1' => array('stuff', 'stuff'), 'something2' => array('more stuff', 'more stuff') ) ); echo $str[0]['something2'][0]; // prints 'more stuff'
-
Grabbing values from a URL means you are using GET method, and in turn, stores all of the parameter values within the $_GET superglobal. You are checking that if the REQUEST_METHOD is POST, do something. Well, the REQUEST_METHOD will never be POST in your case. It will be GET.
-
You're missing a closing single-quote: $row_myrecordset_RS['id_property] should be: $row_myrecordset_RS['id_property']
-
You still need to change your redirection to: header("Location: view01.php?id=" . $id); and it will take you back properly.
-
It appears that ?id= in your action is not carrying over. Remove that and add it as a hidden field in the form: <input type="hidden" name="id" value="<?php echo $id; ?>"/>
-
I managed to update your db using the URL and bypassing your form. I changed phone number to 5555555 and website to yahoo.com Seems like that code is OK.
-
And I told you you need to sanitize your incoming form data. You didn't, but have now given anybody the ability to mess with your database by posting login credentials to your form. I strongly suggest you immediately change the following: $query = "UPDATE companies SET website = 'website', phone = 'phone', phone2 = 'phone2', premiumuser_description = 'premiumuser_decription' WHERE id = 'id'"; to: $query = "UPDATE companies SET website = '". mysql_real_escape_string($website) ."', phone = '". mysql_real_escape_string($phone) ."', phone2 = '". mysql_real_escape_string($phone2) ."', premiumuser_description = '". mysql_real_escape_string($premiumuser_decription) ."' WHERE id = ". mysql_real_escape_string($id); Edit: not that anything could have been done at this time as you removed all your variables from your query; however, as soon as your SQL became capable of accepting form data again, you could have been in trouble.
-
Why did you say this? i assumed you wanted me to delete them?? No, I never said to delete anything. I made a typo though. The following: <form action="view02.php?<?php echo $row['id']; ?>" method="get" enctype="multipart/form-data" class="cursive"> needs to be changed to accommodate ?id= <form action="view02.php?id=<?php echo $row['id']; ?>" method="get" enctype="multipart/form-data" class="cursive"> Edit: having to wait 5 seconds during login was rather annoying. I suggest you remove. People like instant.
-
No offense, but what you really need to do is go back and learn the very basics of PHP. You have removed your variables from your query now for some reason. And nowhere in your code are you SELECT'ing an `id` from the database defining $row in the script above. Unless there is something in 'php only scripts/db.php' that does that. Otherwise, $row['id'] is not set and therefore will not work as expected.
-
In doing this, you will now have to adjust how you're handling your form items in your PHP: $phone = $_GET['number1']; $phone2 = $_GET['number2']; $premiumuser_decription = $_GET['description']; Will become: $phone = $_GET['phone']; $phone2 = $_GET['phone2']; $premiumuser_decription = $_GET['premiumuser_decription']; And you will also need to add a hidden field, or append to your action, the ID in question: <input type="hidden" name="id" value="<?php echo $row['id']; ?>"/> or <form action="view02.php?<?php echo $row['id']; ?>" method="get" enctype="multipart/form-data" class="cursive"> I'm also starting to wonder where $row['id'] is being set in the following line: header("Location: view01.php?id=" . $row['id']); As the form is on a different page than that page, and you are clearly not getting that from the database to populate the header(). So, change that to: header("Location: view01.php?id=" . $id); And please, PLEASE, sanitize your incoming form data using mysql_real_escape_string: // e.g. $query = "UPDATE companies SET website = '". mysql_real_escape_string($website) ."' ... and so on And for good measure, you can remove the enctype attribute from your form as you are not handling file uploads and such.
-
Your entire concept of submitting forms is wrong. You have hyperlinks next to each input in your form which is incorrect as the information will not be passed to your form parsing script that way. Remove your "Update" hyperlinks and add a submit button to the form: <input type="submit" name="submit" value="Update"/> Edit: can't believe I didn't see this earlier. Forms are submitted as a whole. To do fancy updates like you're thinking, you will need AJAX. But do not worry about that for now.
-
In basic form, if Max Baldwin's ID in the db table is 547 then the link would be (something like): http://www.your-site.com/profile.php?id=547 And on profile.php you would grab that ID from the URL and shove it in a query.
-
Not sure how you managed to get exit(0);; exit(); from the code I gave you. Simply put: exit(0); However, that is not the problem. Can you post your latest form. And... Meaning, you literally see '$website' on the screen when you echo $query?
-
$website is being printed to the screen in variable form? Can you post your current code, please?