![]() |
Form action help
Code:
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?> E.g: Code:
<form name="upgrade" method="POST" action="{vb:raw _SERVER.PHP_SELF}"> |
Does that not work? Or is it the htmlspecialchars() that you're wondering about? I think if you use vb:var instead of vb:raw it does htmlspecialchars() on the value.
|
It's this page you see:
http://spawnscape614.co.uk/forums/reportuser.php? And I'm trying to validate the first input for a test. And when clicking the send report button it simply reloads... Appropriate html: Code:
<form class="vbform block" action="{vb:raw _SERVER.PHP_SELF}"> PHP Code:
Idk why it just reloads. And I tried the var instead of the raw and it didn't work. |
Could anyone up?
|
Sorry, I missed your response.
OK, I had to do a little test to figure these things out, but first you need method="POST" in your form tag. Second, the indexes into $_POST are the name attributes of the input fields, so if you want to check for submit, you want to add name="submit" to that tag like: HTML Code:
<input name="submit" type="submit" class="button" // etc If you don't have a name attribute, the input will not go into the $_POST array at all. You also want to use 'username' when checking the name, since that's the value of the name attribute. |
Hmm it's still not working. Do you have skype? I'll pay for your assistance btw.
|
I can't really do that right now, but here's the test program I used. I just put it in a file called test.php and pointed my browser there. It's not a vbulltin file at all, just a simple php file.
PHP Code:
|
Yes, what I put worked on a page without vbulletin; although it doesn't work inside a vbulletin page.
|
Oh, OK. Did you try this for the code:
PHP Code:
and you said you added name="submit" to the submit button, right? It's hard to tell if that's everything you need without seeing the big picture. Where are you putting that code, if that a plugin, or is reportuser.php a custom script? (I guess it's not a vbuletin file so that's probably it). |
It's a basic custom file.
Here is the page: http://spawnscape614.co.uk/forums/reportuser.php It's not a plugin either. Would you like the entire template? |
All times are GMT. The time now is 10:43 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|