The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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}"> |
#2
|
|||
|
|||
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.
|
#3
|
|||
|
|||
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}"> <label for="username">Enter offender's name: </label> <input type="text" class="primary textbox" id="name" name="username" tabindex="1" /></input><span class="error"> * <?php echo $usernameErr;?></span> <input type="submit" class="button" value="Send Report" tabindex="1" /> </form> PHP Code:
Idk why it just reloads. And I tried the var instead of the raw and it didn't work. |
#4
|
|||
|
|||
Could anyone up?
|
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
Hmm it's still not working. Do you have skype? I'll pay for your assistance btw.
|
#7
|
|||
|
|||
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:
|
#8
|
|||
|
|||
Yes, what I put worked on a page without vbulletin; although it doesn't work inside a vbulletin page.
|
#9
|
|||
|
|||
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). |
#10
|
|||
|
|||
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? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|