vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need to know how to fix this (https://vborg.vbsupport.ru/showthread.php?t=182420)

cheat-master30 06-13-2008 09:33 PM

Need to know how to fix this
 
I'm trying to change over a form and posted information from register globals variables to using superglobals, and have removed the errors, but the data isn't actually now being posted. I currently have this as the form

Code:

<form action="CodeOutput.php" method="POST">
<select name="CodeT">
[options here]
</select>
<select name="Code">
[options here]
</select>
<input type="text" name="Value" />
<input type="text" name="Code1" />
<input type="text" name="Code2">
<input type="submit">
</form>

And this as the PHP script it's sent to:

Code:

<?php
print '$_POST["CodeT"]$_POST["Code"]&nbsp';
print '000000$_POST["Value"]<br />';
print '$_POST["Code1"]<br />';
print '$_POST["Code2"]<br />';
print 'D2000000 00000000';
?>

(Don't ask why the format, the purpose of the form and the codes generated need to be in the format of eight characters then a space, then eight characters then a line of the like and ending in the D2 thing...)

It worked fine with register globals on and the values as variables sent from the form, but as soon as I tried to use the superglobals for PHP5 and PHP6 compatibility, it stopped actually sending the data. Any ideas why or how to fix this?

MoT3rror 06-13-2008 10:03 PM

Well for starters you can't have variables in single quotes.

So I would suggest using code like this.
PHP Code:

print $_POST['CodeT'] . $_POST['Code'] . '&nbsp';
print 
'000000' $_POST['Value'] . '<br />';
print 
$_POST['Code1'] . '<br />';
print 
$_POST['Code2'] . '<br />';
print 
'D2000000 00000000'

Also I would suggest to valuadate this date before you output.
Here is a article to use as reference.

cheat-master30 06-13-2008 10:07 PM

If you're wondering why there wasn't any security, it's because as a script while it was/is going to be used on my site, it won't actually submit to a database, but it's just ran whenever someone submits a form, with nothing saved to the server via a post request.

But I'll try what you said, and thanks.

Edit: Worked a treat, thanks.


All times are GMT. The time now is 10:48 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
  • Page Generation 0.02762 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete