I want to take this PHP web form and basically do the same thing it does in VBscript from MacroScheduler.. The PHP form basically takes the input (in this case 'billgates') and returns a value called 'user id' ... I want to capture the userid and turn it into a vbscript or macroscheduler variable.
I have basically got the script started by using the httprequest to post to the form and get the full html results back which I was then going to parse with a regex query to find the 'userid'.
But this got a little tricky and I'm basically stuck now cause the regex won't work. I have the regex that was used in the PHP code, because my logic was to build a script using httprequest to post to the form and regex the results to extract only the userid.
here is the regex that the site above uses to parse the userid... but I couldn't get it to work in VBscript
Also, here's the code i've built so far. The html request retrieves the entire html response in %useridpost% just fine, but fails at the regex function and i don't know why!preg_match('/\binvite.addfriend_verify&friendID=[0-9]{1,15}\b/is', $result, $found);

Code: Select all
Input>userid,Enter a Popular Name with no spaces to get user id,
Let>PostData=id=%userid%
HTTPRequest>http://www.layoutsnetwork.com/id.php,,POST,PostData,useridpost
MDL>useridpost
//DOES THE REGEX to get USER ID
VBSTART
Function regExSearch(strPattern,str)
Set regEx = New RegExp ' Create regular expression.
regEx.Pattern = strPattern ' Set pattern.
regEx.IgnoreCase = True ' Make case insensitive. Default=False
Set matches = RegEx.Execute(str)
List = ""
regExSearch = Mid(List,1,Len(List)-1)
End Function
VBEND
//Perform the regex search
VBEval>regExSearch(\.invite\.friendID=\.([0-9]{1,15})\),"%useridpost%",useridreg
MDL>useridreg