The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Is there anyway I can easily add PHP code to a custom page using this mod... or something similar!
I can only seem to get HTML to work which is for the most part great, however, there are a few small PHP scripts which I would like to include in the custom pages. Any help would be greatly appreciated. Thanks a lot. :up: |
#2
|
||||
|
||||
![]()
Add your code anywhere in the PHP page you created. It can then be executed on that page.
|
#3
|
|||
|
|||
![]()
It only displays what is in the template though. How do I get it to display on the page?
EDIT: Here is what it is currently doing! - look in the top left. |
#4
|
||||
|
||||
![]()
Post up the code you're using in the script.
|
#5
|
|||
|
|||
![]() Code:
<?php $_ip = $_SERVER['REMOTE_ADDR']; echo "Enter the IP Address or domain name of the server that you want to ping.<br>"; echo "<form method='post' action='ping.php?do=ping'><input type='text' name='domain' value=''> <input type='submit' value='Ping'></form>"; if($_GET['do'] == 'ping') { $_domain = $_POST['domain']; echo "<pre>"; system ("ping -w 10 -c 5 $_domain"); echo "</pre>"; } echo "<br>"; ?> |
#6
|
||||
|
||||
![]()
Okay you can't echo anything out, anything you're using echo statements for needs to be set to a variable or directly placed in your template.
For example, this could be removed from the script and placed in the template: Code:
Enter the IP Address or domain name of the server that you want to ping.<br> <form method='post' action='ping.php?do=ping'><input type='text' name='domain' value=''> <input type='submit' value='Ping'></form> |
#7
|
|||
|
|||
![]()
I hate to hijack, but can this be done with dynamic pages that pass variables?
|
#8
|
|||
|
|||
![]()
The ping is now working, but the results are being outputted to the top of the screen.
I'm assuming now to get the results to appear underneath the form rather then at the top I need to turn something into a variable (as you mentioned) but I can't get this working. I seriously wish I was better at PHP coding - I'm just not meant to be a programmer though!!! Took me long enough to get the ping script working. ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|